Commit 1115c721 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Fixed location of functions to contain optional catch and finally blocks


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent df207191
......@@ -2883,6 +2883,7 @@ pr_FunctionDef returns[Def_Function def_func]
boolean isDeterministic = false;
boolean isControl = false;
Location modifierLocation;
Location endLocation;
DocumentComment docComment = getDocumentComment();
}:
......@@ -2911,10 +2912,14 @@ pr_FunctionDef returns[Def_Function def_func]
}
)?
( exc = pr_ExceptionSpec { exceptions = $exc.exceptions; } )?
s = pr_StatementBlock { statementBlock = $s.statementblock; }
pr_CatchBlockList?
s = pr_StatementBlock {
statementBlock = $s.statementblock;
endLocation = getLocation( $col.start, $s.stop);
}
(cb = pr_CatchBlockList { endLocation = getLocation( $col.start, $cb.stop); })?
fd = pr_FinallyDef {
finallyBlock = $fd.statementBlock;
endLocation = getLocation( $col.start, $fd.stop);
}
)
{
......@@ -2923,7 +2928,7 @@ pr_FunctionDef returns[Def_Function def_func]
parameters.setLocation(getLocation( $start1.start, $end.stop));
$def_func = new Def_Function($i.identifier, parameters, runsonHelper.runsonReference, runsonHelper.mtcReference, runsonHelper.systemReference, portReference, returnType, returnsTemplate,
templateRestriction, exceptions, statementBlock, finallyBlock, isDeterministic, isControl, modifierLocation);
$def_func.setLocation(getLocation( $col.start, $s.stop));
$def_func.setLocation(endLocation);
$def_func.setCommentLocation( getLastCommentLocation( $start ) );
if (docComment != null) {
$def_func.setDocumentComment(docComment);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment