From: Shenghou Ma Date: Mon, 14 Sep 2015 05:28:57 +0000 (-0400) Subject: cmd/yacc: fix copying action code when line comment is disabled X-Git-Tag: go1.6beta1~916 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=62491ff7783b6b8d7c0f8bcddc72a4b34965fb2e;p=gostls13.git cmd/yacc: fix copying action code when line comment is disabled Fixes #12601. Change-Id: I0be69ffe9ba19934aaef1651845c725708db77de Reviewed-on: https://go-review.googlesource.com/14546 Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/yacc/yacc.go b/src/cmd/yacc/yacc.go index 4f83f50e46..32d2e5e819 100644 --- a/src/cmd/yacc/yacc.go +++ b/src/cmd/yacc/yacc.go @@ -1284,8 +1284,9 @@ func dumpprod(curprod []int, max int) { func cpyact(curprod []int, max int) { if !lflag { - fmt.Fprintf(fcode, "\n\t\t//line %v:%v\n\t\t", infile, lineno) + fmt.Fprintf(fcode, "\n\t\t//line %v:%v", infile, lineno) } + fmt.Fprint(fcode, "\n\t\t") lno := lineno brac := 0