Skip to content

Commit

Permalink
Parse stdlibPlaceholder in Nockma parser (#3065)
Browse files Browse the repository at this point in the history
In the nockma parser (e.g used when running `juvix dev nockma run`), the
strings "nil", "functionsPlaceholder", and "stdlibPlaceholder" all parse
to Nockma nil.

We added `stdlibPlaceholder` in:

* #3005

but we forgot to add it to the parser.
  • Loading branch information
paulcadman authored Sep 26, 2024
1 parent 038931a commit 625d5e0
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 625d5e0

Please sign in to comment.