@@ -25,9 +25,13 @@ sub add_simple_op($name, $return_type, $args) {
25
25
$ out := $ out ~ ' ' ~ " \n " ;
26
26
27
27
$ out := $ out ~ " @ NodeInfo(shortName = \" $ name\" )" ~ " \n " ;
28
- my $ jvm_name := ' NQP' ~ ucfirst (subst ( $ name , / _( \w ) /, -> $ match { nqp :: uc ( $ match [ 0 ])}) ) ~ ' Node' ;
28
+ my $ java_name := ' NQP' ~ ucfirst ($ name ) ~ ' Node' ;
29
29
30
- $ out := $ out ~ " public final class $ jvm_name extends NQPNode \{ " ~ " \n " ;
30
+ for <_i Int _n Num _s Str _I Bigint _u UInt _b CodeBlock > -> $ suffix , $ java_suffix {
31
+ $ java_name := subst ($ java_name , /$ suffix /, $ java_suffix );
32
+ }
33
+
34
+ $ out := $ out ~ " public final class $ java_name extends NQPNode \{ " ~ " \n " ;
31
35
32
36
my @ children ;
33
37
@@ -59,7 +63,7 @@ sub add_simple_op($name, $return_type, $args) {
59
63
$ out := $ out ~ " \n " ;
60
64
$ out := $ out ~ " @ Deserializer\n " ;
61
65
62
- $ out := $ out ~ " public $ jvm_name ({nqp :: join (' , ' , @ sig ) }) \{ " ~ " \n " ;
66
+ $ out := $ out ~ " public $ java_name ({nqp :: join (' , ' , @ sig ) }) \{ " ~ " \n " ;
63
67
for @ children -> $ child {
64
68
$ out := $ out ~ " this.$ child = $ child ;" ~ " \n " ;
65
69
}
@@ -81,7 +85,7 @@ sub add_simple_op($name, $return_type, $args) {
81
85
82
86
$ out := $ out ~ " \} " ~ " \n " ;
83
87
84
- my $ path := " src/vm/jvm/runtime/org/perl6/nqp/truffle/nodes/$ package /$ jvm_name .java" ;
88
+ my $ path := " src/vm/jvm/runtime/org/perl6/nqp/truffle/nodes/$ package /$ java_name .java" ;
85
89
if (nqp ::stat($ path , nqp ::const::STAT_EXISTS) == 1 ) {
86
90
say (" Did NOT OVERWRITE $ path" );
87
91
} else {
@@ -91,5 +95,5 @@ sub add_simple_op($name, $return_type, $args) {
91
95
}
92
96
93
97
94
- add_simple_op(' CoerceIntToStr ' , $ STR , [$ INT ]);
98
+ add_simple_op(' add_i ' , $ INT , [$ INT , $ INT ]);
95
99
0 commit comments