Almost done

This commit is contained in:
Martino Ferrari
2026-01-22 03:55:00 +01:00
parent a88f833f49
commit 0654062d08
12 changed files with 435 additions and 24 deletions

View File

@@ -162,8 +162,9 @@ func (pt *ProjectTree) AddFile(file string, config *parser.Configuration) {
// Collect global pragmas
for _, p := range config.Pragmas {
txt := strings.TrimSpace(p.Text)
if strings.HasPrefix(txt, "//!allow(") {
txt := strings.TrimSpace(strings.TrimPrefix(p.Text, "//!"))
normalized := strings.ReplaceAll(txt, " ", "")
if strings.HasPrefix(normalized, "allow(") || strings.HasPrefix(normalized, "ignore(") {
pt.GlobalPragmas[file] = append(pt.GlobalPragmas[file], txt)
}
}