|
@@ -519,6 +519,22 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
|
519
|
519
|
javaWriter.iSub();
|
520
|
520
|
}, PushOption.AFTER);
|
521
|
521
|
return null;
|
|
522
|
+ case OPTIONAL_IS_NULL:
|
|
523
|
+ case OPTIONAL_IS_NOT_NULL:
|
|
524
|
+ expression.target.accept(this);
|
|
525
|
+ final Label isFalse = new Label();
|
|
526
|
+ final Label end = new Label();
|
|
527
|
+
|
|
528
|
+ if(builtin == BuiltinID.OPTIONAL_IS_NULL)
|
|
529
|
+ javaWriter.ifNonNull(isFalse);
|
|
530
|
+ else
|
|
531
|
+ javaWriter.ifNull(isFalse);
|
|
532
|
+ javaWriter.iConst1();
|
|
533
|
+ javaWriter.goTo(end);
|
|
534
|
+ javaWriter.label(isFalse);
|
|
535
|
+ javaWriter.iConst0();
|
|
536
|
+ javaWriter.label(end);
|
|
537
|
+ return null;
|
522
|
538
|
default:
|
523
|
539
|
expression.target.accept(this);
|
524
|
540
|
for (Expression argument : expression.arguments.arguments) {
|
|
@@ -1035,21 +1051,6 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
|
1035
|
1051
|
break;
|
1036
|
1052
|
case AUTOOP_NOTEQUALS:
|
1037
|
1053
|
throw new UnsupportedOperationException("Not yet supported!");
|
1038
|
|
- case OPTIONAL_IS_NULL:
|
1039
|
|
- case OPTIONAL_IS_NOT_NULL:
|
1040
|
|
- final Label isFalse = new Label();
|
1041
|
|
- final Label end = new Label();
|
1042
|
|
-
|
1043
|
|
- if(builtin == BuiltinID.OPTIONAL_IS_NULL)
|
1044
|
|
- javaWriter.ifNonNull(isFalse);
|
1045
|
|
- else
|
1046
|
|
- javaWriter.ifNull(isFalse);
|
1047
|
|
- javaWriter.iConst1();
|
1048
|
|
- javaWriter.goTo(end);
|
1049
|
|
- javaWriter.label(isFalse);
|
1050
|
|
- javaWriter.iConst0();
|
1051
|
|
- javaWriter.label(end);
|
1052
|
|
- break;
|
1053
|
1054
|
|
1054
|
1055
|
default:
|
1055
|
1056
|
throw new UnsupportedOperationException("Unknown builtin: " + builtin);
|