fix(lint): trailing-label CFG guard and the goroutine alias

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-19 23:49:19 +02:00
parent a8bfd54ed2
commit eb8b0cd316
4 changed files with 176 additions and 15 deletions
+4 -2
View File
@@ -12,6 +12,7 @@ import (
"fmt"
"strconv"
"strings"
"unicode/utf8"
"sourcedock.dev/petrbalvin/gasm-devkit/arch"
"sourcedock.dev/petrbalvin/gasm-devkit/asm"
@@ -366,8 +367,9 @@ func lintText(t *ast.Text, tab *arch.Table, archKnown bool, cfg Config, macros m
for name, pos := range defined {
if _, ok := referenced[name]; !ok {
out = append(out, Diagnostic{
Pos: pos,
End: token.Position{Line: pos.Line, Column: pos.Column + len(name)},
Pos: pos,
// Columns are rune-based, so the end offset is too.
End: token.Position{Line: pos.Line, Column: pos.Column + utf8.RuneCountInString(name)},
Severity: Hint,
Code: CodeUnusedLabel,
Message: fmt.Sprintf("label %q is defined but never referenced", name),