mirror of
https://github.com/nushell/nushell
synced 2025-01-09 11:49:00 +00:00
32 lines
858 B
Rust
32 lines
858 B
Rust
|
use nu_source::{b, DebugDocBuilder, PrettyDebug};
|
||
|
use serde::{Deserialize, Serialize};
|
||
|
|
||
|
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
|
||
|
pub enum SyntaxShape {
|
||
|
Any,
|
||
|
String,
|
||
|
Member,
|
||
|
ColumnPath,
|
||
|
Number,
|
||
|
Int,
|
||
|
Path,
|
||
|
Pattern,
|
||
|
Block,
|
||
|
}
|
||
|
|
||
|
impl PrettyDebug for SyntaxShape {
|
||
|
fn pretty(&self) -> DebugDocBuilder {
|
||
|
b::kind(match self {
|
||
|
SyntaxShape::Any => "any shape",
|
||
|
SyntaxShape::String => "string shape",
|
||
|
SyntaxShape::Member => "member shape",
|
||
|
SyntaxShape::ColumnPath => "column path shape",
|
||
|
SyntaxShape::Number => "number shape",
|
||
|
SyntaxShape::Int => "integer shape",
|
||
|
SyntaxShape::Path => "file path shape",
|
||
|
SyntaxShape::Pattern => "pattern shape",
|
||
|
SyntaxShape::Block => "block shape",
|
||
|
})
|
||
|
}
|
||
|
}
|