mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 10:03:22 +03:00
[parser] allow '-' as the first character of an identifier. Use try for literals
This commit is contained in:
parent
4a346ea0dc
commit
8760f73d38
@ -86,7 +86,6 @@ bareIdentifier = interval $ do
|
||||
isAlphaNum c || validFirstChar c
|
||||
validFirstChar :: Char -> Bool
|
||||
validFirstChar c =
|
||||
c /= '-' &&
|
||||
or
|
||||
[ isLetter c,
|
||||
cat == MathSymbol,
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user