Add experimental new parser (#1554)

Move to an experimental new parser
This commit is contained in:
Jonathan Turner
2020-04-06 00:16:14 -07:00
committed by GitHub
parent 0a198b9bd0
commit c4daa2e40f
123 changed files with 2391 additions and 11585 deletions

View File

@ -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",
})
}
}