From: Russ Cox Date: Fri, 24 Sep 2010 21:09:31 +0000 (-0400) Subject: gc: improve error message for x \= 0 X-Git-Tag: weekly.2010-09-29~48 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b1f44a120f55ad163bb9516ede57277cddc8e50b;p=gostls13.git gc: improve error message for x \= 0 was x.go:2: syntax error: unexpected $undefined now x.go:2: syntax error: unexpected \ R=ken2 CC=golang-dev https://golang.org/cl/2267044 --- diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c index 5d4230041c..7ddcdd21d2 100644 --- a/src/cmd/gc/lex.c +++ b/src/cmd/gc/lex.c @@ -538,7 +538,7 @@ isfrog(int c) return 0; return 1; } - if(0x80 <= c && c <= 0xa0) // unicode block including unbreakable space. + if(0x7f <= c && c <= 0xa0) // DEL, unicode block including unbreakable space. return 1; return 0; } @@ -947,6 +947,10 @@ lx: yyerror("illegal character 0x%ux", c); goto l0; } + if(importpkg == nil && (c == '#' || c == '$' || c == '?' || c == '@' || c == '\\')) { + yyerror("%s: unexpected %c", "syntax error", c); + goto l0; + } return c; asop: