1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00

[parser] allow '-' as the first character of an identifier. Use try for literals

This commit is contained in:
Jan Mas Rovira 2022-03-16 12:39:50 +01:00
parent 4a346ea0dc
commit 8760f73d38
2 changed files with 1 additions and 2 deletions

View File

@ -86,7 +86,6 @@ bareIdentifier = interval $ do
isAlphaNum c || validFirstChar c
validFirstChar :: Char -> Bool
validFirstChar c =
c /= '-' &&
or
[ isLetter c,
cat == MathSymbol,

View File

@ -123,7 +123,7 @@ import_ = do
expressionAtom :: MonadParsec e Text m => m (ExpressionAtom 'Parsed)
expressionAtom =
do
AtomLiteral <$> literal
AtomLiteral <$> P.try literal
<|> AtomIdentifier <$> name
<|> (AtomUniverse <$> universe)
<|> (AtomLambda <$> lambda)