-
-
Save masak/5a34e6893a80a5420c2d to your computer and use it in GitHub Desktop.
Compiler.nqp diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp | |
index a98265c..9f713ba 100644 | |
--- a/src/vm/jvm/QAST/Compiler.nqp | |
+++ b/src/vm/jvm/QAST/Compiler.nqp | |
@@ -1997,7 +1997,16 @@ QAST::OperationsJAST.map_classlib_core_op('join', $TYPE_OPS, 'join', [$RT_STR, $ | |
QAST::OperationsJAST.map_classlib_core_op('split', $TYPE_OPS, 'split', [$RT_STR, $RT_STR], $RT_OBJ, :tc); | |
QAST::OperationsJAST.map_classlib_core_op('findcclass', $TYPE_OPS, 'findcclass', [$RT_INT, $RT_STR, $RT_INT, $RT_INT], $RT_INT); | |
QAST::OperationsJAST.map_classlib_core_op('findnotcclass', $TYPE_OPS, 'findnotcclass', [$RT_INT, $RT_STR, $RT_INT, $RT_INT], $RT_INT); | |
-QAST::OperationsJAST.map_classlib_core_op('sprintf', $TYPE_OPS, 'sprintf', [$RT_STR, $RT_OBJ], $RT_STR, :tc); | |
+QAST::OperationsJAST.add_core_op('sprintf', -> $qastcomp, $op { | |
+ my @operands := $op.list; | |
+ QAST::Op.new( | |
+ :op('call'), | |
+ QAST::Op.new( | |
+ :op('getcurhllsym'), | |
+ QAST::SVal.new( :value('nqp') ), | |
+ QAST::SVal.new( :value('sprintf') ) | |
+ ), | |
+ |@operands ); | |
+}); | |
QAST::OperationsJAST.map_classlib_core_op('escape', $TYPE_OPS, 'escape', [$RT_STR], $RT_STR); | |
QAST::OperationsJAST.map_classlib_core_op('flip', $TYPE_OPS, 'flip', [$RT_STR], $RT_STR); | |
QAST::OperationsJAST.map_classlib_core_op('replace', $TYPE_OPS, 'replace', [$RT_STR, $RT_INT, $RT_INT, $RT_STR], $RT_STR); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment