Add support to syntax tree

This commit is contained in:
Arnold Schwaighofer
2021-10-04 14:38:06 -07:00
parent 8840ea6b5b
commit 71f46a4f25
4 changed files with 24 additions and 2 deletions

View File

@@ -102,10 +102,25 @@ ATTRIBUTE_NODES = [
element='Syntax', element_name='SpecializeAttribute',
element_choices=[
'LabeledSpecializeEntry',
'AvailabilityEntry',
'TargetFunctionEntry',
'GenericWhereClause',
]),
Node('AvailabilityEntry', kind='Syntax',
description='''
The availability argument for the _specialize attribute
''',
children=[
Child('Label', kind='IdentifierToken',
description='The label of the argument'),
Child('Colon', kind='ColonToken',
description='The colon separating the label and the value'),
Child('AvailabilityList', kind='AvailabilitySpecList',
collection_element_name='Availability'),
Child('Semicolon', kind='SemicolonToken'),
]),
# Representation of e.g. 'exported: true,'
# labeled-specialize-entry -> identifier ':' token ','?
Node('LabeledSpecializeEntry', kind='Syntax',