Commit b1f44a12 authored by Russ Cox's avatar Russ Cox

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
parent ac771a8a
...@@ -538,7 +538,7 @@ isfrog(int c) ...@@ -538,7 +538,7 @@ isfrog(int c)
return 0; return 0;
return 1; 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 1;
return 0; return 0;
} }
...@@ -947,6 +947,10 @@ lx: ...@@ -947,6 +947,10 @@ lx:
yyerror("illegal character 0x%ux", c); yyerror("illegal character 0x%ux", c);
goto l0; goto l0;
} }
if(importpkg == nil && (c == '#' || c == '$' || c == '?' || c == '@' || c == '\\')) {
yyerror("%s: unexpected %c", "syntax error", c);
goto l0;
}
return c; return c;
asop: asop:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment