From cc03ada4e713f145f2eb1bbf0f131a4c5746cf74 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 3 Aug 2019 22:55:51 +0200 Subject: Inline headers --- dhall_generated_parser/build.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index eab48bf..744cb3d 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -26,6 +26,7 @@ fn main() -> std::io::Result<()> { rules.get_mut(&line[2..]).map(|x| x.silent = true); } } + rules.remove("http"); rules.remove("simple_label"); rules.remove("nonreserved_label"); @@ -41,6 +42,17 @@ fn main() -> std::io::Result<()> { | !keyword ~ simple_label_first_char ~ simple_label_next_char* }}" )?; + // TODO: this is a cheat; actually implement inline headers instead + writeln!( + &mut file, + "http = {{ + http_raw + ~ (whsp + ~ using + ~ whsp1 + ~ (import_hashed | ^\"(\" ~ whsp ~ import_hashed ~ whsp ~ ^\")\"))? + }}" + )?; writeln!( &mut file, "nonreserved_label = _{{ -- cgit v1.2.3 From 482be29e0f03e10c2469ef80bdd6ac7593207dc5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 6 Aug 2019 20:38:06 +0200 Subject: RFC3986 URLs --- dhall_generated_parser/build.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 744cb3d..2c1a8f5 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -27,6 +27,7 @@ fn main() -> std::io::Result<()> { } } rules.remove("http"); + rules.remove("url_path"); rules.remove("simple_label"); rules.remove("nonreserved_label"); @@ -53,6 +54,11 @@ fn main() -> std::io::Result<()> { ~ (import_hashed | ^\"(\" ~ whsp ~ import_hashed ~ whsp ~ ^\")\"))? }}" )?; + // TODO: this is a cheat; properly support RFC3986 URLs instead + writeln!( + &mut file, + "url_path = _{{ path }}" + )?; writeln!( &mut file, "nonreserved_label = _{{ -- cgit v1.2.3 From 749834cb5e166665476f2fbc83fdfec794d90cec Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 6 Aug 2019 21:29:44 +0200 Subject: rustfmt --- dhall_generated_parser/build.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 2c1a8f5..5275097 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -55,10 +55,7 @@ fn main() -> std::io::Result<()> { }}" )?; // TODO: this is a cheat; properly support RFC3986 URLs instead - writeln!( - &mut file, - "url_path = _{{ path }}" - )?; + writeln!(&mut file, "url_path = _{{ path }}")?; writeln!( &mut file, "nonreserved_label = _{{ -- cgit v1.2.3 From a307a13738ccca538635ae796e6c998439025b9b Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 6 Aug 2019 22:43:40 +0200 Subject: Circumvent spec error --- dhall_generated_parser/build.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 5275097..1edce9e 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -30,6 +30,7 @@ fn main() -> std::io::Result<()> { rules.remove("url_path"); rules.remove("simple_label"); rules.remove("nonreserved_label"); + rules.remove("first_application_expression"); let mut file = File::create(pest_path)?; writeln!(&mut file, "// AUTO-GENERATED FILE. See build.rs.")?; @@ -54,6 +55,16 @@ 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: this is a cheat; properly support RFC3986 URLs instead writeln!(&mut file, "url_path = _{{ path }}")?; writeln!( -- cgit v1.2.3 From f7b0c6b9c52f65624dc765fb9eaa7d0d94eeae76 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 6 Aug 2019 23:03:01 +0200 Subject: Generalize empty list annotations --- dhall_generated_parser/build.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 1edce9e..7eba52c 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -31,6 +31,7 @@ fn main() -> std::io::Result<()> { rules.remove("simple_label"); rules.remove("nonreserved_label"); rules.remove("first_application_expression"); + rules.remove("expression"); let mut file = File::create(pest_path)?; writeln!(&mut file, "// AUTO-GENERATED FILE. See build.rs.")?; @@ -65,6 +66,27 @@ fn main() -> std::io::Result<()> { | import_expression }}" )?; + // TODO: hack; we'll need to upstream a change to the grammar + writeln!( + &mut file, + r#"expression = {{ + lambda ~ whsp ~ ^"(" ~ whsp ~ nonreserved_label ~ whsp ~ ^":" ~ whsp1 ~ expression ~ whsp ~ ^")" ~ whsp ~ arrow ~ whsp ~ expression + | if_ ~ whsp1 ~ expression ~ whsp ~ then ~ whsp1 ~ expression ~ whsp ~ else_ ~ whsp1 ~ expression + | let_binding+ ~ in_ ~ whsp1 ~ expression + | forall ~ whsp ~ ^"(" ~ whsp ~ nonreserved_label ~ whsp ~ ^":" ~ whsp1 ~ expression ~ whsp ~ ^")" ~ whsp ~ arrow ~ whsp ~ expression + | operator_expression ~ whsp ~ arrow ~ whsp ~ expression + | merge ~ whsp1 ~ import_expression ~ whsp1 ~ import_expression ~ whsp ~ ^":" ~ whsp1 ~ application_expression + | empty_list_literal + | toMap ~ whsp1 ~ import_expression ~ whsp ~ ^":" ~ whsp1 ~ application_expression + | annotated_expression + }}"# + )?; + writeln!( + &mut file, + r#"empty_list_literal = {{ + ^"[" ~ whsp ~ ^"]" ~ whsp ~ ^":" ~ whsp1 ~ application_expression + }}"# + )?; // TODO: this is a cheat; properly support RFC3986 URLs instead writeln!(&mut file, "url_path = _{{ path }}")?; writeln!( -- cgit v1.2.3 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_generated_parser/build.rs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'dhall_generated_parser/build.rs') 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 From 071ba528cd8c6a222be345ddec7560bb45cca6be Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 8 Aug 2019 19:33:07 +0200 Subject: Add support for dependent types --- dhall_generated_parser/build.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 74210bf..48605b6 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -67,6 +67,7 @@ fn main() -> std::io::Result<()> { | merge ~ whsp1 ~ import_expression ~ whsp1 ~ import_expression ~ whsp ~ ^":" ~ whsp1 ~ application_expression | empty_list_literal | toMap ~ whsp1 ~ import_expression ~ whsp ~ ^":" ~ whsp1 ~ application_expression + | assert ~ whsp ~ ^":" ~ whsp1 ~ expression | annotated_expression }}"# )?; -- cgit v1.2.3 From 7d17d39005531cb77d8eaf32ed7de8938c66f874 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 12 Aug 2019 23:27:55 +0200 Subject: Remove grammar workaround --- dhall_generated_parser/build.rs | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'dhall_generated_parser/build.rs') diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index 48605b6..5275097 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("expression"); let mut file = File::create(pest_path)?; writeln!(&mut file, "// AUTO-GENERATED FILE. See build.rs.")?; @@ -55,28 +54,6 @@ fn main() -> std::io::Result<()> { ~ (import_hashed | ^\"(\" ~ whsp ~ import_hashed ~ whsp ~ ^\")\"))? }}" )?; - // TODO: hack; we'll need to upstream a change to the grammar - writeln!( - &mut file, - r#"expression = {{ - lambda ~ whsp ~ ^"(" ~ whsp ~ nonreserved_label ~ whsp ~ ^":" ~ whsp1 ~ expression ~ whsp ~ ^")" ~ whsp ~ arrow ~ whsp ~ expression - | if_ ~ whsp1 ~ expression ~ whsp ~ then ~ whsp1 ~ expression ~ whsp ~ else_ ~ whsp1 ~ expression - | let_binding+ ~ in_ ~ whsp1 ~ expression - | forall ~ whsp ~ ^"(" ~ whsp ~ nonreserved_label ~ whsp ~ ^":" ~ whsp1 ~ expression ~ whsp ~ ^")" ~ whsp ~ arrow ~ whsp ~ expression - | operator_expression ~ whsp ~ arrow ~ whsp ~ expression - | merge ~ whsp1 ~ import_expression ~ whsp1 ~ import_expression ~ whsp ~ ^":" ~ whsp1 ~ application_expression - | empty_list_literal - | toMap ~ whsp1 ~ import_expression ~ whsp ~ ^":" ~ whsp1 ~ application_expression - | assert ~ whsp ~ ^":" ~ whsp1 ~ expression - | annotated_expression - }}"# - )?; - writeln!( - &mut file, - r#"empty_list_literal = {{ - ^"[" ~ whsp ~ ^"]" ~ whsp ~ ^":" ~ whsp1 ~ application_expression - }}"# - )?; // TODO: this is a cheat; properly support RFC3986 URLs instead writeln!(&mut file, "url_path = _{{ path }}")?; writeln!( -- cgit v1.2.3