retrofitted arithmetic functions
This commit is contained in:
parent
f3e39e156c
commit
7c630d5a38
4 changed files with 264 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue