Skip to content

Commit 72fd228

Browse files
committed
add support for try-with-resources with external resources
1 parent 4dae5b4 commit 72fd228

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

javaDSL/src/main/grammars/de/monticore/java/JavaDSL.mc4

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,13 @@ LambdaParameter implements Variable = (["var"] | MCType)? Name;
380380
TryLocalVariableDeclaration
381381
= JavaModifier* (["var"] | MCType) DeclaratorId "=" Expression ;
382382

383+
// Add support for try-with-resources with external resources
384+
TryStatement4 implements MCStatement
385+
= "try" "(" resource:Field ")"
386+
core:MCJavaBlock
387+
CatchClause*
388+
("finally" finally:MCJavaBlock)? ;
389+
383390
@Override
384391
EnhancedForControl implements ForControl
385392
= EnhancedForControlFormalParameter ":" Expression;

0 commit comments

Comments
 (0)