MCPcopy Index your code
hub / github.com/apache/groovy / makePostfix

Method makePostfix

src/main/java/org/codehaus/groovy/syntax/Types.java:1107–1124  ·  view source on GitHub ↗

Converts an operator node's meaning to a postfix operator variant. For example, converts PLUS_PLUS to POSTFIX_PLUS_PLUS. @param node the node whose meaning is to be modified @param throwIfInvalid if true, throws GroovyBugError if the type cannot be converted

(CSTNode node, boolean throwIfInvalid)

Source from the content-addressed store, hash-verified

1105 * @param throwIfInvalid if {@code true}, throws {@link GroovyBugError} if the type cannot be converted
1106 */
1107 public static void makePostfix(CSTNode node, boolean throwIfInvalid) {
1108
1109 switch (node.getMeaning()) {
1110 case PLUS_PLUS:
1111 node.setMeaning(POSTFIX_PLUS_PLUS);
1112 break;
1113
1114 case MINUS_MINUS:
1115 node.setMeaning(POSTFIX_MINUS_MINUS);
1116 break;
1117
1118 default:
1119 if (throwIfInvalid) {
1120 throw new GroovyBugError("cannot convert to postfix for type [" + node.getMeaning() + "]");
1121 }
1122 }
1123
1124 }
1125
1126
1127 //---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

getMeaningMethod · 0.45
setMeaningMethod · 0.45

Tested by

no test coverage detected