Skip to content

Commit

Permalink
docs: Add method-interface-member definition to syntax.md
Browse files Browse the repository at this point in the history
Interface definition only accepts instance methods without visibility
for its members.  This separates `method-member` definition into
`method-class-member` and `method-interface-member`.
  • Loading branch information
tk0miya committed Dec 27, 2024
1 parent b147cbb commit 8296227
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,12 @@ _ivar-member_ ::= _ivar-name_ `:` _type_
| `self` `.` _ivar-name_ `:` _type_
| _cvar-name_ `:` _type_

_method-member_ ::= _visibility_ `def` _method-name_ `:` _method-types_ # Instance method
| _visibility_ `def self.` _method-name_ `:` _method-types_ # Singleton method
| `def self?.` _method-name_ `:` _method-types_ # Singleton and instance method
_method-member_ ::= _method-class-member_
| _method-interface-member_
_method-class-member_ ::= _visibility_ `def` _method-name_ `:` _method-types_ # Instance method
| _visibility_ `def self.` _method-name_ `:` _method-types_ # Singleton method
| `def self?.` _method-name_ `:` _method-types_ # Singleton and instance method
_method-interface-member_ ::= `def` _method-name_ `:` _method-types_ # Instance method

_method-types_ ::= _method-type-parameters_ _method-type_ # Single method type
| _method-type-parameters_ _method-type_ `|` _method-types_ # Overloading types
Expand Down Expand Up @@ -624,7 +627,7 @@ _module-self-types_ ::= _class-name_ _type-arguments_ `,` _module-self-types_

_interface-decl_ ::= `interface` _interface-name_ _module-type-parameters_ _interface-members_ `end`

_interface-members_ ::= _method-member_ # Method
_interface-members_ ::= _method-interface-member_ # Method
| _include-interface-member_ # Mixin (include)
| _alias-member_ # Alias

Expand Down

0 comments on commit 8296227

Please sign in to comment.