summaryrefslogtreecommitdiff
path: root/dhall_syntax/src
diff options
context:
space:
mode:
authorNadrieril2019-08-06 20:38:06 +0200
committerNadrieril2019-08-06 21:42:16 +0200
commit482be29e0f03e10c2469ef80bdd6ac7593207dc5 (patch)
tree7af9fba1964751870f4694b27304dde556590668 /dhall_syntax/src
parent2551e6f91110bfe385fa65dd63e576df637c26fa (diff)
RFC3986 URLs
Diffstat (limited to 'dhall_syntax/src')
-rw-r--r--dhall_syntax/src/core/import.rs1
-rw-r--r--dhall_syntax/src/parser.rs7
-rw-r--r--dhall_syntax/src/printer.rs1
3 files changed, 9 insertions, 0 deletions
diff --git a/dhall_syntax/src/core/import.rs b/dhall_syntax/src/core/import.rs
index 306460b..d41eae2 100644
--- a/dhall_syntax/src/core/import.rs
+++ b/dhall_syntax/src/core/import.rs
@@ -41,6 +41,7 @@ pub enum Scheme {
pub enum ImportMode {
Code,
RawText,
+ Location,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs
index 2450c76..2c0cee9 100644
--- a/dhall_syntax/src/parser.rs
+++ b/dhall_syntax/src/parser.rs
@@ -697,6 +697,7 @@ make_parser! {
));
token_rule!(Text<()>);
+ token_rule!(Location<()>);
rule!(import<ParsedSubExpr> as expression; span; children!(
[import_hashed(location_hashed)] => {
@@ -711,6 +712,12 @@ make_parser! {
location_hashed
}))
},
+ [import_hashed(location_hashed), Location(_)] => {
+ spanned(span, Embed(Import {
+ mode: ImportMode::Location,
+ location_hashed
+ }))
+ },
));
token_rule!(lambda<()>);
diff --git a/dhall_syntax/src/printer.rs b/dhall_syntax/src/printer.rs
index b585a5b..2b2bbcc 100644
--- a/dhall_syntax/src/printer.rs
+++ b/dhall_syntax/src/printer.rs
@@ -435,6 +435,7 @@ impl Display for Import {
match self.mode {
Code => {}
RawText => write!(f, " as Text")?,
+ Location => write!(f, " as Location")?,
}
Ok(())
}