libSyntax: support generic parameter clause. (#13286)

This patch also performs minor refactoring to align syntax parsing
context with the right scope. We start to support the generic clauses
because they are necessary pieces to construct struct or
function syntax node.
This commit is contained in:
Xi Ge
2017-12-05 19:34:55 -08:00
committed by GitHub
parent c9c7d395af
commit fec040d95e
8 changed files with 44 additions and 22 deletions

View File

@@ -35,6 +35,8 @@ GENERIC_NODES = [
# | type-name : protocol-composition-type
Node('GenericParameter', kind='Syntax',
children=[
Child('Attributes', kind='AttributeList',
is_optional=True),
Child('Name', kind='IdentifierToken'),
Child('Colon', kind='ColonToken',
is_optional=True),