diff options
author | Nadrieril | 2019-05-04 18:41:22 +0200 |
---|---|---|
committer | Nadrieril | 2019-05-04 18:41:22 +0200 |
commit | ab100be616932dab22a5309df86107b66e93db37 (patch) | |
tree | c5a093c8d9a05cb50e83966fe4923c134f5c3515 /dhall_syntax/src/parser.rs | |
parent | 6ad7a2000bf32b96be731cd51da5b841976dae12 (diff) |
Revert "Make SubExpr generic in the variable labels type"
This reverts commit 4c159640e5ee77ffa48b85a5bffa56350cf933ef.
Diffstat (limited to 'dhall_syntax/src/parser.rs')
-rw-r--r-- | dhall_syntax/src/parser.rs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs index bdef553..83ccc1e 100644 --- a/dhall_syntax/src/parser.rs +++ b/dhall_syntax/src/parser.rs @@ -8,13 +8,7 @@ use std::rc::Rc; use dhall_generated_parser::{DhallParser, Rule}; -use crate::ExprF::{ - Annot, App, BinOp, BoolIf, BoolLit, Builtin, Const, DoubleLit, Embed, - EmptyListLit, Field, IntegerLit, Lam, Let, Merge, NEListLit, NaturalLit, - OldOptionalLit, Pi, Projection, RecordLit, RecordType, SomeLit, TextLit, - UnionLit, UnionType, -}; - +use crate::ExprF::*; use crate::*; // This file consumes the parse tree generated by pest and turns it into @@ -22,10 +16,10 @@ use crate::*; // their own crate because they are quite general and useful. For now they // are here and hopefully you can figure out how they work. -type ParsedExpr = Expr<Label, Span, Import>; -type ParsedSubExpr = SubExpr<Label, Span, Import>; -type ParsedText = InterpolatedText<ParsedSubExpr>; -type ParsedTextContents = InterpolatedTextContents<ParsedSubExpr>; +type ParsedExpr = Expr<Span, Import>; +type ParsedSubExpr = SubExpr<Span, Import>; +type ParsedText = InterpolatedText<SubExpr<Span, Import>>; +type ParsedTextContents = InterpolatedTextContents<SubExpr<Span, Import>>; pub type ParseError = pest::error::Error<Rule>; @@ -510,17 +504,17 @@ make_parser! { rule!(identifier<ParsedSubExpr> as expression; span; children!( [variable(v)] => { - spanned(span, ExprF::Var(v)) + spanned(span, Var(v)) }, [builtin(e)] => e, )); - rule!(variable<Var<Label>>; children!( + rule!(variable<V<Label>>; children!( [label(l), natural_literal(idx)] => { - Var(l, idx) + V(l, idx) }, [label(l)] => { - Var(l, 0) + V(l, 0) }, )); |