From 98e7751fb8deb22685b6991367404515c35f502f Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 7 Aug 2019 16:28:48 +0200 Subject: Various parsing tweaks --- dhall-lang | 2 +- dhall/build.rs | 4 ---- dhall/src/phase/binary.rs | 6 +++--- dhall_generated_parser/build.rs | 11 ----------- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/dhall-lang b/dhall-lang index 599f83b..f4ee1fb 160000 --- a/dhall-lang +++ b/dhall-lang @@ -1 +1 @@ -Subproject commit 599f83b9d5ed24f4357455aecc794f572234a69a +Subproject commit f4ee1fb8f8165c6d68d5f7f4da609483839271db diff --git a/dhall/build.rs b/dhall/build.rs index 07da3f5..d3f63ad 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -100,11 +100,8 @@ fn main() -> std::io::Result<()> { || path == "success/unit/import/urls/emptyPath0" || path == "success/unit/import/urls/emptyPath1" || path == "success/unit/import/urls/emptyPathSegment" - || path == "success/unit/import/urls/potPourri" // TODO: toMap || path == "success/toMap" - // Not a failure anymore - || path == "failure/unit/ListLitEmptyPrecedence" }, )?; @@ -160,7 +157,6 @@ fn main() -> std::io::Result<()> { || path == "success/unit/import/urls/emptyPath0" || path == "success/unit/import/urls/emptyPath1" || path == "success/unit/import/urls/emptyPathSegment" - || path == "success/unit/import/urls/potPourri" // TODO: toMap || path == "success/toMap" }, diff --git a/dhall/src/phase/binary.rs b/dhall/src/phase/binary.rs index f88eee2..e44b1e2 100644 --- a/dhall/src/phase/binary.rs +++ b/dhall/src/phase/binary.rs @@ -341,7 +341,7 @@ fn cbor_value_to_dhall( let y = cbor_value_to_dhall(&y)?; Annot(x, y) } - [U64(27), x] => { + [U64(28), x] => { let x = cbor_value_to_dhall(&x)?; EmptyListLit(x) } @@ -479,9 +479,9 @@ where EmptyListLit(x) => match x.as_ref() { App(f, a) => match f.as_ref() { ExprF::Builtin(Builtin::List) => ser_seq!(ser; tag(4), expr(a)), - _ => ser_seq!(ser; tag(27), expr(x)), + _ => ser_seq!(ser; tag(28), expr(x)), }, - _ => ser_seq!(ser; tag(27), expr(x)), + _ => ser_seq!(ser; tag(28), expr(x)), }, NEListLit(xs) => ser.collect_seq( once(tag(4)).chain(once(null())).chain(xs.iter().map(expr)), diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 7eba52c..74210bf 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -30,7 +30,6 @@ fn main() -> std::io::Result<()> { rules.remove("url_path"); rules.remove("simple_label"); rules.remove("nonreserved_label"); - rules.remove("first_application_expression"); rules.remove("expression"); let mut file = File::create(pest_path)?; @@ -56,16 +55,6 @@ fn main() -> std::io::Result<()> { ~ (import_hashed | ^\"(\" ~ whsp ~ import_hashed ~ whsp ~ ^\")\"))? }}" )?; - // TODO: hack while waiting to catch up on commit e7fdf9d of the spec - writeln!( - &mut file, - "first_application_expression = {{ - merge ~ whsp1 ~ import_expression ~ whsp1 ~ import_expression - | Some_ ~ whsp1 ~ import_expression - | toMap ~ whsp1 ~ import_expression - | import_expression - }}" - )?; // TODO: hack; we'll need to upstream a change to the grammar writeln!( &mut file, -- cgit v1.2.3