Skip to content

Instantly share code, notes, and snippets.

@timo
Created May 25, 2023 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timo/42ebfc80ed9052dd7e62f7b4584a86c2 to your computer and use it in GitHub Desktop.
Save timo/42ebfc80ed9052dd7e62f7b4584a86c2 to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp
index 3be669dfb..e93c174be 100644
--- a/src/Perl6/Actions.nqp
+++ b/src/Perl6/Actions.nqp
@@ -7242,10 +7242,15 @@ class Perl6::Actions is HLL::Actions does STDActions {
'R..^', 1,
'R^..^', 1
);
+ my %keylcs := nqp::hash(
+ 'POSTFIX', 'postfix',
+ 'PREFIX', 'prefix',
+ 'LIST', 'infix',
+ 'INFIX', 'infix');
method EXPR($/, $KEY?) {
unless $KEY { return 0; }
my $past := $/.ast // $<OPER>.ast;
- my $key := nqp::lc($KEY // 'infix');
+ my $key := %keylcs{$KEY} // nqp::lc($KEY);
$key := 'infix' if $key eq 'list';
my $sym := ~$/{$key}<sym>;
my $thunky := $/{$key} ?? $/{$key}<O>.made<thunky> !! 0;
diff --git a/src/Perl6/World.nqp b/src/Perl6/World.nqp
index 2d258ab7c..638c2cf18 100644
--- a/src/Perl6/World.nqp
+++ b/src/Perl6/World.nqp
@@ -3104,13 +3104,15 @@ class Perl6::World is HLL::World {
# the setting), it is inconvenient to work with, so unbox
$value := nqp::unbox_i($value);
}
- my $const := self.add_constant($type, nqp::lc($type), $value);
my $past;
+ my $const;
if $type eq 'Int' {
+ $const := self.add_constant($type, 'int', $value);
$past := QAST::Want.new: :$node, $const, 'Ii',
QAST::IVal.new: :$node, :$value;
}
else {
+ $const := self.add_constant($type, 'num', $value);
$past := QAST::Want.new: :$node, $const, 'Nn',
QAST::NVal.new: :$node, :$value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment