mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[libSyntax] Allow adding garbage nodes in between any two children of a syntax node
When the source code is invalid, this allows us to represent tokens that could not be used to form a valid syntax tree with more fidelity. This commit does not start using GarbageNodes yet, it just sets everything up for them.
This commit is contained in:
@@ -57,4 +57,10 @@ COMMON_NODES = [
|
||||
Child('RightBrace', kind='RightBraceToken',
|
||||
requires_leading_newline=True),
|
||||
]),
|
||||
|
||||
Node('GarbageNodes', kind='SyntaxCollection', element='Syntax',
|
||||
description='''
|
||||
A collection of syntax nodes that occurred in the source code but
|
||||
could not be used to form a valid syntax tree.
|
||||
'''),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user