diff options
author | Nadrieril Feneanar | 2019-10-12 19:22:14 +0100 |
---|---|---|
committer | GitHub | 2019-10-12 19:22:14 +0100 |
commit | 8a8eeeac3b4f7761fd0916ee69d182597090039d (patch) | |
tree | 5613752829163cbdbcdb9ecec3b6889cfe827425 /dhall_syntax/src/parser.rs | |
parent | d022cd7e807104ffed60a76058c4ccd478ac187a (diff) | |
parent | 88eadcfe795181a3fda138e92d7f787793248e5f (diff) |
Merge pull request #99 from FintanH/fintan/canonicalize
Introduce Canonicalize
Diffstat (limited to 'dhall_syntax/src/parser.rs')
-rw-r--r-- | dhall_syntax/src/parser.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs index 71fab0f..f2dea53 100644 --- a/dhall_syntax/src/parser.rs +++ b/dhall_syntax/src/parser.rs @@ -429,10 +429,10 @@ impl DhallParser { }) .collect()) } - fn path(input: ParseInput) -> ParseResult<Vec<String>> { + fn path(input: ParseInput) -> ParseResult<FilePath> { Ok(match_nodes!(input.into_children(); [path_component(components)..] => { - components.collect() + FilePath { file_path: components.collect() } } )) } @@ -449,19 +449,19 @@ impl DhallParser { #[alias(local_path)] fn parent_path( input: ParseInput, - ) -> ParseResult<(FilePrefix, Vec<String>)> { + ) -> ParseResult<(FilePrefix, FilePath)> { Ok(match_nodes!(input.into_children(); [path(p)] => (FilePrefix::Parent, p) )) } #[alias(local_path)] - fn here_path(input: ParseInput) -> ParseResult<(FilePrefix, Vec<String>)> { + fn here_path(input: ParseInput) -> ParseResult<(FilePrefix, FilePath)> { Ok(match_nodes!(input.into_children(); [path(p)] => (FilePrefix::Here, p) )) } #[alias(local_path)] - fn home_path(input: ParseInput) -> ParseResult<(FilePrefix, Vec<String>)> { + fn home_path(input: ParseInput) -> ParseResult<(FilePrefix, FilePath)> { Ok(match_nodes!(input.into_children(); [path(p)] => (FilePrefix::Home, p) )) @@ -469,7 +469,7 @@ impl DhallParser { #[alias(local_path)] fn absolute_path( input: ParseInput, - ) -> ParseResult<(FilePrefix, Vec<String>)> { + ) -> ParseResult<(FilePrefix, FilePath)> { Ok(match_nodes!(input.into_children(); [path(p)] => (FilePrefix::Absolute, p) )) |