Browse Source

Fixed functional interface params

Jared 5 years ago
parent
commit
04d5014529
No account linked to committer's email address

+ 7
- 1
CodeFormatter/src/main/java/org/openzen/zenscript/formatter/ExpressionFormatter.java View File

178
 				}
178
 				}
179
 				case INDEXGET: {
179
 				case INDEXGET: {
180
 					StringBuilder result = new StringBuilder();
180
 					StringBuilder result = new StringBuilder();
181
-					result.append(((GetLocalVariableExpression) expression.target).variable.name);
181
+                    if(expression.target instanceof GetLocalVariableExpression) {
182
+                        result.append(((GetLocalVariableExpression) expression.target).variable.name);
183
+                    } else if(expression.target instanceof GetFunctionParameterExpression) {
184
+                        result.append(((GetFunctionParameterExpression) expression.target).parameter.name);
185
+                    } else {
186
+                        result.append(expression.target);
187
+                    }
182
 					result.append("[");
188
 					result.append("[");
183
 					//why -1?
189
 					//why -1?
184
 					for (int i = 0; i < expression.arguments.arguments.length; i++) {
190
 					for (int i = 0; i < expression.arguments.arguments.length; i++) {

Loading…
Cancel
Save