Skip to content

Commit dba9ad6

Browse files
authored
Merge pull request #2090 from tk0miya/docs/syntax/add_singleton_attribute_members
docs: Add singleton attribute members to syntax.md
2 parents 6c77c6b + 138a87f commit dba9ad6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/syntax.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,12 @@ _method-types_ ::= _method-type-parameters_ _method-type_
416416
_method-type-parameters_ ::= # Empty
417417
| `[` _type-variable_ `,` ... `]`
418418

419-
_attribute-member_ ::= _visibility_ _attribute-type_ _method-name_ `:` _type_ # Attribute
420-
| _visibility_ _attribute-type_ _method-name_ `(` _ivar-name_ `) :` _type_ # Attribute with variable name specification
421-
| _visibility_ _attribute-type_ _method-name_ `() :` _type_ # Attribute without variable
422-
419+
_attribute-member_ ::= _visibility_ _attribute-type_ _method-name_ `:` _type_ # Attribute
420+
| _visibility_ _attribute-type_ _method-name_ `(` _ivar-name_ `) :` _type_ # Attribute with variable name specification
421+
| _visibility_ _attribute-type_ _method-name_ `() :` _type_ # Attribute without variable
422+
| _visibility_ _attribute-type_ `self.` _method-name_ `:` _type_ # Singleton attribute
423+
| _visibility_ _attribute-type_ `self.` _method-name_ `(` _ivar-name_ `) :` _type_ # Singleton attribute with variable name specification
424+
| _visibility_ _attribute-type_ `self.` _method-name_ `() :` _type_ # Singleton attribute without variable
423425
_visibility_ ::= `public` | `private`
424426

425427
_attribute-type_ ::= `attr_reader` | `attr_writer` | `attr_accessor`

0 commit comments

Comments
 (0)