Skip to content

Commit ddd8766

Browse files
committed
MissingDeclSyntax Can Have Attributes and Modifiers
Strange as it sounds, we parse @foo public in item position as a decl that has a hanging attribute and access control modifier. We need to be able to stick... something in the tree here so we don't just drop these tokens on the floor.
1 parent 9151db5 commit ddd8766

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils/gyb_syntax_support/CommonNodes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
Node('UnknownType', kind='Type'),
1414
Node('UnknownPattern', kind='Pattern'),
1515
Node('Missing', kind='Syntax'),
16-
Node('MissingDecl', kind='Decl'),
16+
Node('MissingDecl', kind='Decl', children=[
17+
Child('Attributes', kind='AttributeList',
18+
collection_element_name='Attribute', is_optional=True),
19+
Child('Modifiers', kind='ModifierList',
20+
collection_element_name='Modifier', is_optional=True),
21+
]),
1722
Node('MissingExpr', kind='Expr'),
1823
Node('MissingStmt', kind='Stmt'),
1924
Node('MissingType', kind='Type'),

0 commit comments

Comments
 (0)