diff --git a/pkg/shsh/parsers.go b/pkg/shsh/parsers.go index b932132..4e8ca51 100644 --- a/pkg/shsh/parsers.go +++ b/pkg/shsh/parsers.go @@ -58,7 +58,8 @@ func string_delimiters_valid(arg string) bool { } func list_is_operation(arg *Token) bool { - return ((*Token) arg._inner).tag == OPERATOR_T + // TODO: Rewrite after implementing a symbol table + //return ((*Token) arg._inner).tag == OPERATOR_T } // theres probly a way better way to do it. diff --git a/pkg/shsh/symbol_table.go b/pkg/shsh/symbol_table.go index aed3886..4ec12a8 100644 --- a/pkg/shsh/symbol_table.go +++ b/pkg/shsh/symbol_table.go @@ -4,8 +4,6 @@ import ( "strings" ) -// TODO: Maybe I should just have two tables - type operation func(*Token) *Token type symbol_tag int const ( @@ -19,6 +17,15 @@ type bucket struct { _inner interface{} } +type sym_table []bucket +const initial_table_length 10 +var ( + global_sym_table sym_table +) + +func extend_table() {} + +// TODO: take in a table as a target, so that inner scopes can be appended to outer scopes func set_variable(key string, val string) {} func get_variable(arg string) string {} func set_operator(key string, val operation) {}