Created
January 11, 2017 09:20
-
-
Save samcv/f385f19111df9ad282472a6d3610fc6f to your computer and use it in GitHub Desktop.
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
# Gets a string from a Unicode codepoint or other name | |
sub getstrfromname ( str $name ) { | |
my int $cp := nqp::codepointfromname($name); | |
return $cp < 0 ?? "" !! nqp::chr($cp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Java op version here should be (I'd add it to Ops.java below
codepointfromname
, line 4200 or so):You make it available to the compiler by adding a mapping to
src/vm/jvm/QAST/Compiler.nqp
(I'd add it after the mapping forcodepointfromname
, again):