Add integers
This commit is contained in:
parent
01fa10fefb
commit
09a42340fc
4 changed files with 32 additions and 24 deletions
|
|
@ -54,7 +54,8 @@ pTermToStat :: Parser (Term T.Text) -> Parser (Stat T.Text)
|
|||
pTermToStat p = do
|
||||
term <- p
|
||||
case term of
|
||||
(TVar _) -> fail "expected term, not variable"
|
||||
(TVar _) -> fail "expected statement, not variable"
|
||||
(TInt _) -> fail "expected statement, not integer"
|
||||
(TStat s) -> pure s
|
||||
|
||||
-- | Parse a statement of the form @name(args)@.
|
||||
|
|
@ -88,6 +89,7 @@ pList = do
|
|||
pPlainTerm :: Parser (Term T.Text)
|
||||
pPlainTerm
|
||||
= (TVar <$> pVarName)
|
||||
<|> (TInt <$> L.signed (pure ()) L.decimal)
|
||||
<|> (TStat <$> pPlainStat)
|
||||
<|> try pCons
|
||||
<|> pList
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue