1
0
Fork 0

Prefix unary ops with unary_ in tables

This commit is contained in:
Vili Sinervä 2025-02-05 18:15:37 +02:00
parent dc50ce64eb
commit d929f49bc8
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
5 changed files with 26 additions and 50 deletions

View file

@ -58,8 +58,8 @@ impl<'source> SymTab<'source, Type> {
("<=", Func(vec![Int, Int], Box::new(Bool))),
(">", Func(vec![Int, Int], Box::new(Bool))),
(">=", Func(vec![Int, Int], Box::new(Bool))),
("not", Func(vec![Bool], Box::new(Bool))),
("neg", Func(vec![Int], Box::new(Int))),
("unary_not", Func(vec![Bool], Box::new(Bool))),
("unary_-", Func(vec![Int], Box::new(Int))),
("or", Func(vec![Bool, Bool], Box::new(Bool))),
("and", Func(vec![Bool, Bool], Box::new(Bool))),
]);
@ -85,8 +85,8 @@ impl<'source> SymTab<'source, Value> {
("<=", Func(Value::le)),
(">", Func(Value::gt)),
(">=", Func(Value::ge)),
("not", Func(Value::not)),
("neg", Func(Value::neg)),
("unary_not", Func(Value::not)),
("unary_-", Func(Value::neg)),
]);
SymTab {