]> Cypherpunks repositories - gostls13.git/commitdiff
- fixed issue with parsing function literals in statement lists
authorRobert Griesemer <gri@golang.org>
Tue, 15 Jul 2008 16:22:20 +0000 (09:22 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 15 Jul 2008 16:22:20 +0000 (09:22 -0700)
SVN=127218

usr/gri/gosrc/parser.go

index beb74205f9fe34a98b90c6fd6233fbb16b26c5b7..969816e6964b077e14d2b48072c5da85cab533e2 100644 (file)
@@ -826,9 +826,11 @@ func (P *Parser) TryStatement() bool {
        switch P.tok {
        case Scanner.CONST: fallthrough;
        case Scanner.TYPE: fallthrough;
-       case Scanner.VAR: fallthrough;
-       case Scanner.FUNC:
+       case Scanner.VAR:
                P.ParseDeclaration();
+       case Scanner.FUNC:
+               // for now we do not allow local function declarations
+               fallthrough;
        case Scanner.GTR:
                P.ParseSimpleStat();  // send
        case Scanner.IDENT: