add stdlib package with readme
This commit is contained in:
parent
c40aea7326
commit
0b3bac7bca
9 changed files with 123 additions and 47 deletions
|
|
@ -17,7 +17,9 @@
|
|||
|
||||
package ast
|
||||
|
||||
type Operation func(*Token) *Token
|
||||
import "git.callpipe.com/aidan/shs/log"
|
||||
|
||||
type Operation func(*Token, VarTable, FuncTable) *Token
|
||||
|
||||
type Function struct {
|
||||
function Operation
|
||||
|
|
@ -50,16 +52,16 @@ func (f Function) ParseFunction(args *Token) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func (f Function) CallFunction(args *Token) *Token {
|
||||
func (f Function) CallFunction(args *Token, vt VarTable, ft FuncTable) *Token {
|
||||
if !f.ParseFunction(args) {
|
||||
log.Log(log.Err,
|
||||
log.Log(log.ERR,
|
||||
"Couldnt call " + f.name,
|
||||
"eval")
|
||||
return nil
|
||||
}
|
||||
|
||||
f.timesCalled += 1
|
||||
return f.function(args)
|
||||
return f.function(args, vt, ft)
|
||||
}
|
||||
|
||||
func (table FuncTable) GetFunction(arg string) *Function {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue