mirror of
https://github.com/nushell/nushell
synced 2025-01-10 04:09:09 +00:00
35 lines
1 KiB
Rust
35 lines
1 KiB
Rust
use super::{Call, CellPath, Expression, FullCellPath, Operator, RangeOperator};
|
|
use crate::{BlockId, Signature, Span, Spanned, Unit, VarId};
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub enum Expr {
|
|
Bool(bool),
|
|
Int(i64),
|
|
Float(f64),
|
|
Range(
|
|
Option<Box<Expression>>, // from
|
|
Option<Box<Expression>>, // next value after "from"
|
|
Option<Box<Expression>>, // to
|
|
RangeOperator,
|
|
),
|
|
Var(VarId),
|
|
VarDecl(VarId),
|
|
Call(Box<Call>),
|
|
ExternalCall(String, Span, Vec<Expression>),
|
|
Operator(Operator),
|
|
RowCondition(VarId, Box<Expression>),
|
|
BinaryOp(Box<Expression>, Box<Expression>, Box<Expression>), //lhs, op, rhs
|
|
Subexpression(BlockId),
|
|
Block(BlockId),
|
|
List(Vec<Expression>),
|
|
Table(Vec<Expression>, Vec<Vec<Expression>>),
|
|
Keyword(Vec<u8>, Span, Box<Expression>),
|
|
ValueWithUnit(Box<Expression>, Spanned<Unit>),
|
|
Filepath(String),
|
|
GlobPattern(String),
|
|
String(String),
|
|
CellPath(CellPath),
|
|
FullCellPath(Box<FullCellPath>),
|
|
Signature(Box<Signature>),
|
|
Garbage,
|
|
}
|