32 lines
649 B
Go
32 lines
649 B
Go
package shsh
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
type operation func(*Token) *Token
|
|
type symbol_tag int
|
|
const (
|
|
SYM_OPERATOR symbol_tag = iota,
|
|
SYM_VARIABLE symbol_tag = iota
|
|
)
|
|
|
|
type bucket struct {
|
|
symbol string
|
|
tag symbol_tag
|
|
_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) {}
|
|
func get_operator(arg string) operation {}
|