diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-05 11:40:00 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-05 11:40:00 +0300 |
commit | c629fac4297b8f13bdab00100f3b05549174154e (patch) | |
tree | cadc8f0c9b16021338134a9c7a90478bcd8f2bdc /src/parse/parsetree.rs | |
parent | 0d9c5b7fd7dec374ec357581f721f5cdc828b7ae (diff) | |
download | myslip-c629fac4297b8f13bdab00100f3b05549174154e.tar.gz myslip-c629fac4297b8f13bdab00100f3b05549174154e.zip |
Added boilerplate and tests for booleans, integer comparisons and boolean operators.
Diffstat (limited to 'src/parse/parsetree.rs')
-rw-r--r-- | src/parse/parsetree.rs | 12 |
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, |