added another output line rxp

This commit is contained in:
Özgür Kesim 2024-12-11 19:40:08 +01:00
parent 998763e427
commit 94d148b913
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7

View File

@ -21,6 +21,7 @@ var (
fl_verbose = flag.Bool("v", false, "Verbosity on") 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]+)`)
lin_rx = regexp.MustCompile(`.* orig line is ([\d]+)`)
grb_rx = regexp.MustCompile(`stdin:([\d]+) Garbage in col ([\d]+)`) grb_rx = regexp.MustCompile(`stdin:([\d]+) Garbage in col ([\d]+)`)
) )
@ -66,6 +67,7 @@ func main() {
if len(samfile) != 0 { if len(samfile) != 0 {
str = strings.ReplaceAll(str, "stdin, open_line is ", samfile+":") str = strings.ReplaceAll(str, "stdin, open_line is ", samfile+":")
str = pos_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile)) str = pos_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile))
str = lin_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1", samfile))
str = grb_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile)) str = grb_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile))
} }
log.Fatal("error: " + str) log.Fatal("error: " + str)