Browse Source

'Fixed' some compiler/Formatter issues

- simply stopped it from erroring, not sure if it's the intended way?
kindlich 6 years ago
parent
commit
0a7482eeea
No known key found for this signature in database

+ 3
- 2
CodeFormatter/src/main/java/org/openzen/zenscript/formatter/ExpressionFormatter.java View File

517
 		result.append("match ");
517
 		result.append("match ");
518
 		result.append(expression.value.accept(this));
518
 		result.append(expression.value.accept(this));
519
 		result.append(" {\n");
519
 		result.append(" {\n");
520
-		
521
-		throw new UnsupportedOperationException();
520
+
521
+		return new ExpressionString(result.toString(), OperatorPriority.PRIMARY);
522
+//		throw new UnsupportedOperationException();
522
 	}
523
 	}
523
 
524
 
524
 	@Override
525
 	@Override

+ 1
- 1
Parser/src/main/java/org/openzen/zenscript/parser/expression/ParsedMatchExpression.java View File

82
 				LambdaClosure closure = new LambdaClosure();
82
 				LambdaClosure closure = new LambdaClosure();
83
 				StatementScope innerScope = new LambdaScope(scope, closure, header);
83
 				StatementScope innerScope = new LambdaScope(scope, closure, header);
84
 				Statement contents = body.compile(innerScope, header);
84
 				Statement contents = body.compile(innerScope, header);
85
-				return new MatchExpression.Case(null, new FunctionExpression(name.position, scope.getTypeRegistry().getFunction(header), closure, contents));
85
+				return new MatchExpression.Case(null, new FunctionExpression(null, scope.getTypeRegistry().getFunction(header), closure, contents));
86
 			}
86
 			}
87
 			
87
 			
88
 			SwitchValue switchValue = name.compileToSwitchValue(valueType, scope.withHint(valueType));
88
 			SwitchValue switchValue = name.compileToSwitchValue(valueType, scope.withHint(valueType));

Loading…
Cancel
Save