1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-06 06:53:33 +03:00

Parse stdlibPlaceholder in Nockma parser (#3065)

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:

* https://github.com/anoma/juvix/pull/3005

but we forgot to add it to the parser.
This commit is contained in:
Paul Cadman 2024-09-26 13:38:25 +01:00 committed by GitHub
parent 038931ac6c
commit 625d5e0b67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
@ -163,7 +160,6 @@ patom = do
<|> atomBool
<|> atomNil
<|> atomVoid
<|> atomFunctionsPlaceholder
<|> try atomStringLiteral
iden :: Parser Text