summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Cargo.lock7
m---------dhall-lang0
-rw-r--r--dhall_core/Cargo.toml1
-rw-r--r--dhall_core/src/parser.rs10
4 files changed, 15 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 0291f2d..a01a5d9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -98,6 +98,7 @@ dependencies = [
"dhall_generated_parser 0.1.0",
"improved_slice_patterns 2.0.0",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pest 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -217,6 +218,11 @@ dependencies = [
]
[[package]]
+name = "percent-encoding"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "pest"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -463,6 +469,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
"checksum output_vt100 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
+"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pest 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "54f0c72a98d8ab3c99560bfd16df8059cc10e1f9a8e83e6e3b97718dd766e9c3"
"checksum pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63120576c4efd69615b5537d3d052257328a4ca82876771d6944424ccfd9f646"
"checksum pest_meta 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5a3492a4ed208ffc247adcdcc7ba2a95be3104f58877d0d02f0df39bf3efb5e"
diff --git a/dhall-lang b/dhall-lang
-Subproject 7e3721f1a535e4be79af39b2b6d86ee7ce43887
+Subproject f4a0a2dd3b55c3191a3ddac941387607699c3dc
diff --git a/dhall_core/Cargo.toml b/dhall_core/Cargo.toml
index 80cf721..476b9fa 100644
--- a/dhall_core/Cargo.toml
+++ b/dhall_core/Cargo.toml
@@ -10,6 +10,7 @@ doctest = false
[dependencies]
itertools = "0.8.0"
+percent-encoding = "1.0.1"
pest = "2.1"
dhall_generated_parser = { path = "../dhall_generated_parser" }
improved_slice_patterns = { version = "2.0.0", path = "../improved_slice_patterns" }
diff --git a/dhall_core/src/parser.rs b/dhall_core/src/parser.rs
index 8f9957a..637b75e 100644
--- a/dhall_core/src/parser.rs
+++ b/dhall_core/src/parser.rs
@@ -479,9 +479,13 @@ make_parser! {
rule!(unquoted_path_component<&'a str>; captured_str!(s) => s);
rule!(quoted_path_component<&'a str>; captured_str!(s) => s);
- rule!(path_component<&'a str>; children!(
- [unquoted_path_component(s)] => s,
- [quoted_path_component(s)] => s,
+ rule!(path_component<String>; children!(
+ [unquoted_path_component(s)] => {
+ percent_encoding::percent_decode(s.as_bytes())
+ .decode_utf8_lossy()
+ .into_owned()
+ },
+ [quoted_path_component(s)] => s.to_string(),
));
rule!(path<PathBuf>; children!(
[path_component(components)..] => {