This commit is contained in:
2021-02-24 21:27:52 -05:00
parent 241470248b
commit 762b6c870c
5 changed files with 84 additions and 6 deletions

View File

@@ -10,11 +10,12 @@ type Dictionary map[string]Word
// A Word defines a subroutine
type Word struct {
Name string
Impl func(string) error
Source []string
Immediate bool
BranchCheck bool
Name string // Name of our word/variable
Impl func(string) error // built-in implementation of the word
Source []string // source, if user-defined
Variable int // if this is a variable, the memory address
Immediate bool // is this word immediate?
BranchCheck bool // is this word part of IF/ELSE/THEN?
}
// AddWord inserts a new word into the dictonary, overwriting any existing word by that name