-
Notifications
You must be signed in to change notification settings - Fork 170
Closed
Labels
ASTConcerning the generated abstract syntaxConcerning the generated abstract syntaxHaskellbugregression in 2.9.1
Milestone
Description
Minimal example:
position token Tok '_' ;
Entrypoint . Entrypoint ::= Tok ;
Save this under bug.cf
in some temporary directory, run bnfc bug.cf
, run runhaskell TestBug.hs
. This is the error:
AbsBug.hs:18:36: error:
Not in scope: type constructor or class ‘String’
|
18 | newtype Tok = Tok ((C.Int, C.Int), String)
| ^^^^^^
I've only confirmed this bug with 2.9.1 release (from stackage) and not with master, but after quick look into code it seems like this wasn't fixed.
The cause of this bug is probably that here
|| hasIdentLike && tokenText == StringToken && s == "String") |
hasIdentLike
is used, which only includes non-position tokens as described in this comment Lines 758 to 759 in 94cc080
-- Excludes position tokens. | |
hasIdentLikeTokens :: CFG g -> Bool |
Metadata
Metadata
Assignees
Labels
ASTConcerning the generated abstract syntaxConcerning the generated abstract syntaxHaskellbugregression in 2.9.1