| | 663 | |
| | 664 | if ( exists $n->{sub}{code} && exists $n->{param} && exists $n->{param}{op1} && $n->{param}{op1} eq 'call' ) { |
| | 665 | # &infix<=>.(...) |
| | 666 | my $fixity = $n->{sub}{code}; |
| | 667 | my $operator = $n->{param}{sub}{single_quoted}; |
| | 668 | if ( $fixity && $operator && exists $n->{param}{param}{exp1} ) { |
| | 669 | $fixity =~ s/^&//; |
| | 670 | print Dumper( $n->{param}{param} ); |
| | 671 | return _emit( |
| | 672 | { |
| | 673 | 'exp1' => $n->{param}{param}{exp1}{list}[0], |
| | 674 | 'exp2' => $n->{param}{param}{exp1}{list}[1], |
| | 675 | 'fixity' => $fixity, |
| | 676 | 'op1' => $operator, |
| | 677 | } |
| | 678 | ); |
| | 679 | } |
| | 680 | } |
| | 681 | if ( exists $n->{sub}{bareword} && exists $n->{param} && exists $n->{param}{op1} && $n->{param}{op1} eq 'call' ) { |
| | 682 | # infix<=>(...) |
| | 683 | my $fixity = $n->{sub}{bareword}; |
| | 684 | my $operator = $n->{param}{sub}{single_quoted}; |
| | 685 | if ( $fixity && $operator && exists $n->{param}{param}{exp1} ) { |
| | 686 | $fixity =~ s/^&//; |
| | 687 | print Dumper( $n->{param}{param} ); |
| | 688 | return _emit( |
| | 689 | { |
| | 690 | 'exp1' => $n->{param}{param}{exp1}{list}[0], |
| | 691 | 'exp2' => $n->{param}{param}{exp1}{list}[1], |
| | 692 | 'fixity' => $fixity, |
| | 693 | 'op1' => $operator, |
| | 694 | } |
| | 695 | ); |
| | 696 | } |
| | 697 | } |
| | 1467 | if ( $n->{op1} eq '+&=' ) { |
| | 1468 | return _emit( $n->{exp1} ) . ' &= ' . _emit_str( $n->{exp2} ); |
| | 1469 | } |
| | 1470 | if ( $n->{op1} eq '+|=' ) { |
| | 1471 | return _emit( $n->{exp1} ) . ' |= ' . _emit_str( $n->{exp2} ); |
| | 1472 | } |
| | 1473 | if ( $n->{op1} eq '+^=' ) { |
| | 1474 | return _emit( $n->{exp1} ) . ' ^= ' . _emit_str( $n->{exp2} ); |
| | 1475 | } |
| | 1476 | |
| | 1477 | if ( $n->{op1} eq '~&=' ) { |
| | 1478 | return |
| | 1479 | 'do { my $_V6_TMP1 = "" . ' . _emit( $n->{exp1} ) . '; ' |
| | 1480 | . _emit( $n->{exp1} ) . ' = $_V6_TMP1 & ( "" . ' . _emit( $n->{exp2} ) |
| | 1481 | . ' ); } '; |
| | 1482 | } |
| | 1483 | if ( $n->{op1} eq '~|=' ) { |
| | 1484 | return |
| | 1485 | 'do { my $_V6_TMP1 = "" . ' . _emit( $n->{exp1} ) . '; ' |
| | 1486 | . _emit( $n->{exp1} ) . ' = $_V6_TMP1 | ( "" . ' . _emit( $n->{exp2} ) |
| | 1487 | . ' ); } '; |
| | 1488 | } |
| | 1489 | if ( $n->{op1} eq '~^=' ) { |
| | 1490 | return |
| | 1491 | 'do { my $_V6_TMP1 = "" . ' . _emit( $n->{exp1} ) . '; ' |
| | 1492 | . _emit( $n->{exp1} ) . ' = $_V6_TMP1 ^ ( "" . ' . _emit( $n->{exp2} ) |
| | 1493 | . ' ); } '; |
| | 1494 | } |
| | 1495 | |
| | 1496 | if ( $n->{op1} eq '?&=' ) { |
| | 1497 | return |
| | 1498 | 'do { my $_V6_TMP1 = ' . _emit( $n->{exp1} ) . '; ' |
| | 1499 | . _emit( $n->{exp1} ) . ' = ( $_V6_TMP1 && ' . _emit( $n->{exp2} ) |
| | 1500 | . ' ) ? 1 : 0; } '; |
| | 1501 | } |
| | 1502 | if ( $n->{op1} eq '?|=' ) { |
| | 1503 | return |
| | 1504 | 'do { my $_V6_TMP1 = ' . _emit( $n->{exp1} ) . '; ' |
| | 1505 | . _emit( $n->{exp1} ) . ' = ( $_V6_TMP1 || ' . _emit( $n->{exp2} ) |
| | 1506 | . ' ) ? 1 : 0; } '; |
| | 1507 | } |
| | 1508 | if ( $n->{op1} eq '?^=' ) { |
| | 1509 | return |
| | 1510 | 'do { my $_V6_TMP1 = ' . _emit( $n->{exp1} ) . '; ' |
| | 1511 | . _emit( $n->{exp1} ) . ' = ( $_V6_TMP1 xor ' . _emit( $n->{exp2} ) |
| | 1512 | . ' ) ? 1 : 0; } '; |
| | 1513 | } |
| | 1514 | |
| | 1515 | if ( $n->{op1} eq '+<=' ) { |
| | 1516 | return _emit( $n->{exp1} ) . ' <= ' . _emit_str( $n->{exp2} ); |
| | 1517 | } |
| | 1518 | if ( $n->{op1} eq '+>=' ) { |
| | 1519 | return _emit( $n->{exp1} ) . ' >= ' . _emit_str( $n->{exp2} ); |
| | 1520 | } |
| | 1521 | |
| | 1522 | if ( $n->{op1} eq '~<=' ) { |
| | 1523 | return _emit( $n->{exp1} ) . ' le ' . _emit_str( $n->{exp2} ); |
| | 1524 | } |
| | 1525 | if ( $n->{op1} eq '~>=' ) { |
| | 1526 | return _emit( $n->{exp1} ) . ' ge ' . _emit_str( $n->{exp2} ); |
| | 1527 | } |
| | 1528 | |
| | 1529 | if ( $n->{op1} eq '^^=' ) { |
| | 1530 | # XXX |
| | 1531 | return _emit( $n->{exp1} ) . ' ^= ' . _emit_str( $n->{exp2} ); |
| | 1532 | } |