aboutsummaryrefslogtreecommitdiff
path: root/decl.go
diff options
context:
space:
mode:
Diffstat (limited to 'decl.go')
-rw-r--r--decl.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/decl.go b/decl.go
new file mode 100644
index 0000000..32adbae
--- /dev/null
+++ b/decl.go
@@ -0,0 +1,25 @@
+// SPDX-FileCopyrightText: 2024 Himbeer <himbeer@disroot.org>
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package main
+
+import (
+ "fmt"
+)
+
+type mutInfo struct {
+ id string
+ nameIndex int
+}
+
+func (m mutInfo) name() string {
+ return fmt.Sprintf("%%%s%d", m.id, m.nameIndex-1)
+}
+
+func (m *mutInfo) nextName() string {
+ defer func() { m.nameIndex++ }()
+ return fmt.Sprintf("%%%s%d", m.id, m.nameIndex)
+}
+
+var locals = map[string]map[string]mutInfo{}