It builds

This commit is contained in:
Aidan Hahn 2019-11-28 20:07:28 -08:00
parent 7aa80376bb
commit 7e175dec95
No known key found for this signature in database
GPG key ID: 327711E983899316
7 changed files with 52 additions and 45 deletions

View file

@ -1,9 +1,5 @@
package shsh
import (
"strings"
)
type VarTable map[string]*Token
var (
@ -13,9 +9,10 @@ var (
// Library represents variables defined in inner scope
// It is assumed library is ordered from innermost scope to outermost scope
func GetVar(arg string, library []VarTable) *Token {
for dict, scope := library {
for scope, dict := range library {
val, ok := dict[arg]
if ok {
scope = scope // TEMP LINE
// TODO: maybe log which scope it was found in?
return val
}