Skip to content

Commit

Permalink
fix specialIdGen to avoid reserved words. Solves #151
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosh committed Jan 21, 2020
1 parent f969b85 commit 6354b99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/Language/CQL/Parser/Generator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ lowerIdGen =
(`notElem` reservedWords)

specialIdGen :: Gen String
specialIdGen = (:) <$> idCharGen <*> listOf (oneof [idCharGen, digitCharGen])
specialIdGen =
((:) <$> idCharGen <*>
listOf (oneof [idCharGen, digitCharGen])) `suchThat`
(`notElem` reservedWords)

identifierGen :: Gen String
identifierGen = oneof [lowerIdGen, upperIdGen, specialIdGen]
Expand Down

0 comments on commit 6354b99

Please sign in to comment.