mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 20:47:44 +02:00
@ -8,10 +8,10 @@ pub enum SyntaxShape {
|
||||
Any,
|
||||
/// Strings and string-like bare words are allowed
|
||||
String,
|
||||
/// Values that can be the right hand side of a '.'
|
||||
Member,
|
||||
/// A dotted path to navigate the table
|
||||
ColumnPath,
|
||||
/// A dotted path to navigate the table (including variable)
|
||||
FullColumnPath,
|
||||
/// Only a numeric (integer or decimal) value is allowed
|
||||
Number,
|
||||
/// A range is allowed (eg, `1..3`)
|
||||
@ -24,6 +24,12 @@ pub enum SyntaxShape {
|
||||
Pattern,
|
||||
/// A block is allowed, eg `{start this thing}`
|
||||
Block,
|
||||
/// A table is allowed, eg `[first second]`
|
||||
Table,
|
||||
/// A unit value is allowed, eg `10kb`
|
||||
Unit,
|
||||
/// An operator
|
||||
Operator,
|
||||
}
|
||||
|
||||
impl PrettyDebug for SyntaxShape {
|
||||
@ -32,7 +38,7 @@ impl PrettyDebug for SyntaxShape {
|
||||
b::kind(match self {
|
||||
SyntaxShape::Any => "any",
|
||||
SyntaxShape::String => "string",
|
||||
SyntaxShape::Member => "member",
|
||||
SyntaxShape::FullColumnPath => "column path (with variable)",
|
||||
SyntaxShape::ColumnPath => "column path",
|
||||
SyntaxShape::Number => "number",
|
||||
SyntaxShape::Range => "range",
|
||||
@ -40,6 +46,9 @@ impl PrettyDebug for SyntaxShape {
|
||||
SyntaxShape::Path => "file path",
|
||||
SyntaxShape::Pattern => "pattern",
|
||||
SyntaxShape::Block => "block",
|
||||
SyntaxShape::Table => "table",
|
||||
SyntaxShape::Unit => "unit",
|
||||
SyntaxShape::Operator => "operator",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user