From 86508a3ad59a0bfc1e24448d0a0126b1a1c645e1 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 20 Feb 2020 18:52:34 +0000 Subject: Add support for duplicate record fields --- dhall/build.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'dhall/build.rs') diff --git a/dhall/build.rs b/dhall/build.rs index 7c62083..88a2145 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -375,6 +375,26 @@ fn convert_abnf_to_pest() -> std::io::Result<()> { rules.remove("url_path"); writeln!(&mut file, "url_path = _{{ path }}")?; + // TODO: workaround to simplify record parsing + rules.remove("non_empty_record_type_or_literal"); + rules.remove("non_empty_record_literal"); + rules.remove("non_empty_record_type"); + writeln!( + &mut file, + "non_empty_record_type_or_literal = {{ non_empty_record_literal | \ + non_empty_record_type }}" + )?; + writeln!( + &mut file, + "non_empty_record_literal = {{ record_literal_entry ~ (whsp ~ ^\",\" \ + ~ whsp ~ record_literal_entry)*}}" + )?; + writeln!( + &mut file, + "non_empty_record_type = {{ record_type_entry ~ (whsp ~ ^\",\" ~ whsp \ + ~ record_type_entry)* }}" + )?; + // Work around some greediness issue in the grammar. rules.remove("missing"); writeln!( -- cgit v1.2.3 From 6642077368497583113d685d351ec93d230ffcad Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 20 Feb 2020 19:04:13 +0000 Subject: Add support for dotted field syntax --- dhall/build.rs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'dhall/build.rs') diff --git a/dhall/build.rs b/dhall/build.rs index 88a2145..7c62083 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -375,26 +375,6 @@ fn convert_abnf_to_pest() -> std::io::Result<()> { rules.remove("url_path"); writeln!(&mut file, "url_path = _{{ path }}")?; - // TODO: workaround to simplify record parsing - rules.remove("non_empty_record_type_or_literal"); - rules.remove("non_empty_record_literal"); - rules.remove("non_empty_record_type"); - writeln!( - &mut file, - "non_empty_record_type_or_literal = {{ non_empty_record_literal | \ - non_empty_record_type }}" - )?; - writeln!( - &mut file, - "non_empty_record_literal = {{ record_literal_entry ~ (whsp ~ ^\",\" \ - ~ whsp ~ record_literal_entry)*}}" - )?; - writeln!( - &mut file, - "non_empty_record_type = {{ record_type_entry ~ (whsp ~ ^\",\" ~ whsp \ - ~ record_type_entry)* }}" - )?; - // Work around some greediness issue in the grammar. rules.remove("missing"); writeln!( -- cgit v1.2.3 From e5f0602e431bc602f9e1f0045f48056ce6465481 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 20 Feb 2020 19:09:19 +0000 Subject: Update dhall-lang submodule --- dhall/build.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dhall/build.rs') diff --git a/dhall/build.rs b/dhall/build.rs index 7c62083..3ac2901 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -162,6 +162,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/import/urls/emptyPath0" || path == "unit/import/urls/emptyPath1" || path == "unit/import/urls/emptyPathSegment" + || path == "usingToMap" }), input_type: FileType::Text, output_type: Some(FileType::Binary), @@ -186,6 +187,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/import/urls/emptyPath0" || path == "unit/import/urls/emptyPath1" || path == "unit/import/urls/emptyPathSegment" + || path == "usingToMap" }), input_type: FileType::Text, output_type: Some(FileType::Binary), @@ -208,6 +210,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/import/urls/emptyPath0" || path == "unit/import/urls/emptyPath1" || path == "unit/import/urls/emptyPathSegment" + || path == "usingToMap" }), input_type: FileType::Text, output_type: Some(FileType::Binary), -- cgit v1.2.3