1
0
mirror of https://github.com/golang/go synced 2024-11-17 20:14:45 -07:00

cmd/gc: improve syntax error for "import testing"

for this program:
package A
import testing

old diagnostics:
pkg.go:2: syntax error: unexpected semicolon or newline, expecting string literal

now:
pkg.go:2: syntax error: missing import path; require quoted string

Fixes #5332.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9393043
This commit is contained in:
Shenghou Ma 2013-05-15 04:19:19 +08:00
parent df29cdd33d
commit 3ac5d54cf9
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,9 @@ static struct {
% loadsys package LIMPORT '(' LLITERAL import_package import_there ','
"unexpected comma during import block",
% loadsys package LIMPORT LNAME ';'
"missing import path; require quoted string",
% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';'
"unexpected semicolon or newline before {",

View File

@ -17,6 +17,9 @@ static struct {
221, ',',
"unexpected comma during import block",
32, ';',
"missing import path; require quoted string",
377, ';',
"unexpected semicolon or newline before {",