Add unit parsing and eval support

This commit is contained in:
JT
2021-10-05 15:27:39 +13:00
parent 75ec0d123a
commit 535ece4e76
15 changed files with 598 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
use super::{Call, CellPath, Expression, FullCellPath, Operator, RangeOperator};
use crate::{BlockId, Signature, Span, VarId};
use crate::{BlockId, Signature, Span, Spanned, Unit, VarId};
#[derive(Debug, Clone)]
pub enum Expr {
@@ -23,6 +23,7 @@ pub enum Expr {
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), // FIXME: improve this in the future?