more general regex and handle stdout and stderr
This commit is contained in:
parent
ba4c34b592
commit
26f349fd57
@ -20,7 +20,7 @@ var (
|
|||||||
fl_lang = flag.String("l", "C", "Language")
|
fl_lang = flag.String("l", "C", "Language")
|
||||||
fl_verbose = flag.Bool("v", false, "Verbosity on")
|
fl_verbose = flag.Bool("v", false, "Verbosity on")
|
||||||
|
|
||||||
pos_rx = regexp.MustCompile(`File: stdin, orig line is ([\d]+), orig col is ([\d])`)
|
pos_rx = regexp.MustCompile(`.* orig line is ([\d]+), orig col is ([\d])`)
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -61,6 +61,7 @@ func main() {
|
|||||||
if e = cmd.Run(); e != nil {
|
if e = cmd.Run(); e != nil {
|
||||||
if _, ok := e.(*exec.ExitError); ok {
|
if _, ok := e.(*exec.ExitError); ok {
|
||||||
str := stderr.String()
|
str := stderr.String()
|
||||||
|
str += "\n" + stdout.String()
|
||||||
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))
|
||||||
|
Loading…
Reference in New Issue
Block a user