mirror of
https://github.com/nushell/nushell.git
synced 2025-01-10 08:18:57 +01:00
Remove parsing literals of unrepresentable SyntaxShape
s (#10512)
# Description Those `SyntaxShape`s can not coerce to `Value`s or `Type`s that can be used by the user in an argument or input-output-type position. Supporting them doesn't make sense. # User-Facing Changes Removal of useless "types" in argument type or input/output type positions # Tests + Formatting No adjustment necessary
This commit is contained in:
parent
ac7263d957
commit
dc739f703a
@ -2717,33 +2717,22 @@ pub fn parse_shape_name(
|
|||||||
b"bool" => SyntaxShape::Boolean,
|
b"bool" => SyntaxShape::Boolean,
|
||||||
b"cell-path" => SyntaxShape::CellPath,
|
b"cell-path" => SyntaxShape::CellPath,
|
||||||
b"closure" => SyntaxShape::Closure(None), //FIXME: Blocks should have known output types
|
b"closure" => SyntaxShape::Closure(None), //FIXME: Blocks should have known output types
|
||||||
b"cond" => SyntaxShape::RowCondition,
|
|
||||||
// b"custom" => SyntaxShape::Custom(Box::new(SyntaxShape::Any), SyntaxShape::Int),
|
|
||||||
b"datetime" => SyntaxShape::DateTime,
|
b"datetime" => SyntaxShape::DateTime,
|
||||||
b"directory" => SyntaxShape::Directory,
|
b"directory" => SyntaxShape::Directory,
|
||||||
b"duration" => SyntaxShape::Duration,
|
b"duration" => SyntaxShape::Duration,
|
||||||
b"error" => SyntaxShape::Error,
|
b"error" => SyntaxShape::Error,
|
||||||
b"expr" => SyntaxShape::Expression,
|
|
||||||
b"float" => SyntaxShape::Float,
|
b"float" => SyntaxShape::Float,
|
||||||
b"filesize" => SyntaxShape::Filesize,
|
b"filesize" => SyntaxShape::Filesize,
|
||||||
b"full-cell-path" => SyntaxShape::FullCellPath,
|
|
||||||
b"glob" => SyntaxShape::GlobPattern,
|
b"glob" => SyntaxShape::GlobPattern,
|
||||||
b"int" => SyntaxShape::Int,
|
b"int" => SyntaxShape::Int,
|
||||||
b"import-pattern" => SyntaxShape::ImportPattern,
|
|
||||||
b"keyword" => SyntaxShape::Keyword(vec![], Box::new(SyntaxShape::Any)),
|
|
||||||
_ if bytes.starts_with(b"list") => parse_list_shape(working_set, bytes, span),
|
_ if bytes.starts_with(b"list") => parse_list_shape(working_set, bytes, span),
|
||||||
b"math" => SyntaxShape::MathExpression,
|
|
||||||
b"nothing" => SyntaxShape::Nothing,
|
b"nothing" => SyntaxShape::Nothing,
|
||||||
b"number" => SyntaxShape::Number,
|
b"number" => SyntaxShape::Number,
|
||||||
b"one-of" => SyntaxShape::OneOf(vec![]),
|
|
||||||
b"operator" => SyntaxShape::Operator,
|
|
||||||
b"path" => SyntaxShape::Filepath,
|
b"path" => SyntaxShape::Filepath,
|
||||||
b"range" => SyntaxShape::Range,
|
b"range" => SyntaxShape::Range,
|
||||||
_ if bytes.starts_with(b"record") => parse_collection_shape(working_set, bytes, span),
|
_ if bytes.starts_with(b"record") => parse_collection_shape(working_set, bytes, span),
|
||||||
b"signature" => SyntaxShape::Signature,
|
|
||||||
b"string" => SyntaxShape::String,
|
b"string" => SyntaxShape::String,
|
||||||
_ if bytes.starts_with(b"table") => parse_collection_shape(working_set, bytes, span),
|
_ if bytes.starts_with(b"table") => parse_collection_shape(working_set, bytes, span),
|
||||||
b"var-with-opt-type" => SyntaxShape::VarWithOptType,
|
|
||||||
_ => {
|
_ => {
|
||||||
if bytes.contains(&b'@') {
|
if bytes.contains(&b'@') {
|
||||||
let split: Vec<_> = bytes.split(|b| b == &b'@').collect();
|
let split: Vec<_> = bytes.split(|b| b == &b'@').collect();
|
||||||
|
Loading…
Reference in New Issue
Block a user