Ticket #1821 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

Parser or lexer mess-up

Reported by: simonpj Owned by: igloo
Priority: normal Milestone: 6.10 branch
Component: Compiler Version: 6.9
Keywords: Cc: df@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: read_1821 Blocked By:
Blocking: Related Tickets:

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 Download (145.3 KB) - added by dfranke 5 years ago.
regress1821 Download (114.9 KB) - added by dfranke 5 years ago.

Change History

Changed 6 years ago by igloo

  • milestone set to 6.10 branch

Changed 5 years ago by dfranke

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

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.

Changed 5 years ago by dfranke

Changed 5 years ago by dfranke

Changed 5 years ago by dfranke

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

Squashed.

Changed 5 years ago by dfranke

  • cc df@… added

Changed 5 years ago by igloo

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

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

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.