
Hi Dons, You need to specify haskell 98 mode, with -98.
yhc -98 Main Success
Underscores and upper/lower case are broken in Haskell, if anyone can
tell us what it _should_ do then we're happy to implement it! Ideally
a short and comprehensible spec of what we should allow, and what the
result should be, to accept the maximum number of programs!
You could also add {-# OPTIONS_YHC -98 #-} to the top of the file to
get this test working.
Thanks
Neil
On 2/27/07, codesite-noreply@google.com
Issue 130: Parser error on _1-style identifiers http://code.google.com/p/yhc/issues/detail?id=130
New issue report by dons00: YHC's parser seems to die on the following (I think) valid Haskell identifiers:
main = let _1 = 1 in print _1
Dies with:
serenity$ yhc x.hs Error: /home/dons/src/nobench/spectral/integer/x.hs(1:12-1:11) Found {-ERROR 1-} but expected one of _in_ ; {-end-of-definition-} prefix _infix_ _infixr_ _infixl_ <string> <char> <rational> <integer> ~
However hugs, ghc, hbc and nhc98 are happy with it:
serenity$ runhugs +98 x.hs 1
Issue attributes: Status: New Owner: ---- Labels: Type-Defect Priority-Medium
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "yhc-bugtrack" group. To post to this group, send email to yhc-bugtrack@googlegroups.com To unsubscribe from this group, send email to yhc-bugtrack-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/yhc-bugtrack?hl=en -~----------~----~----~----~------~----~------~--~---

YHC's parser seems to die on the following (I think) valid Haskell identifiers:
main = let _1 = 1 in print _1
Underscores and upper/lower case are broken in Haskell, if anyone can tell us what it _should_ do then we're happy to implement it! Ideally a short and comprehensible spec of what we should allow, and what the result should be, to accept the maximum number of programs!
FWIW, this same bug was fixed in nhc98 nearly two years ago... You are welcome to find and steal the patch. Tue Jun 14 11:25:53 BST 2005 malcolm * Fix lexical error (masquerading as a parse error) with an underscore pattern e.g. "f _2a", when the -underscore flag is off (the default). Because the character following the underscore is neither lower nor upper, nhc98's special treatment (ignore the underscore in deciding whether it is a conid or varid) does not apply. Thus, drop through to the standard H'98 behaviour of underscore=lowercase, therefore a varid. Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Neil Mitchell