stdlib Call, fg, bg, $, and cd functions. wow

This commit is contained in:
Aidan 2020-06-27 20:31:49 -07:00
parent 94c9b2beba
commit af184d9176
No known key found for this signature in database
GPG key ID: 327711E983899316
6 changed files with 272 additions and 33 deletions

View file

@ -59,12 +59,54 @@ func GenFuncTable() ast.FuncTable {
Args: -1,
},
"div": &ast.Function{
"/": &ast.Function{
Function: div,
Name: "div",
TimesCalled: 0,
Args: -1,
},
"l": &ast.Function{
Function: call,
Name: "call",
TimesCalled: 0,
Args: -1,
},
"bg": &ast.Function{
Function: bgcall,
Name: "background call",
TimesCalled: 0,
Args: -1,
},
"fg": &ast.Function{
Function: fg,
Name: "foreground",
TimesCalled: 0,
Args: 0,
},
"cd": &ast.Function{
Function: cd,
Name: "changedir",
TimesCalled: 0,
Args: 1,
},
"$": &ast.Function{
Function: read_cmd,
Name: "read cmd",
TimesCalled: 0,
Args: -1,
},
"concat": &ast.Function{
Function: concat,
Name:"concatenate",
TimesCalled: 0,
Args: -1,
},
}
return stdlib