From 7374d0524ccd53b256107667b213597c05720d2d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 31 Mar 2019 19:08:08 +0200 Subject: Move recursion out of Expr --- dhall_core/src/parser.rs | 172 ++++++++++++++++++++++++----------------------- 1 file changed, 87 insertions(+), 85 deletions(-) (limited to 'dhall_core/src/parser.rs') diff --git a/dhall_core/src/parser.rs b/dhall_core/src/parser.rs index b7ac3f6..343a895 100644 --- a/dhall_core/src/parser.rs +++ b/dhall_core/src/parser.rs @@ -13,8 +13,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 ParsedText = InterpolatedText; -type ParsedTextContents = InterpolatedTextContents; +use crate::ExprF::*; + +type ParsedText = InterpolatedText>; +type ParsedTextContents = InterpolatedTextContents>; pub type ParseError = pest::error::Error; @@ -26,9 +28,9 @@ enum Either { Right(B), } -impl Builtin { +impl crate::Builtin { pub fn parse(s: &str) -> Option { - use self::Builtin::*; + use crate::Builtin::*; match s { "Bool" => Some(Bool), "Natural" => Some(Natural), @@ -267,7 +269,7 @@ make_parser! { )); rule!(unreserved_label