class ClosureSugarTest extends GroovyTestCase {
    def count;

    void testClosureSugar()
    {
        count = 11;

        sugar {
             count = 20;
        }

        assert count == 20;
    }

    void testMixedClosureSugar()
    {
        count = 11;

        mixedSugar (5){a|
             count = count + a;
        }

        assert count == 16;

    }

    def mixedSugar(incrBy, Closure closure)
    {
        closure.call( incrBy ); 
    }

    def sugar(Closure closure)
    {
        closure.call();
    }
}

class ClosureSugarTest extends GroovyTestCase {
    /*
    def count;

    void testClosureSugar()
    {
        count = 11;

        sugar {
             count = 20;
        }

        assert count == 20;
    }
    */

    void testMixedClosureSugar() {
        count = 11;

        mixedSugar (5){a|
             count = count + a;
        }

        assert count == 16;

    }

    def mixedSugar(incrBy, Closure closure) {
        closure.call( incrBy ); 
    }

    /*
    def sugar(Closure closure)
    {
        closure.call();
    }
    */
}

Fix to Antlr to pass through any closure parameter names to the AST
Fix to Antlr to pass through any closure parameter names to the AST


git-svn-id: aa43ce4553b005588bb3cc6c16966320b011facb@1800 a5544e8c-8a19-0410-ba12-f9af4593a198
