Commit aaaa1fc6 authored by Russ Cox's avatar Russ Cox

make 6g match spec:

	no semicolon allowd after package clause.
	semicolon allowed after import statement.
	no doubled semicolons allowed

R=ken
OCL=34674
CL=34674
parent 4459624f
...@@ -113,6 +113,9 @@ ...@@ -113,6 +113,9 @@
%left '{' %left '{'
%left NotSemi
%left ';'
%% %%
file: file:
loadsys loadsys
...@@ -154,9 +157,9 @@ imports: ...@@ -154,9 +157,9 @@ imports:
| imports import | imports import
import: import:
LIMPORT import_stmt LIMPORT import_stmt osemi
| LIMPORT '(' import_stmt_list osemi ')' | LIMPORT '(' import_stmt_list osemi ')' osemi
| LIMPORT '(' ')' | LIMPORT '(' ')' osemi
import_stmt: import_stmt:
import_here import_package import_there import_here import_package import_there
...@@ -268,18 +271,19 @@ import_there: ...@@ -268,18 +271,19 @@ import_there:
* declarations * declarations
*/ */
xdcl: xdcl:
common_dcl common_dcl osemi
| xfndcl | xfndcl osemi
{ {
$$ = list1($1); $$ = list1($1);
} }
| ';' | error osemi
{ {
$$ = nil; $$ = nil;
} }
| error xdcl | ';'
{ {
$$ = $2; yyerror("empty top-level declaration");
$$ = nil;
} }
common_dcl: common_dcl:
...@@ -1479,6 +1483,7 @@ braced_keyval_list: ...@@ -1479,6 +1483,7 @@ braced_keyval_list:
* optional things * optional things
*/ */
osemi: osemi:
%prec NotSemi
| ';' | ';'
ocomma: ocomma:
......
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