]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: improve syntax error for "import testing"
authorShenghou Ma <minux.ma@gmail.com>
Tue, 14 May 2013 20:19:19 +0000 (04:19 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Tue, 14 May 2013 20:19:19 +0000 (04:19 +0800)
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

src/cmd/gc/go.errors
src/cmd/gc/yerr.h

index 68a5e5af3aa2b48978c56d2c5ab281fe261e88cd..d5549d3eead29a6867249fd7683d5c6f73fa66af 100644 (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 {",
 
index e7eb6516cc73bfb0a571a482ec6a11b3a39956ad..4cbbd394426c53080eb7661064c4745e5a2735f1 100644 (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 {",