Less gooooo!

This commit is contained in:
2022-09-29 18:09:52 -04:00
parent ed4c9aa0d2
commit bb4a5472e1
4 changed files with 26 additions and 4 deletions

View File

@@ -157,6 +157,20 @@ func (analyzer *AnalysisOperation) fetchSectionFromIdentifier (
return
}
// addSection adds a section to the analyzer's section table. If a section with
// that name already exists, it panics because the parser should not have given
// that to us.
func (analyzer *AnalysisOperation) addSection (section Section) {
_, exists := analyzer.sectionTable[section.locator()]
if exists {
panic (
"invalid state: duplicate section " +
section.locator().ToString())
}
analyzer.sectionTable[section.locator()] = section
return
}
func doIndent (indent int, input ...any) (output string) {
for index := 0; index < indent; index ++ {
output += "\t"