Skip to content

Commit

Permalink
Parse stdlibPlaceholder in Nockma parser
Browse files Browse the repository at this point in the history
The strings "nil", "functionsPlaceholder", and "stdlibPlaceholder" all
parse to Nockma nil.
  • Loading branch information
paulcadman committed Sep 26, 2024
1 parent 038931a commit a2487de
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,11 @@ atomWithLoc p n = do
return (set atomLoc (Just loc) n)

atomNil :: Parser (Atom Natural)
atomNil = symbol Str.nil $> nockNil
atomNil = choice (map symbol [Str.nil, Str.functionsPlaceholder, Str.stdlibPlaceholder]) $> nockNil

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

atomFunctionsPlaceholder :: Parser (Atom Natural)
atomFunctionsPlaceholder = symbol Str.functionsPlaceholder $> nockNil

atomStringLiteral :: Parser (Atom Natural)
atomStringLiteral = do
WithLoc loc s <- withLoc stringLiteral
Expand All @@ -163,7 +160,6 @@ patom = do
<|> atomBool
<|> atomNil
<|> atomVoid
<|> atomFunctionsPlaceholder
<|> try atomStringLiteral

iden :: Parser Text
Expand Down

0 comments on commit a2487de

Please sign in to comment.