diff options
author | Nadrieril Feneanar | 2019-08-10 23:15:13 +0200 |
---|---|---|
committer | GitHub | 2019-08-10 23:15:13 +0200 |
commit | b41e0278eda19a495daf0586693f1b5981a89653 (patch) | |
tree | cedc8ca740ca0d0bbc74fc987cc0c041f0391b91 /dhall_syntax/src/parser.rs | |
parent | 674fbdc33c788156f76d263b044dccc48c810870 (diff) | |
parent | 80c8d87db595c91293af75d710464ac5379c7e28 (diff) |
Merge pull request #98 from Nadrieril/catchup-spec
Catchup spec
Diffstat (limited to 'dhall_syntax/src/parser.rs')
-rw-r--r-- | dhall_syntax/src/parser.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs index 72dfcdd..9ae6dc8 100644 --- a/dhall_syntax/src/parser.rs +++ b/dhall_syntax/src/parser.rs @@ -311,6 +311,7 @@ fn can_be_shortcutted(rule: Rule) -> bool { | times_expression | equal_expression | not_equal_expression + | equivalent_expression | application_expression | first_application_expression | selector_expression @@ -744,6 +745,7 @@ make_parser! { token_rule!(forall<()>); token_rule!(arrow<()>); token_rule!(merge<()>); + token_rule!(assert<()>); token_rule!(if_<()>); token_rule!(in_<()>); @@ -777,6 +779,9 @@ make_parser! { [merge(()), expression(x), expression(y), expression(z)] => { spanned(span, Merge(x, y, Some(z))) }, + [assert(()), expression(x)] => { + spanned(span, Assert(x)) + }, [expression(e)] => e, )); @@ -875,6 +880,13 @@ make_parser! { rest.fold(first, |acc, e| unspanned(BinOp(o, acc, e))) }, )); + rule!(equivalent_expression<ParsedSubExpr> as expression; children!( + [expression(e)] => e, + [expression(first), expression(rest)..] => { + let o = crate::BinOp::Equivalence; + rest.fold(first, |acc, e| unspanned(BinOp(o, acc, e))) + }, + )); rule!(annotated_expression<ParsedSubExpr> as expression; span; children!( [expression(e)] => e, |