Sfoglia il codice sorgente

'Fixed' some compiler/Formatter issues

- simply stopped it from erroring, not sure if it's the intended way?
kindlich 6 anni fa
parent
commit
0a7482eeea
Non sono state trovate chiavi note per questa firma nel database

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

@@ -517,8 +517,9 @@ public class ExpressionFormatter implements ExpressionVisitor<ExpressionString>
517 517
 		result.append("match ");
518 518
 		result.append(expression.value.accept(this));
519 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 525
 	@Override

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

@@ -82,7 +82,7 @@ public class ParsedMatchExpression extends ParsedExpression {
82 82
 				LambdaClosure closure = new LambdaClosure();
83 83
 				StatementScope innerScope = new LambdaScope(scope, closure, header);
84 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 88
 			SwitchValue switchValue = name.compileToSwitchValue(valueType, scope.withHint(valueType));

Loading…
Annulla
Salva