Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When creating scripts, it'd be cool to be able to create methods in the script. e.g.
foo {
println
}
[1, 2, 3].each
{ foo(it) }This kinda thing might impact the parser implementation somewhat. The AST can handle the above right now - we just need the parser to handle it. e.g. in ASTBuilder the datatypeDeclaration() method currently checks for class, interface or statement.
Making it detect a method declaration and calling module.addMethod(MethodNode) would fix this.
Though I'm leaving it up to you if this is gonna be easy & possible