From ab100be616932dab22a5309df86107b66e93db37 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 4 May 2019 18:41:22 +0200 Subject: Revert "Make SubExpr generic in the variable labels type" This reverts commit 4c159640e5ee77ffa48b85a5bffa56350cf933ef. --- dhall_syntax/src/parser.rs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'dhall_syntax/src/parser.rs') 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; -type ParsedSubExpr = SubExpr; -type ParsedText = InterpolatedText; -type ParsedTextContents = InterpolatedTextContents; +type ParsedExpr = Expr; +type ParsedSubExpr = SubExpr; +type ParsedText = InterpolatedText>; +type ParsedTextContents = InterpolatedTextContents>; pub type ParseError = pest::error::Error; @@ -510,17 +504,17 @@ make_parser! { rule!(identifier as expression; span; children!( [variable(v)] => { - spanned(span, ExprF::Var(v)) + spanned(span, Var(v)) }, [builtin(e)] => e, )); - rule!(variable>; children!( + rule!(variable>; children!( [label(l), natural_literal(idx)] => { - Var(l, idx) + V(l, idx) }, [label(l)] => { - Var(l, 0) + V(l, 0) }, )); -- cgit v1.2.3