Commit 3ac5d54c authored by Shenghou Ma's avatar Shenghou Ma

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
parent df29cdd3
......@@ -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 {",
......
......@@ -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 {",
......
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