]> Cypherpunks repositories - gostls13.git/commitdiff
add empty var ( ), type ( ), const ( ) factorings
authorRuss Cox <rsc@golang.org>
Wed, 8 Oct 2008 22:33:09 +0000 (15:33 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 8 Oct 2008 22:33:09 +0000 (15:33 -0700)
suggested by rob (could make programs generating
go easier to write).

R=ken
DELTA=13  (13 added, 0 deleted, 0 changed)
OCL=16766
CL=16766

src/cmd/gc/go.y

index cdf84e8e26625a9db7cad2dd80dbc3c102c2ad0b..d08fb515ca4ed16dbdf4b8893e7cfe270bd85025 100644 (file)
@@ -117,6 +117,7 @@ imports:
 import:
        LIMPORT import_stmt
 |      LIMPORT '(' import_stmt_list_r osemi ')'
+|      LIMPORT '(' ')'
 
 import_stmt:
        import_here import_package import_there
@@ -223,6 +224,10 @@ Acommon_dcl:
        {
                $$ = rev($3);
        }
+|      LVAR '(' ')'
+       {
+               $$ = N;
+       }
 |      LCONST '(' constdcl osemi ')'
        {
                iota = 0;
@@ -235,6 +240,10 @@ Acommon_dcl:
                lastconst = N;
                $$ = N;
        }
+|      LCONST '(' ')'
+       {
+               $$ = N;
+       }
 |      LTYPE Atypedcl
        {
                $$ = N;
@@ -243,6 +252,10 @@ Acommon_dcl:
        {
                $$ = N;
        }
+|      LTYPE '(' ')'
+       {
+               $$ = N;
+       }
 
 Bcommon_dcl:
        LVAR Bvardcl