Skip to content

Commit

Permalink
Add parsing for statement (fix #95)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaisorblade committed Feb 7, 2015
1 parent e79c0ba commit cf9f60e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src-lib/PTS/Syntax/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ stmt = withPos StmtPos $ asum
[ Export <$> (keyword "export" *> ident <* semi)
, Import <$> (keyword "import" *> modname <* semi)
, Assertion <$> (keyword "assert" *> expr) <*> optionMaybe (colon1 *> expr) <*> optionMaybe (assign *> expr) <* semi
-- we don't support argument telescopes for postulates -- yet!
, Bind <$> (keyword "postulate" *> ident) <*> pure [] <*> (colon1 *> (Just <$> expr)) <*> pure Nothing <* semi
, try (Term <$> expr <* semi)
, Bind <$> ident <*> telescope <*> optionMaybe (colon1 *> expr) <* assign <*> (Just <$> expr) <* semi]

Expand Down Expand Up @@ -168,7 +170,7 @@ pragma = lexem $ do
-- LEXER --
---------

keywords = ["Lambda", "lambda", "Pi", "if0", "then", "else", "->", "add", "mul", "sub", "div", "module", "import", "export", "assert", "language", "_("]
keywords = ["Lambda", "lambda", "Pi", "if0", "then", "else", "->", "add", "mul", "sub", "div", "module", "import", "export", "assert", "language", "postulate", "_("]

identChar x = not (isSpace x) && x `notElem` ".:=;/()[]$"

Expand Down

0 comments on commit cf9f60e

Please sign in to comment.