new eval.go
This commit is contained in:
parent
89d6a1013b
commit
2a2e5b4527
15 changed files with 382 additions and 1215 deletions
|
|
@ -33,7 +33,7 @@ func expand(input *ast.Token, vars ast.VarTable, funcs ast.FuncTable) *ast.Token
|
|||
return input
|
||||
}
|
||||
|
||||
return input.Inner.(*ast.Token)
|
||||
return input.Expand()
|
||||
}
|
||||
|
||||
/* L_APPEND (append from repl)
|
||||
|
|
@ -45,15 +45,16 @@ func l_append(input *ast.Token, vars ast.VarTable, funcs ast.FuncTable) *ast.Tok
|
|||
src := input
|
||||
|
||||
if input.Tag != ast.LIST {
|
||||
// TODO: position??
|
||||
return input
|
||||
r := &ast.Token{Tag: ast.LIST}
|
||||
r.Direct(input)
|
||||
return r
|
||||
}
|
||||
|
||||
// deref inner first
|
||||
i := src.Inner.(*ast.Token)
|
||||
i := src.Expand()
|
||||
iter := &i
|
||||
if *iter == nil {
|
||||
src.Inner = input.Next
|
||||
src.Direct(input.Next)
|
||||
src.Next = nil
|
||||
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue