File: Shift.pm

package info (click to toggle)
icheck 0.9.7-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,352 kB
  • sloc: perl: 12,152; makefile: 202; ansic: 100
file content (27 lines) | stat: -rw-r--r-- 468 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package CParse::Op::Shift;

use 5.6.0;
use strict;
use warnings;

use CParse::Op;
use CParse::Op::Shift::Left;
use CParse::Op::Shift::Right;

our @ISA = qw/CParse::Op/;

sub new
  {
    my $this = shift;
    my $class = ref($this) || $this;

    my $left = shift;
    my $right = shift;
    my $op = shift;

    return CParse::Op::Shift::Left->new($left, $right) if $op eq '<<';
    return CParse::Op::Shift::Right->new($left, $right) if $op eq '>>';
    die;
  }

1;