prototype repl

This commit is contained in:
Aidan 2020-06-21 01:30:54 -07:00
parent 30481d4f78
commit c40aea7326
No known key found for this signature in database
GPG key ID: 327711E983899316
7 changed files with 233 additions and 35 deletions

View file

@ -17,6 +17,8 @@
package ast
import "git.callpipe.com/aidan/shs/log"
func (t *Token) Eval(funcs FuncTable, vars VarTable) *Token {
if t == nil {
return nil
@ -53,7 +55,9 @@ func (t *Token) Eval(funcs FuncTable, vars VarTable) *Token {
f := funcs.GetFunction(ret.Inner.(string))
if f == nil {
if !eligibleForSystemCall {
// TODO: log error
log.Log(log.DEBUG,
"could not find definition for symbol " + ret.Inner.(string),
"eval")
return nil
}
@ -61,7 +65,7 @@ func (t *Token) Eval(funcs FuncTable, vars VarTable) *Token {
return nil // TODO: Thats gotta change
}
return (*f).CallFunction(ret.Next)
return (*f).CallFunction(ret.Next, vars, funcs)
}
return ret