aboutsummaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-05 11:40:00 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-05 11:40:00 +0300
commitc629fac4297b8f13bdab00100f3b05549174154e (patch)
treecadc8f0c9b16021338134a9c7a90478bcd8f2bdc /src/parse
parent0d9c5b7fd7dec374ec357581f721f5cdc828b7ae (diff)
downloadmyslip-c629fac4297b8f13bdab00100f3b05549174154e.tar.gz
myslip-c629fac4297b8f13bdab00100f3b05549174154e.zip
Added boilerplate and tests for booleans, integer comparisons and boolean operators.
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/parsetree.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parse/parsetree.rs b/src/parse/parsetree.rs
index 5507b0b..3cdc6fe 100644
--- a/src/parse/parsetree.rs
+++ b/src/parse/parsetree.rs
@@ -99,6 +99,18 @@ fn tokens_to_ast_inner(
Some(Sym(s)) if s == "*" => Ok(Atom(Mul)),
Some(Sym(s)) if s == "/" => Ok(Atom(Div)),
Some(Sym(s)) if s == "-" => Ok(Atom(Sub)),
+ Some(Sym(s)) if s == ">" => Ok(Atom(Gt)),
+ Some(Sym(s)) if s == "<" => Ok(Atom(Lt)),
+ Some(Sym(s)) if s == ">=" => Ok(Atom(Ge)),
+ Some(Sym(s)) if s == "<=" => Ok(Atom(Le)),
+ Some(Sym(s)) if s == "=" => Ok(Atom(Eq)),
+ Some(Sym(s)) if s == "!=" => Ok(Atom(Neq)),
+ Some(Sym(s)) if s == "and" => Ok(Atom(And)),
+ Some(Sym(s)) if s == "or" => Ok(Atom(Or)),
+ Some(Sym(s)) if s == "not" => Ok(Atom(Not)),
+ Some(Sym(s)) if s == "xor" => Ok(Atom(Xor)),
+ Some(Sym(s)) if s == "true" => Ok(Atom(True)),
+ Some(Sym(s)) if s == "false" => Ok(Atom(False)),
Some(Sym(s)) if s == "quote" => Ok(Atom(Quote)),
Some(Sym(s)) => Ok(Atom(Var(s))),
Some(ParClose) => break,