Rename the Path and Pattern primitives (#2889)

* Rename the Path primitive to FilePath

* Rename glob pattern also

* more fun

* Fix the Windows path methods
This commit is contained in:
Jonathan Turner
2021-01-08 20:30:41 +13:00
committed by GitHub
parent 2dcb16870b
commit 0e13d9fbaa
48 changed files with 146 additions and 131 deletions

View File

@ -816,11 +816,11 @@ fn parse_arg(
)
}
}
SyntaxShape::Pattern => {
SyntaxShape::GlobPattern => {
let trimmed = trim_quotes(&lite_arg.item);
let expanded = expand_path(&trimmed).to_string();
(
SpannedExpression::new(Expression::pattern(expanded), lite_arg.span),
SpannedExpression::new(Expression::glob_pattern(expanded), lite_arg.span),
None,
)
}
@ -828,7 +828,7 @@ fn parse_arg(
SyntaxShape::Range => parse_range(&lite_arg, scope),
SyntaxShape::Operator => parse_operator(&lite_arg),
SyntaxShape::Unit => parse_unit(&lite_arg),
SyntaxShape::Path => {
SyntaxShape::FilePath => {
let trimmed = trim_quotes(&lite_arg.item);
let expanded = expand_path(&trimmed).to_string();
let path = Path::new(&expanded);
@ -2077,11 +2077,11 @@ fn parse_signature(
let shape = match parts[1] {
"int" => SyntaxShape::Int,
"string" => SyntaxShape::String,
"path" => SyntaxShape::Path,
"path" => SyntaxShape::FilePath,
"table" => SyntaxShape::Table,
"unit" => SyntaxShape::Unit,
"number" => SyntaxShape::Number,
"pattern" => SyntaxShape::Pattern,
"pattern" => SyntaxShape::GlobPattern,
"range" => SyntaxShape::Range,
"block" => SyntaxShape::Block,
"any" => SyntaxShape::Any,
@ -2105,11 +2105,11 @@ fn parse_signature(
let shape = match parts[1] {
"int" => SyntaxShape::Int,
"string" => SyntaxShape::String,
"path" => SyntaxShape::Path,
"path" => SyntaxShape::FilePath,
"table" => SyntaxShape::Table,
"unit" => SyntaxShape::Unit,
"number" => SyntaxShape::Number,
"pattern" => SyntaxShape::Pattern,
"pattern" => SyntaxShape::GlobPattern,
"range" => SyntaxShape::Range,
"block" => SyntaxShape::Block,
"any" => SyntaxShape::Any,