bool functions retrofitted for eval change

This commit is contained in:
Aidan 2020-06-29 12:26:01 -07:00
parent 2151b6c5d2
commit f3e39e156c
No known key found for this signature in database
GPG key ID: 327711E983899316
3 changed files with 230 additions and 0 deletions

View file

@ -45,6 +45,56 @@ func GenFuncTable() ast.FuncTable {
TimesCalled: 0,
Args: 0,
},
"eq": &ast.Function{
Function: eq,
Name: "==",
TimesCalled: 0,
Args: 2,
},
"ne": &ast.Function{
Function: ne,
Name: "!=",
TimesCalled: 0,
Args: 2,
},
"<": &ast.Function{
Function: lt,
Name: "<",
TimesCalled: 0,
Args: 2,
},
">": &ast.Function{
Function: gt,
Name: ">",
TimesCalled: 0,
Args: 2,
},
"<=": &ast.Function{
Function: lte,
Name: "<=",
TimesCalled: 0,
Args: 2,
},
">=": &ast.Function{
Function: gte,
Name: ">=",
TimesCalled: 0,
Args: 2,
},
"!": &ast.Function{
Function: not,
Name: "!",
TimesCalled: 0,
Args: 1,
},
}
return stdlib