we didnt need that type anyways

This commit is contained in:
Aidan 2020-06-20 21:38:46 -07:00
parent 78973ac067
commit 72e1275e48
No known key found for this signature in database
GPG key ID: 327711E983899316
2 changed files with 6 additions and 11 deletions

View file

@ -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 {

View file

@ -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