swift-syntax
swift-syntax copied to clipboard
[SwiftParser] Support function body and type member skipping
- Introduce
ParsingOptions
option-set type withbodySkipping
member, and addoptions: ParsingOptions
to allParser.parse(...)
functions - Skipped body is represented as a newly introduced
SkippedDeclSyntax
-
SkippedDeclSyntax
contains only one.unknown
token that covers the whole skipped characters including trivia.
-
- Function body can be skipped as long as:
- it does not contain nested type decls
- Type member block can be skipped as long as:
- it does not contain nested class decls
- it does not contain operator functions
- it does not contain
#if
directives