File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/cmd/compile/internal/gc Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ func (p *parser) syntax_error(msg string) {
116
116
msg = ", " + msg
117
117
default :
118
118
// plain error - we don't care about current token
119
- Yyerror ("syntax error: " + msg )
119
+ Yyerror ("syntax error: %s" , msg )
120
120
return
121
121
}
122
122
@@ -138,7 +138,7 @@ func (p *parser) syntax_error(msg string) {
138
138
tok = tokstring (p .tok )
139
139
}
140
140
141
- Yyerror ("syntax error: unexpected " + tok + msg )
141
+ Yyerror ("syntax error: unexpected %s" , tok + msg )
142
142
}
143
143
144
144
// Advance consumes tokens until it finds a token of the stoplist.
@@ -1669,7 +1669,7 @@ func (p *parser) sym() *Sym {
1669
1669
return nil
1670
1670
1671
1671
default :
1672
- p .syntax_error ("" )
1672
+ p .syntax_error ("expecting name " )
1673
1673
p .advance ()
1674
1674
return new (Sym )
1675
1675
}
Original file line number Diff line number Diff line change
1
+ // errorcheck
2
+
3
+ // Copyright 2015 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ // Offending character % must not be interpreted as
8
+ // start of format verb when emitting error message.
9
+
10
+ package % // ERROR "unexpected %"
You can’t perform that action at this time.
0 commit comments