mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IdentifiedDeclSyntax allows clients to access and modify declared names. All nominal declarations should have this trait.
30 lines
783 B
Python
30 lines
783 B
Python
from Child import Child
|
|
|
|
|
|
class Trait(object):
|
|
def __init__(self, trait_name, children):
|
|
self.trait_name = trait_name
|
|
self.children = children
|
|
|
|
|
|
TRAITS = [
|
|
Trait('DeclGroupSyntax',
|
|
children=[
|
|
Child('Attributes', kind='AttributeList', is_optional=True),
|
|
Child('AccessLevelModifier', kind='DeclModifier',
|
|
is_optional=True),
|
|
Child('Members', kind='MemberDeclBlock'),
|
|
]),
|
|
|
|
Trait('BracedSyntax',
|
|
children=[
|
|
Child('LeftBrace', kind='LeftBraceToken'),
|
|
Child('RightBrace', kind='RightBraceToken'),
|
|
]),
|
|
|
|
Trait('IdentifiedDeclSyntax',
|
|
children=[
|
|
Child('Identifier', kind='IdentifierToken'),
|
|
]),
|
|
]
|