@@ 36-47 (lines=12) @@ | ||
33 | public function getPriority($assoc = 'left') |
|
34 | { |
|
35 | if ($assoc === 'right') { |
|
36 | switch ($this->value) { |
|
37 | case '^': |
|
38 | return 5; |
|
39 | case '/': |
|
40 | return 4; |
|
41 | case '*': |
|
42 | return 3; |
|
43 | case '-': |
|
44 | return 2; |
|
45 | case '+': |
|
46 | return 1; |
|
47 | } |
|
48 | } else { |
|
49 | switch ($this->value) { |
|
50 | case '^': |
|
@@ 49-58 (lines=10) @@ | ||
46 | return 1; |
|
47 | } |
|
48 | } else { |
|
49 | switch ($this->value) { |
|
50 | case '^': |
|
51 | return 3; |
|
52 | case '*': |
|
53 | case '/': |
|
54 | return 2; |
|
55 | case '+': |
|
56 | case '-': |
|
57 | return 1; |
|
58 | } |
|
59 | } |
|
60 | } |
|
61 |