AS3: precedence parentheses - call, new

This commit is contained in:
Jindra Pet��k
2013-01-01 21:56:02 +01:00
parent 1200f20414
commit ef481b25da
2 changed files with 10 additions and 2 deletions
@@ -44,7 +44,11 @@ public class ConstructTreeItem extends TreeItem {
if (object instanceof NewFunctionTreeItem) {
return object.toString(constants, localRegNames, fullyQualifiedNames);
}
return hilight("new ") + object.toString(constants, localRegNames, fullyQualifiedNames) + hilight("(") + argStr + hilight(")");
String obStr = object.toString(constants, localRegNames, fullyQualifiedNames);
if (object.precedence > precedence) {
obStr = "(" + obStr + ")";
}
return hilight("new ") + obStr + hilight("(") + argStr + hilight(")");
}
}