getLValuePriority

bugfix postFix means operator to end


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@681 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 6e9a7e83be
commit 494d36eaab
  1. 13
      jode/jode/expr/PrePostFixOperator.java

@ -58,8 +58,11 @@ public class PrePostFixOperator extends Operator {
* Sets the return type of this operator. * Sets the return type of this operator.
*/ */
public void setType(Type type) { public void setType(Type type) {
store.setLValueType(type); if (!isVoid()) {
super.setType(store.getLValueType()); store.setLValueType(type);
super.setType(store.getLValueType());
} else
super.setType(type);
} }
public void setOperandType(Type[] inputTypes) { public void setOperandType(Type[] inputTypes) {
@ -71,18 +74,18 @@ public class PrePostFixOperator extends Operator {
throws java.io.IOException { throws java.io.IOException {
boolean needBrace = false; boolean needBrace = false;
int priority = 700; int priority = 700;
if (postfix) { if (!postfix) {
writer.print(getOperatorString()); writer.print(getOperatorString());
priority = 800; priority = 800;
} }
if (store.getPriority() < priority) { if (store.getLValuePriority() < priority) {
needBrace = true; needBrace = true;
writer.print("("); writer.print("(");
} }
store.dumpLValue(writer, operands); store.dumpLValue(writer, operands);
if (needBrace) if (needBrace)
writer.print(")"); writer.print(")");
if (!postfix) if (postfix)
writer.print(getOperatorString()); writer.print(getOperatorString());
} }
} }

Loading…
Cancel
Save