1
0
mirror of https://github.com/golang/go synced 2024-11-25 13:17:56 -07:00

gc: disallow · in Go programs

Fixes #793.

R=ken2
CC=golang-dev
https://golang.org/cl/1249043
This commit is contained in:
Russ Cox 2010-05-20 17:34:22 -07:00
parent b0283611e4
commit 9e497c3656

View File

@ -854,7 +854,7 @@ talph:
ungetc(c);
rune = getr();
// 0xb7 · is used for internal names
if(!isalpharune(rune) && !isdigitrune(rune) && rune != 0xb7)
if(!isalpharune(rune) && !isdigitrune(rune) && (importpkg == nil || rune != 0xb7))
yyerror("invalid identifier character 0x%ux", rune);
cp += runetochar(cp, &rune);
} else if(!isalnum(c) && c != '_')