libSyntax: specialize import declaration. (#13437)

This commit is contained in:
Xi Ge
2017-12-14 12:27:52 -08:00
committed by GitHub
parent 65be47ef71
commit a6b3559a8a
4 changed files with 43 additions and 2 deletions

View File

@@ -279,4 +279,25 @@ DECL_NODES = [
Child('CloseParen', kind='RightParenToken',
is_optional=True),
]),
Node('AccessPathComponent', kind='Syntax',
children=[
Child('Name', kind='IdentifierToken'),
Child('TrailingDot', kind='PeriodToken', is_optional=True),
]),
Node('AccessPath', kind='SyntaxCollection', element='AccessPathComponent'),
Node('ImportDecl', kind='Decl',
children=[
Child('Attributes', kind='AttributeList', is_optional=True),
Child('ImportTok', kind='ImportToken'),
Child('ImportKind', kind='Token', is_optional=True,
token_choices=[
'TypealiasToken', 'StructToken', 'ClassToken',
'EnumToken', 'ProtocolToken', 'VarToken', 'LetToken',
'FuncToken',
]),
Child('Path', kind='AccessPath'),
]),
]