diff options
author | NanoTech | 2016-12-06 04:12:17 -0600 |
---|---|---|
committer | NanoTech | 2017-03-10 23:48:27 -0600 |
commit | 7e76e6745ca2eb1dbe78c7503371094e6694fcdf (patch) | |
tree | 214db303b947c51dbb8f3011d9a94db6445e1622 /src/grammar.lalrpop | |
parent | 7d0f38c1ff244f47bd3619515567246b498b493e (diff) |
Separate keywords and builtins
Diffstat (limited to '')
-rw-r--r-- | src/grammar.lalrpop | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/grammar.lalrpop b/src/grammar.lalrpop index 3d4603d..73d1675 100644 --- a/src/grammar.lalrpop +++ b/src/grammar.lalrpop @@ -1,7 +1,7 @@ use core; use core::Expr::*; use grammar_util::*; -use lexer::{Keyword, LexicalError, Tok}; +use lexer::{Builtin, Keyword, LexicalError, Tok}; grammar; @@ -19,12 +19,12 @@ extern { Nat => Tok::Natural(<usize>), Bool => Tok::Bool(<bool>), Label => Tok::Identifier(<String>), - Let => Tok::Reserved(Keyword::Let), - In => Tok::Reserved(Keyword::In), - If => Tok::Reserved(Keyword::If), - Then => Tok::Reserved(Keyword::Then), - Else => Tok::Reserved(Keyword::Else), - Reserved => Tok::Reserved(<Keyword>), + Let => Tok::Keyword(Keyword::Let), + In => Tok::Keyword(Keyword::In), + If => Tok::Keyword(Keyword::If), + Then => Tok::Keyword(Keyword::Then), + Else => Tok::Keyword(Keyword::Else), + Builtin => Tok::Builtin(<Builtin>), "(" => Tok::ParenL, ")" => Tok::ParenR, @@ -97,7 +97,7 @@ ExprF: BoxExpr = { Nat => bx(NaturalLit(<>)), Int => bx(IntegerLit(<>)), Label => bx(Var(core::Var(<>, 0))), // FIXME support var@n syntax - Reserved => bx(Bool), // FIXME + Builtin => bx(Bool), // FIXME Bool => bx(BoolLit(<>)), "(" <Expr> ")", }; |