Files
swift-mirror/utils/gyb_syntax_support/AttributeNodes.py
Xi Ge 68348944e2 libSyntax: parse declaration attribute list (@attributes). (#13212)
This commit starts to support syntax nodes for @ attributes list for
declarations. These attributes don't include modifiers like "static" or
access keywords. Along with the function change, the commit refactors
some existing code to reduce duplication.
2017-12-01 16:15:17 -08:00

22 lines
653 B
Python

from Child import Child
from Node import Node # noqa: I201
ATTRIBUTE_NODES = [
# token-list -> token token-list?
Node('TokenList', kind='SyntaxCollection',
element='Token'),
# attribute -> '@' identifier '('? token-list ')'?
Node('Attribute', kind='Syntax',
children=[
Child('AtSignToken', kind='AtSignToken'),
Child('AttributeName', kind='Token'),
# FIXME: more structure
Child('BalancedTokens', kind='TokenList'),
]),
# attribute-list -> attribute attribute-list?
Node('AttributeList', kind='SyntaxCollection',
element='Attribute'),
]