Skip to content

Commit

Permalink
Extra 'primary' commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0rphee committed Jan 1, 2025
1 parent 369e84b commit 40bb2f4
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,6 @@ unary = do

primary :: ParserM r Expr
primary = do
-- f <- match [FALSE]
-- if f
-- then pure $ ELiteral $ LitBool False
-- else do
-- t <- match [TRUE]
-- if t
-- then pure $ ELiteral $ LitBool True
-- else do
-- n <- match [NIL]
-- if n
-- then pure $ ELiteral LitNil
-- else do
-- ns <- match [NUMBER, STRING]
-- if ns
-- then previous <&> (ELiteral . (.literal))
-- else do
-- lp <- match [LEFT_PAREN]
-- if lp
-- then do
-- expr <- expression
-- consume RIGHT_PAREN "Expect ')' after expression."
-- pure $ EGrouping expr
-- else do
-- p <- peek
-- getPError p "Expect expression." >>= throwError

t <- safePeek
case t of
Just (Token FALSE _ _ _) -> advance >> pure (ELiteral $ LitBool False)
Expand Down

0 comments on commit 40bb2f4

Please sign in to comment.