Ticket #1821 (closed bug: fixed)

Opened 1 year ago

Last modified 2 months ago

Parser or lexer mess-up

Reported by: simonpj Assigned to: igloo
Priority: normal Milestone: 6.10 branch
Component: Compiler Version: 6.9
Severity: normal Keywords:
Cc: df@dfranke.us Difficulty: Unknown
Test Case: read_1821 Architecture: Unknown/Multiple
Operating System: Unknown/Multiple

Description

This program gives a parse error:

module Par where

f x = x
  where
-- ######### x86_64 machine code:
    g y = y
    h y = y

With the HEAD we get:

Par.hs:7:8: parse error on input `='

This is killing the stage2 build of the HEAD, in ByteCodeFFI:

ghci/ByteCodeFFI.lhs:444:26: parse error on input `='

The problem is something to do with the comment (!). Remove it, and all is fine. I think something to do with Haddock. But surely comments should not mess up code? Programmers unaware of Haddock will not even look at the comments when trying to correct parse errors!

Happily 6.8 seems ok.

Attachments

fix1821 (145.3 kB) - added by dfranke on 12/10/07 15:13:15.
regress1821 (114.9 kB) - added by dfranke on 12/10/07 15:14:10.

Change History

11/05/07 14:29:59 changed by igloo

  • milestone set to 6.10 branch.

12/10/07 13:38:07 changed by dfranke

  • status changed from new to assigned.
  • owner set to dfranke.

Moving the comment to the indentation level of the 'g' makes the error go away. So I think this bug is correctly stated as " '-- #' comments affect indentation context.". This is up my alley so I'm going to have a go at fixing it.

12/10/07 15:13:15 changed by dfranke

  • attachment fix1821 added.

12/10/07 15:14:10 changed by dfranke

  • attachment regress1821 added.

12/10/07 15:16:12 changed by dfranke

  • testcase set to parser/should_compile/read062.
  • status changed from assigned to new.
  • owner changed from dfranke to igloo.

Squashed.

12/10/07 16:41:38 changed by dfranke

  • cc set to df@dfranke.us.

01/19/08 09:27:45 changed by igloo

  • testcase changed from parser/should_compile/read062 to read_1821.
  • status changed from new to closed.
  • resolution set to fixed.

Many thanks for the patch, dfranke! I've just applied it. Sorry for the delay.

09/30/08 08:40:24 changed by simonmar

  • architecture changed from Unknown to Unknown/Multiple.

09/30/08 08:51:33 changed by simonmar

  • os changed from Unknown to Unknown/Multiple.