diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-11-19 01:39:05 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-11-19 01:39:05 -0500 |
commit | 96cf52263053db6bc3069c9fbc664ed0725ac41e (patch) | |
tree | f3dca802ad7413a9aa614e73fc593a0e28e6fdfb /src/texec/world.go | |
parent | 8cdf25536841a698ad6229f73cdf8ef5ccc1e5fa (diff) |
Some refactoring, clearing out eval
+ Fixed BuildRoot
+ Refactored world.go
- Deleted most of eval, I'm going to re-do it.
Diffstat (limited to 'src/texec/world.go')
-rw-r--r-- | src/texec/world.go | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/texec/world.go b/src/texec/world.go index 86660bc..83c50fd 100644 --- a/src/texec/world.go +++ b/src/texec/world.go @@ -18,31 +18,37 @@ package texec import "tparse" +// TArtifact represents the path to a specific named object in the node tree. +type TArtifact struct { + Path []string + Name string +} + +// TType represents the type of a variable (including pre and post unary ops) +type TType struct { + Pre []string + T TArtifact + Post []string +} + // TVariable represents a single variable in the program type TVariable struct { - Type string + Type TType Data interface{} } -// TPath represents a pointer to the current module and file -// that the thread is working in. -type TPath struct { - Module []string - Artifact string -} +type VarMap map[string]TVariable -// TContext represents a single thread. +// TContext represents a single call context. type TContext struct { - CallStack []tparse.Node - CallEnv []TPath - VarMap []map[string]TVariable + CallEnv TArtifact + Vars VarMap } // TModule represents a collection of files and sub-modules in a program type TModule struct { - Name string - Files []tparse.Node - Globals []map[string]TVariable - Sub []TModule + Name string + Artifacts []tparse.Node + Sub []TModule } |