Implemented pragmas for not_produced not_consumed signals

This commit is contained in:
Martino Ferrari
2026-01-30 14:42:26 +01:00
parent c3f4d8f465
commit 6fa67abcb4
5 changed files with 66 additions and 224 deletions

View File

@@ -45,17 +45,15 @@ func Format(config *parser.Configuration, w io.Writer) {
}
func fixComment(text string) string {
if strings.HasPrefix(text, "//!") {
if len(text) > 3 && text[3] != ' ' {
return "//! " + text[3:]
}
} else if strings.HasPrefix(text, "//#") {
if len(text) > 3 && text[3] != ' ' {
return "//# " + text[3:]
}
} else if strings.HasPrefix(text, "//") {
if len(text) > 2 && text[2] != ' ' && text[2] != '#' && text[2] != '!' {
return "// " + text[2:]
if !strings.HasPrefix(text, "//!") {
if strings.HasPrefix(text, "//#") {
if len(text) > 3 && text[3] != ' ' {
return "//# " + text[3:]
}
} else if strings.HasPrefix(text, "//") {
if len(text) > 2 && text[2] != ' ' && text[2] != '#' && text[2] != '!' {
return "// " + text[2:]
}
}
}
return text