Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add term chr
  • Loading branch information
FROGGS committed Apr 5, 2013
1 parent 3c0bdf6 commit 75830f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions lib/Perl6/P5Actions.pm
Expand Up @@ -7,7 +7,7 @@ use QRegex;
use QAST;

my role STDActions {
my $DEBUG := 1;
my $DEBUG := 0;
method quibble($/) {
$DEBUG && say("quibble($/)");
make $<nibble>.ast;
Expand Down Expand Up @@ -37,7 +37,7 @@ class Perl6::P5Actions is HLL::Actions does STDActions {

our $FORBID_PIR;
our $STATEMENT_PRINT;
my $DEBUG := 1;
my $DEBUG := 0;

INIT {
# If, e.g., we support Perl up to v6.1.2, set
Expand Down Expand Up @@ -3891,6 +3891,14 @@ class Perl6::P5Actions is HLL::Actions does STDActions {
make QAST::Op.new( :op('call'), :name('&term:<time>'), :node($/) );
}

method term:sym<chr>($/) {
$DEBUG && say("term:sym<chr>($/)");
make QAST::Op.new(
:op('callmethod'), :name('chr'),
$<EXPR> ?? $<EXPR>[0].ast
!! QAST::Var.new( :name('$_'), :scope('lexical') ) );
}

method term:sym<eval>($/) {
$DEBUG && say("term:sym<eval>($/)");
my $block := QAST::Op.new(
Expand Down Expand Up @@ -6205,7 +6213,7 @@ class Perl6::P5Actions is HLL::Actions does STDActions {
}

class Perl6::P5QActions is HLL::Actions does STDActions {
my $DEBUG := 1;
my $DEBUG := 0;
method nibbler($/) {
$DEBUG && say("method nibbler($/)");
my @asts;
Expand Down
4 changes: 2 additions & 2 deletions lib/Perl6/P5Grammar.pm
Expand Up @@ -3242,8 +3242,8 @@ grammar Perl6::P5Grammar is HLL::Grammar does STD5 {
# token term:sym<caller>
# { <sym> » <?before \s*> <.ws> <EXPR('q=')>? }

# token term:sym<chr>
# { <sym> » <?before \s*> <.ws> <EXPR('q=')>? }
token term:sym<chr>
{ <sym> » <?before \s*> <.ws> <EXPR('q=')>? }

# token term:sym<cos>
# { <sym> » <?before \s*> <.ws> <EXPR('q=')>? }
Expand Down

0 comments on commit 75830f5

Please sign in to comment.