Skip to content

Commit

Permalink
Changed the valid symbols from inclusvie to exclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
mariari committed Jul 17, 2022
1 parent 2ea049c commit bf435d6
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/Juvix/Syntax/Concrete/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,11 @@ validTailChar :: Char -> Bool
validTailChar c =
isAlphaNum c || validFirstChar c

reservedSymbols :: [Char]
reservedSymbols = "\";(){}[].≔λ\\"

validFirstChar :: Char -> Bool
validFirstChar c =
or
[ isLetter c,
cat == MathSymbol,
cat == CurrencySymbol,
cat == ModifierLetter,
c `elem` extraAllowedChars
]
where
extraAllowedChars :: [Char]
extraAllowedChars = "_'-*,&"
cat = generalCategory c
validFirstChar c = not $ isNumber c || isSpace c || (c `elem` reservedSymbols)

dot :: forall e m. MonadParsec e Text m => m Char
dot = P.char '.'
Expand Down

0 comments on commit bf435d6

Please sign in to comment.