Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xp-framework/ast
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 23, 2024
2 parents 605bb69 + 6924a08 commit 1b31a8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/php/lang/ast/Tokens.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Tokens {
'>' => ['>>=', '>=', '>>'],
'=' => ['===', '=>', '=='],
'!' => ['!==', '!='],
'&' => ['&&', '&='],
'|' => ['||', '|='],
'&' => ['&&=', '&&', '&='],
'|' => ['||=', '||', '|='],
'^' => ['^='],
'+' => ['+=', '++'],
'-' => ['-=', '--', '->'],
Expand Down
2 changes: 2 additions & 0 deletions src/main/php/lang/ast/syntax/PHP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ public function __construct() {
$this->assignment('>>=');
$this->assignment('<<=');
$this->assignment('??=');
$this->assignment('&&=');
$this->assignment('||=');

// This is ambiguous:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function prefix($operator) {
);
}

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

0 comments on commit 1b31a8c

Please sign in to comment.