Skip to content

Commit

Permalink
properly parse atomVoid
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Feb 8, 2024
1 parent 1edddfb commit 00c717a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ atomNat = do
atomBool :: Parser (Atom Natural)
atomBool =
choice
[ symbol "true" $> nockTrue,
symbol "false" $> nockFalse
[ symbol Str.true $> nockTrue,
symbol Str.false $> nockFalse
]

atomWithLoc :: Parser a -> Atom Natural -> Parser (Atom Natural)
Expand All @@ -122,7 +122,10 @@ atomWithLoc p n = do
return (set atomLoc (Just loc) n)

atomNil :: Parser (Atom Natural)
atomNil = symbol "nil" $> nockNil
atomNil = symbol Str.nil $> nockNil

atomVoid :: Parser (Atom Natural)
atomVoid = symbol Str.void $> nockVoid

patom :: Parser (Atom Natural)
patom =
Expand All @@ -131,6 +134,7 @@ patom =
<|> atomDirection
<|> atomBool
<|> atomNil
<|> atomVoid

iden :: Parser Text
iden = lexeme (takeWhile1P (Just "<iden>") isAlphaNum)
Expand Down

0 comments on commit 00c717a

Please sign in to comment.