fix build from last night
This commit is contained in:
parent
ab340ceb0a
commit
87004ff7fd
6 changed files with 210 additions and 213 deletions
|
|
@ -18,7 +18,6 @@
|
|||
package ast
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gitlab.com/whom/shs/log"
|
||||
)
|
||||
|
||||
|
|
@ -40,7 +39,7 @@ type Function struct {
|
|||
|
||||
// list of types (LIST, NUMBER, STRING, etc) representing args
|
||||
Args []Token_t
|
||||
NumArgs bool // -1 means infinite
|
||||
NumArgs int // -1 means infinite
|
||||
|
||||
// lazy arg checking (use NumArgs instead of args)
|
||||
ArgLazy bool
|
||||
|
|
@ -62,7 +61,7 @@ type FuncTable *map[string]*Function
|
|||
* makes sure correct arguments are passed in
|
||||
*/
|
||||
func (f Function) ParseFunction(args *Token) bool {
|
||||
total = len(f.Args)
|
||||
total := len(f.Args)
|
||||
for iter := args; iter != nil; iter = iter.Next {
|
||||
total -= 1
|
||||
if total <= 0 {
|
||||
|
|
@ -88,7 +87,7 @@ func (f Function) ParseFunction(args *Token) bool {
|
|||
/* same as ParseFunction but only evaluates the number of args
|
||||
*/
|
||||
func (f Function) LazyParseFunction(args *Token) bool {
|
||||
if (f.NumArgs < 0) {
|
||||
if f.NumArgs < 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -118,15 +117,15 @@ func (f Function) LazyParseFunction(args *Token) bool {
|
|||
* calls ParseFunction and increments TimesCalled
|
||||
*/
|
||||
func (f Function) CallFunction(args *Token, vt VarTable, ft FuncTable) *Token {
|
||||
if not f.EvalLazy {
|
||||
if !f.EvalLazy {
|
||||
args = args.Eval(ft, vt, !f.SymLazy)
|
||||
}
|
||||
|
||||
passes := false
|
||||
if f.ArgsLazy {
|
||||
passes = LazyParseFunction(args)
|
||||
if f.ArgLazy {
|
||||
passes = f.LazyParseFunction(args)
|
||||
} else {
|
||||
passes = ParseFunction(args)
|
||||
passes = f.ParseFunction(args)
|
||||
}
|
||||
|
||||
if passes {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue