File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -12658,6 +12658,12 @@ package Perlito5::AST::Apply;
12658
12658
$code = 'infix:<xx>'
12659
12659
}
12660
12660
}
12661
+ if (($code eq 'print' || $code eq 'say') && !@{$self->{'arguments'}}) {
12662
+ return(['keyword' => '.' . $code])
12663
+ }
12664
+ if ($code eq 'infix:<..>' && ref($self->{'arguments'}->[0]) eq 'Perlito5::AST::Val::Int' && ref($self->{'arguments'}->[1]) eq 'Perlito5::AST::Val::Int' && $self->{'arguments'}->[0]->{'int'} == 0) {
12665
+ return('^' . ($self->{'arguments'}->[1]->{'int'} + 1))
12666
+ }
12661
12667
$code = $op_translate{$code}
12662
12668
if $op_translate{$code};
12663
12669
if ($code eq 'prefix:<$>') {
Original file line number Diff line number Diff line change @@ -425,14 +425,30 @@ package Perlito5::AST::Apply;
425
425
# TODO - glob or <> depending on context
426
426
return [ apply => ' (' , [ keyword => ' lines' ], ];
427
427
}
428
-
429
428
if ($code eq ' infix:<x>' ) {
430
429
my $arg = $self -> {arguments }-> [0];
431
430
if ( ref ($arg ) eq ' Perlito5::AST::Apply' && $arg -> {code } eq ' circumfix:<( )>' ) {
432
431
# ($v) x $i
433
432
$code = ' infix:<xx>' ;
434
433
}
435
434
}
435
+ if ( ( $code eq ' print'
436
+ || $code eq ' say'
437
+ )
438
+ && !@{$self -> {arguments }}
439
+ )
440
+ {
441
+ return [ keyword => ' .' . $code ];
442
+ }
443
+ if ( $code eq ' infix:<..>'
444
+ && ref ($self -> {arguments }[0]) eq ' Perlito5::AST::Val::Int'
445
+ && ref ($self -> {arguments }[1]) eq ' Perlito5::AST::Val::Int'
446
+ && $self -> {arguments }[0]{int } == 0
447
+ )
448
+ {
449
+ # TODO - add formatting tags
450
+ return ' ^' . ($self -> {arguments }[1]{int } + 1)
451
+ }
436
452
437
453
$code = $op_translate {$code } if $op_translate {$code };
438
454
You can’t perform that action at this time.
0 commit comments