diff options
Diffstat (limited to 'decl.go')
-rw-r--r-- | decl.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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{} |