mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
libSyntax: parse codeblock syntax node. (#12771)
This commit teaches parser to generate code block syntax node. As a support for this, SyntaxParsingContext can be created by a single syntax kind, indicating the whole context should be parsed into a node of that given syntax. Another change is to bridge created syntax node with the given context kind. For instance, if a statement context results into an expression node, the expression node will be bridged to a statement by wrapping it with a ExpressionStmt node.
This commit is contained in:
@@ -29,6 +29,7 @@ static bool isTrivialSyntaxKind(SyntaxKind Kind) {
|
||||
case SyntaxKind::SourceFile:
|
||||
case SyntaxKind::TopLevelCodeDecl:
|
||||
case SyntaxKind::ExpressionStmt:
|
||||
case SyntaxKind::DeclarationStmt:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user