summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-01-19 14:10:05 -0500
committerKyle Gunger <kgunger12@gmail.com>2022-01-19 14:10:05 -0500
commitb955c8e9c9b56295be6b8ff65fe55df35eac3b6f (patch)
tree515eb4789b5d16278fa21256df38c5f08a2fe88f /src
parent3f8ded0b759181509f975030591d86f0570e7123 (diff)
[BUILDER] Fix modules beginning with 'export'
Diffstat (limited to 'src')
-rw-r--r--src/texec/worldbuilder.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/texec/worldbuilder.go b/src/texec/worldbuilder.go
index 9ab04a7..96ea292 100644
--- a/src/texec/worldbuilder.go
+++ b/src/texec/worldbuilder.go
@@ -118,7 +118,7 @@ func importFile(f string, m *TModule) {
froot := parseFile(f)
for n := 0 ; n < len(froot.Sub) ; n++ {
if froot.Sub[n].Data.Data == "block" {
- if froot.Sub[n].Sub[0].Sub[0].Data.Data == "module" {
+ if froot.Sub[n].Sub[0].Sub[0].Data.Data == "module" || froot.Sub[n].Sub[0].Sub[0].Data.Data == "export" {
m.Sub = append(m.Sub, buildModule(froot.Sub[n]))
} else {
m.Artifacts = append(m.Artifacts, froot.Sub[n])
@@ -142,7 +142,11 @@ func importFile(f string, m *TModule) {
func buildModule(module tparse.Node) TModule {
out := TModule{}
out.Defs = make(VarMap)
- out.Name = module.Sub[0].Sub[0].Sub[0].Data.Data
+ if module.Sub[0].Sub[0].Data.Data == "export" {
+ out.Name = module.Sub[0].Sub[1].Sub[0].Data.Data
+ } else {
+ out.Name = module.Sub[0].Sub[0].Sub[0].Data.Data
+ }
for n := 1 ; n < len(module.Sub) ; n++ {
if module.Sub[n].Data.Data == "include" {