php / php-langspec

PHP Language Specification
http://www.php.net
Other
2.3k stars 271 forks source link

Add grammar for `readonly` class modifier #263

Closed ghostwriter closed 8 months ago

ghostwriter commented 8 months ago

This patch adds the grammar for readonly class modifier, via the following changes:

diff --git a/spec/14-classes.md b/spec/14-classes.md

--- a/spec/14-classes.md
+++ b/spec/14-classes.md

 class-declaration:
-  class-modifier? 'class' name class-base-clause? class-interface-clause? '{' class-member-declarations? '}'
+  class-modifiers? 'class' name class-base-clause? class-interface-clause? '{' class-member-declarations? '}'
+
+class-modifiers:
+  class-modifier
+  class-modifiers class-modifier

 class-modifier:
   'abstract'
   'final'
+  'readonly'