Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
288c1c83
Commit
288c1c83
authored
Jan 28, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: tweak error messages, avoid internalization settings in bison
R=r CC=golang-dev
https://golang.org/cl/194129
parent
dd77c63d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
30 additions
and
26 deletions
+30
-26
src/cmd/gc/Makefile
src/cmd/gc/Makefile
+1
-1
src/cmd/gc/go.errors
src/cmd/gc/go.errors
+8
-8
src/cmd/gc/lex.c
src/cmd/gc/lex.c
+13
-9
test/syntax/import.go
test/syntax/import.go
+1
-1
test/syntax/semi1.go
test/syntax/semi1.go
+1
-1
test/syntax/semi2.go
test/syntax/semi2.go
+1
-1
test/syntax/semi3.go
test/syntax/semi3.go
+1
-1
test/syntax/semi4.go
test/syntax/semi4.go
+1
-1
test/syntax/semi5.go
test/syntax/semi5.go
+1
-1
test/syntax/semi6.go
test/syntax/semi6.go
+1
-1
test/syntax/semi7.go
test/syntax/semi7.go
+1
-1
No files found.
src/cmd/gc/Makefile
View file @
288c1c83
...
...
@@ -49,7 +49,7 @@ $(LIB): $(OFILES)
$(OFILES)
:
$(HFILES)
y.tab.h
:
$(YFILES)
bison
-v
-y
$(YFLAGS)
$(YFILES)
LANG
=
C
bison
-v
-y
$(YFLAGS)
$(YFILES)
y.tab.c
:
y.tab.h
test
-f
y.tab.c
&&
touch
y.tab.c
...
...
src/cmd/gc/go.errors
View file @
288c1c83
...
...
@@ -15,28 +15,28 @@ static struct {
// by that token list.
% loadsys package LIMPORT '(' LLITERAL import_package import_there ','
"unexpected
,
during import block",
"unexpected
comma
during import block",
% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';'
"unexpected
;
or newline before {",
"unexpected
semicolon
or newline before {",
% loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';'
"unexpected
;
or newline before {",
"unexpected
semicolon
or newline before {",
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';'
"unexpected
;
or newline before {",
"unexpected
semicolon
or newline before {",
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY
"unexpected
;
or newline before {",
"unexpected
semicolon
or newline before {",
% loadsys package imports LFUNC LNAME '(' ')' ';' '{'
"unexpected
;
or newline before {",
"unexpected
semicolon
or newline before {",
% loadsys package imports LTYPE LNAME ';'
"unexpected
;
or newline in type declaration",
"unexpected
semicolon
or newline in type declaration",
% loadsys package imports LFUNC LNAME '(' ')' '{' if_stmt ';' LELSE
"unexpected
;
or newline before else",
"unexpected
semicolon
or newline before else",
% loadsys package imports LTYPE LNAME LINTERFACE '{' LNAME ',' LNAME
"name list not allowed in interface type",
...
...
src/cmd/gc/lex.c
View file @
288c1c83
...
...
@@ -1523,6 +1523,10 @@ struct
"LRSH"
,
">>"
,
"LOROR"
,
"||"
,
"LNE"
,
"!="
,
// spell out to avoid confusion with punctuation in error messages
"';'"
,
"semicolon or newline"
,
"','"
,
"comma"
,
};
void
...
...
@@ -1535,21 +1539,21 @@ yytinit(void)
for
(
i
=
0
;
yytname
[
i
]
!=
nil
;
i
++
)
{
s
=
yytname
[
i
];
// apply yytfix if possible
for
(
j
=
0
;
j
<
nelem
(
yytfix
);
j
++
)
{
if
(
strcmp
(
s
,
yytfix
[
j
].
have
)
==
0
)
{
yytname
[
i
]
=
yytfix
[
j
].
want
;
goto
loop
;
}
}
// turn 'x' into x.
if
(
s
[
0
]
==
'\''
)
{
t
=
strdup
(
s
+
1
);
t
[
strlen
(
t
)
-
1
]
=
'\0'
;
yytname
[
i
]
=
t
;
continue
;
}
// apply yytfix to the rest
for
(
j
=
0
;
j
<
nelem
(
yytfix
);
j
++
)
{
if
(
strcmp
(
s
,
yytfix
[
j
].
have
)
==
0
)
{
yytname
[
i
]
=
yytfix
[
j
].
want
;
break
;
}
}
loop:
;
}
}
...
...
test/syntax/import.go
View file @
288c1c83
...
...
@@ -7,7 +7,7 @@
package
main
import
(
"io"
,
// ERROR "unexpected
,
"
"io"
,
// ERROR "unexpected
comma
"
"os"
)
...
...
test/syntax/semi1.go
View file @
288c1c83
...
...
@@ -7,7 +7,7 @@
package
main
func
main
()
{
if
x
;
y
// ERROR "unexpected
;
or newline before {"
if
x
;
y
// ERROR "unexpected
semicolon
or newline before {"
{
z
...
...
test/syntax/semi2.go
View file @
288c1c83
...
...
@@ -7,7 +7,7 @@
package
main
func
main
()
{
switch
x
;
y
// ERROR "unexpected
;
or newline before {"
switch
x
;
y
// ERROR "unexpected
semicolon
or newline before {"
{
z
...
...
test/syntax/semi3.go
View file @
288c1c83
...
...
@@ -7,7 +7,7 @@
package
main
func
main
()
{
for
x
;
y
;
z
// ERROR "unexpected
;
or newline before {"
for
x
;
y
;
z
// ERROR "unexpected
semicolon
or newline before {"
{
z
...
...
test/syntax/semi4.go
View file @
288c1c83
...
...
@@ -8,7 +8,7 @@ package main
func
main
()
{
for
x
{
// ERROR "unexpected
;
or newline before {"
{
// ERROR "unexpected
semicolon
or newline before {"
z
test/syntax/semi5.go
View file @
288c1c83
...
...
@@ -7,7 +7,7 @@
package
main
func
main
()
{
// ERROR "unexpected
;
or newline before {"
{
// ERROR "unexpected
semicolon
or newline before {"
test/syntax/semi6.go
View file @
288c1c83
...
...
@@ -6,7 +6,7 @@
package
main
type
T
// ERROR "unexpected
;
or newline in type declaration"
type
T
// ERROR "unexpected
semicolon
or newline in type declaration"
{
...
...
test/syntax/semi7.go
View file @
288c1c83
...
...
@@ -8,7 +8,7 @@ package main
func
main
()
{
if
x
{
}
else
{
}
// ERROR "unexpected
;
or newline before else"
else
{
}
// ERROR "unexpected
semicolon
or newline before else"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment