had an idea or two
This commit is contained in:
parent
2b5e43a322
commit
bb070592a6
2 changed files with 11 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue