retrofitted arithmetic functions

This commit is contained in:
Aidan 2020-06-29 12:51:41 -07:00
parent f3e39e156c
commit 7c630d5a38
No known key found for this signature in database
GPG key ID: 327711E983899316
4 changed files with 264 additions and 1 deletions

View file

@ -95,6 +95,34 @@ func GenFuncTable() ast.FuncTable {
Args: 1,
},
"+": &ast.Function{
Function: add,
Name: "add",
TimesCalled: 0,
Args: -1,
},
"-": &ast.Function{
Function: sub,
Name: "sub",
TimesCalled: 0,
Args: -1,
},
"*": &ast.Function{
Function: mult,
Name: "mult",
TimesCalled: 0,
Args: -1,
},
"/": &ast.Function{
Function: div,
Name: "div",
TimesCalled: 0,
Args: -1,
},
}
return stdlib