summaryrefslogtreecommitdiff
path: root/uncrust.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2024-12-10 17:16:15 +0100
committerÖzgür Kesim <oec@codeblau.de>2024-12-10 17:16:15 +0100
commit998763e427e5855577db4f6a8b97fff506f38178 (patch)
tree5c1255f85ffe64634697cb3fb8987ddec0ed665f /uncrust.go
parent26f349fd57ce318fa74efd7f699a00d871062c48 (diff)
added an regexp for rewriting the error output
Diffstat (limited to 'uncrust.go')
-rw-r--r--uncrust.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/uncrust.go b/uncrust.go
index 6b8e185..e8dd564 100644
--- a/uncrust.go
+++ b/uncrust.go
@@ -20,7 +20,8 @@ var (
fl_lang = flag.String("l", "C", "Language")
fl_verbose = flag.Bool("v", false, "Verbosity on")
- pos_rx = regexp.MustCompile(`.* orig line is ([\d]+), orig col is ([\d])`)
+ pos_rx = regexp.MustCompile(`.* orig line is ([\d]+), orig col is ([\d]+)`)
+ grb_rx = regexp.MustCompile(`stdin:([\d]+) Garbage in col ([\d]+)`)
)
func main() {
@@ -65,6 +66,7 @@ func main() {
if len(samfile) != 0 {
str = strings.ReplaceAll(str, "stdin, open_line is ", samfile+":")
str = pos_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile))
+ str = grb_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile))
}
log.Fatal("error: " + str)
}