we didnt need that type anyways
This commit is contained in:
parent
78973ac067
commit
72e1275e48
2 changed files with 6 additions and 11 deletions
11
ast/eval.go
11
ast/eval.go
|
|
@ -17,24 +17,23 @@
|
||||||
|
|
||||||
package ast
|
package ast
|
||||||
|
|
||||||
type Tree *Token
|
func (t *Token) Eval(funcs FuncTable, vars VarTable) *Token {
|
||||||
|
|
||||||
func (Tree t) Eval(FuncTable funcs, VarTable vars) Tree {
|
|
||||||
if t == nil {
|
if t == nil {
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var iter *Token
|
var iter *Token
|
||||||
eligibleForSystemCall := true
|
eligibleForSystemCall := true
|
||||||
|
|
||||||
reduce := func(Tree t_) Tree {
|
var reduce func(*Token) *Token
|
||||||
|
reduce = func(t_ *Token) *Token {
|
||||||
if t_.Next != nil {
|
if t_.Next != nil {
|
||||||
t_.Next = reduce(t_.Next)
|
t_.Next = reduce(t_.Next)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (t_.Tag) {
|
switch (t_.Tag) {
|
||||||
case SYMBOL:
|
case SYMBOL:
|
||||||
maybeToken := GetVar(t_.Inner, vars)
|
maybeToken := GetVar(t_.Inner.(string), vars)
|
||||||
if maybeToken != nil {
|
if maybeToken != nil {
|
||||||
tok := maybeToken.Eval(funcs, vars)
|
tok := maybeToken.Eval(funcs, vars)
|
||||||
if tok == LIST {
|
if tok == LIST {
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package stdlib
|
package ast
|
||||||
|
|
||||||
import (
|
|
||||||
"git.callpipe.com/aidan/shs/ast"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Operation func(*Token) *Token
|
type Operation func(*Token) *Token
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue