From 0169e9347ec7ffcf86066e1e5753ce5f77e71bc7 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 10 Mar 2020 16:34:59 +0000 Subject: Add support for `with` keyword --- dhall/build.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'dhall/build.rs') diff --git a/dhall/build.rs b/dhall/build.rs index 4b6e52b..3d062da 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -376,6 +376,19 @@ fn convert_abnf_to_pest() -> std::io::Result<()> { rules.remove("url_path"); writeln!(&mut file, "url_path = _{{ path }}")?; + // TODO: upstream this tweak + rules.remove("with_expression"); + writeln!( + &mut file, + r#" + with_expression = {{ application_expression ~ (whsp1 ~ with ~ whsp1 ~ with_clause)* }} + with_clause = {{ + any_label_or_some ~ (whsp ~ "." ~ whsp ~ any_label_or_some)* + ~ whsp ~ "=" ~ whsp ~ application_expression + }} + "# + )?; + // Work around some greediness issue in the grammar. rules.remove("missing"); writeln!( @@ -439,7 +452,7 @@ fn convert_abnf_to_pest() -> std::io::Result<()> { bool_or | import_alt }} - operator_expression = {{ application_expression ~ (whsp ~ operator ~ whsp ~ application_expression)* }} + operator_expression = {{ with_expression ~ (whsp ~ operator ~ whsp ~ with_expression)* }} "##)?; writeln!( -- cgit v1.2.3