Ticket #2 (closed bug report: fixed)

Opened 6 years ago

Last modified 6 years ago

Parser fails on x-y

Reported by: nibro Owned by: nibro
Priority: critical Milestone: Full code support
Component: parser Version:
Keywords: Cc: ndmitchell@…

Description

foo x y = fromIntegral $ x-y+1

Due to the HSX extension, x-y is considered a single identifier. The parser tries to be clever, but isn't clever enough when x-y is also combined with some other operator, e.g. x-y+1 above. Two possible resolutions:

1) Make the parser more clever. 2) Rule out x-y meaning a subtraction when the HSX extention is active.

Probably favor 2).

Change History

Changed 6 years ago by Neil Mitchell

  • cc ndmitchell@… added

This is the number 1 bug report in HLint, so would be a very useful fix.

Changed 6 years ago by nibro

  • status changed from new to closed
  • resolution set to fixed

I consider this bug fixed, though the overall library is still a bit in flux. But the darcs version of the library now only fails on the example program if the XmlSyntax? extension is given, otherwise it succeeds as expected.

When the XmlSyntax? is enabled, a programmer will need to put in spaces around the -. I consider that quite reasonable.

Note: See TracTickets for help on using tickets.