had an idea or two

This commit is contained in:
Aidan 2019-11-21 21:10:22 -08:00
parent 2b5e43a322
commit bb070592a6
No known key found for this signature in database
GPG key ID: 327711E983899316
2 changed files with 11 additions and 3 deletions

View file

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

View file

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