Skip to content

Commit 1b31a8c

Browse files
committed
Merge branch 'master' of github.com:xp-framework/ast
2 parents 605bb69 + 6924a08 commit 1b31a8c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/main/php/lang/ast/Tokens.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Tokens {
1616
'>' => ['>>=', '>=', '>>'],
1717
'=' => ['===', '=>', '=='],
1818
'!' => ['!==', '!='],
19-
'&' => ['&&', '&='],
20-
'|' => ['||', '|='],
19+
'&' => ['&&=', '&&', '&='],
20+
'|' => ['||=', '||', '|='],
2121
'^' => ['^='],
2222
'+' => ['+=', '++'],
2323
'-' => ['-=', '--', '->'],

src/main/php/lang/ast/syntax/PHP.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ public function __construct() {
236236
$this->assignment('>>=');
237237
$this->assignment('<<=');
238238
$this->assignment('??=');
239+
$this->assignment('&&=');
240+
$this->assignment('||=');
239241

240242
// This is ambiguous:
241243
//

src/test/php/lang/ast/unittest/parse/OperatorTest.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function prefix($operator) {
6363
);
6464
}
6565

66-
#[Test, Values(['=', '+=', '-=', '*=', '/=', '.=', '**=', '&=', '|=', '^=', '>>=', '<<='])]
66+
#[Test, Values(['=', '+=', '-=', '*=', '/=', '.=', '**=', '&=', '|=', '^=', '>>=', '<<=', '??=', '&&=', '||='])]
6767
public function assignment($operator) {
6868
$this->assertParsed(
6969
[new Assignment(new Variable('a', self::LINE), $operator, new Variable('b', self::LINE), self::LINE)],

0 commit comments

Comments
 (0)