Skip to content

Commit

Permalink
Merge pull request #37 from xp-framework/feature/readonly_classes
Browse files Browse the repository at this point in the history
Implement readonly modifier for classes
  • Loading branch information
thekid authored May 14, 2022
2 parents 0c2ac3e + 51e82d4 commit 172b8e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/php/lang/ast/syntax/PHP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,12 @@ public function __construct() {
return $type;
});

$this->stmt('readonly', function($parse, $token) {
$type= $this->statement($parse);
$type->modifiers[]= 'readonly';
return $type;
});

$this->stmt('#[', function($parse, $token) {
$annotations= $this->annotations($parse, 'annotations');
return $this->statement($parse)->annotate($annotations);
Expand Down

0 comments on commit 172b8e1

Please sign in to comment.