From 16f8f9bb720111f0b7b5c750acc28768620bb0c7 Mon Sep 17 00:00:00 2001 From: Jonathan Pentecost Date: Tue, 3 Jul 2018 16:50:15 +0100 Subject: [PATCH] cmd/goyacc: add header to generated go output file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add "// Code generated by goyacc. DO NOT EDIT." to the top of the generated go output file. Fixes golang/go#26158 Change-Id: I5dd66af9cd8ccccd27440886c55cd604686472e3 Reviewed-on: https://go-review.googlesource.com/122095 Reviewed-by: Daniel Martí --- cmd/goyacc/yacc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/goyacc/yacc.go b/cmd/goyacc/yacc.go index d831f673..5e77e2f5 100644 --- a/cmd/goyacc/yacc.go +++ b/cmd/goyacc/yacc.go @@ -387,6 +387,8 @@ func setup() { yaccpar = strings.Replace(yaccpartext, "$$", prefix, -1) openup() + fmt.Fprintf(ftable, "// Code generated by goyacc. DO NOT EDIT.") + defin(0, "$end") extval = PRIVATE // tokens start in unicode 'private use' defin(0, "error")