Add expression parsing

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-05-02 18:42:01 -04:00
parent 28d29c2270
commit d9edf21d16
9 changed files with 542 additions and 101 deletions

View File

@@ -19,11 +19,18 @@ pub enum TokenKind {
Comma,
Eq,
BangEq,
EqEq,
LtEq,
GtEq,
Lt,
Gt,
Arrow,
Plus,
Minus,
Splat,
FSlash,
Bang,
}
impl Display for TokenKind {
@@ -46,11 +53,18 @@ impl Display for TokenKind {
Comma => "comma",
Eq => "equals",
BangEq => "not equals",
EqEq => "double equals",
LtEq => "less than or equal to",
GtEq => "greater than or equal to",
Lt => "less than",
Gt => "greater than",
Arrow => "arrow",
Plus => "plus",
Minus => "minus",
Splat => "splat (or times)",
FSlash => "fslash (or divide)",
Bang => "not",
};
Display::fmt(s, fmt)
}