sketched out more TODOs
This commit is contained in:
parent
900ab87f92
commit
f3c0f366d2
2 changed files with 14 additions and 6 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
// TODO: think about package names
|
|
||||||
// Should we have one for all our code?
|
|
||||||
package shsh
|
package shsh
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -16,8 +14,8 @@ import (
|
||||||
type parse_tag int
|
type parse_tag int
|
||||||
const (
|
const (
|
||||||
LIST_T parse_tag = iota
|
LIST_T parse_tag = iota
|
||||||
|
SYMBOL_T parse_tag = iota
|
||||||
OPERAND_T parse_tag = iota
|
OPERAND_T parse_tag = iota
|
||||||
OPERATOR_T parse_tag = iota
|
|
||||||
OPERATION_T parse_tag = iota
|
OPERATION_T parse_tag = iota
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -33,8 +31,8 @@ func Parse(arg *Token) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case OPERAND_T:
|
case OPERAND_T:
|
||||||
if string_is_operator(arg._inner) {
|
if string_is_symbol(arg._inner) {
|
||||||
arg.tag = OPERATOR_T
|
arg.tag = SYMBOL_T
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -64,7 +62,7 @@ func list_is_operation(arg *Token) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// theres probly a way better way to do it.
|
// theres probly a way better way to do it.
|
||||||
func string_is_operator(arg string) bool {
|
func string_is_symbol(arg string) bool {
|
||||||
for _, r := range arg {
|
for _, r := range arg {
|
||||||
if !unicode.IsLetter(r) && r != '_' {
|
if !unicode.IsLetter(r) && r != '_' {
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
10
pkg/shsh/symbol_table.go
Normal file
10
pkg/shsh/symbol_table.go
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
package shsh
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO: Enum{Operator, Variable}
|
||||||
|
// TODO build hashmap bucket
|
||||||
|
// TODO define type for function signature operation
|
||||||
|
// TODO functions for get_symbol, add_symbol
|
||||||
Loading…
Add table
Add a link
Reference in a new issue