mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce a new syntax kind to represent missing base nodes
In the future, we only want to attach a source presence to tokens, not to nodes. All concreate nodes which are missing can be represented by creating the node and marking all tokens as missing, but if a syntax node carries a child, that has a base kind (like `Decl`), we can’t decide which concrete node to instantiate. Introduce `MissingDecl` etc. node for this purpose. rdar://97908258 rdar://97775360
This commit is contained in:
@@ -12,6 +12,12 @@ COMMON_NODES = [
|
||||
Node('UnknownStmt', kind='Stmt'),
|
||||
Node('UnknownType', kind='Type'),
|
||||
Node('UnknownPattern', kind='Pattern'),
|
||||
Node('Missing', kind='Syntax'),
|
||||
Node('MissingDecl', kind='Decl'),
|
||||
Node('MissingExpr', kind='Expr'),
|
||||
Node('MissingStmt', kind='Stmt'),
|
||||
Node('MissingType', kind='Type'),
|
||||
Node('MissingPattern', kind='Pattern'),
|
||||
|
||||
# code-block-item = (decl | stmt | expr) ';'?
|
||||
Node('CodeBlockItem', kind='Syntax', omit_when_empty=True,
|
||||
|
||||
Reference in New Issue
Block a user