summaryrefslogtreecommitdiff
path: root/dhall/build.rs
diff options
context:
space:
mode:
authorNadrieril2020-03-10 16:34:59 +0000
committerNadrieril2020-03-10 16:35:53 +0000
commit0169e9347ec7ffcf86066e1e5753ce5f77e71bc7 (patch)
tree7d179c9300d7c46a1251bb0e819157107528e316 /dhall/build.rs
parent3f9194f47185fe30c9e410aa7c5e651df9694b3f (diff)
Add support for `with` keyword
Diffstat (limited to 'dhall/build.rs')
-rw-r--r--dhall/build.rs15
1 files changed, 14 insertions, 1 deletions
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!(