func (sf *sourceGenerator) append(value string) {
	for _, currentRune := range value {
		if currentRune == '\n' {
			if sf.hasNewline {
				sf.hasBlankline = true
			}
			sf.buf.WriteRune('\n')
			sf.hasNewline = true
			sf.existingLineLength = 0
			continue
		}
		sf.hasBlankline = false
		sf.hasNewScope = false
		if sf.hasNewline {
			sf.buf.WriteString(strings.Repeat("\t", sf.indentationLevel))
			sf.hasNewline = false
			sf.existingLineLength += sf.indentationLevel
		}
		sf.existingLineLength++
		sf.buf.WriteRune(currentRune)
	}
}
append adds the given value to the buffer, indenting as necessary.
package generator
import (
	"strings"
)
type sourceGenerator struct {
	buf                strings.Builder  
	indentationLevel   int              
	hasNewline         bool             
	hasBlankline       bool             
	hasIssue           bool             
	hasNewScope        bool             
	existingLineLength int              
}
func (sf *sourceGenerator) ensureBlankLineOrNewScope() {
	if !sf.hasBlankline && !sf.hasNewScope {
		sf.appendLine()
	}
}
func (sf *sourceGenerator) indent() {
	sf.indentationLevel = sf.indentationLevel + 1
}
func (sf *sourceGenerator) dedent() {
	sf.indentationLevel = sf.indentationLevel - 1
}
func (sf *sourceGenerator) appendIssue(description string) {
	sf.append("/* ")
	sf.append(description)
	sf.append(" */")
	sf.hasIssue = true
}