Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 0 additions & 152 deletions CodeGeneration/Sources/SyntaxSupport/gyb_generated/ExprNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -493,158 +493,6 @@ public let EXPR_NODES: [Node] = [
])
]),

Node(name: "IfExpr",
nameForDiagnostics: "'if' statement",
kind: "Expr",
traits: [
"WithCodeBlock"
],
children: [
Child(name: "IfKeyword",
kind: "IfToken",
tokenChoices: [
"If"
]),
Child(name: "Conditions",
kind: "ConditionElementList",
collectionElementName: "Condition"),
Child(name: "Body",
kind: "CodeBlock"),
Child(name: "ElseKeyword",
kind: "ElseToken",
isOptional: true,
tokenChoices: [
"Else"
]),
Child(name: "ElseBody",
kind: "Syntax",
isOptional: true,
nodeChoices: [
Child(name: "IfExpr",
kind: "IfExpr"),
Child(name: "CodeBlock",
kind: "CodeBlock")
])
]),

Node(name: "SwitchExpr",
nameForDiagnostics: "'switch' statement",
kind: "Expr",
traits: [
"Braced"
],
children: [
Child(name: "SwitchKeyword",
kind: "SwitchToken",
tokenChoices: [
"Switch"
]),
Child(name: "Expression",
kind: "Expr"),
Child(name: "LeftBrace",
kind: "LeftBraceToken",
tokenChoices: [
"LeftBrace"
]),
Child(name: "Cases",
kind: "SwitchCaseList",
collectionElementName: "Case"),
Child(name: "RightBrace",
kind: "RightBraceToken",
tokenChoices: [
"RightBrace"
],
requiresLeadingNewline: true)
]),

Node(name: "SwitchCaseList",
nameForDiagnostics: nil,
kind: "SyntaxCollection",
element: "Syntax",
elementName: "SwitchCase",
elementChoices: ["SwitchCase", "IfConfigDecl"],
elementsSeparatedByNewline: true),

Node(name: "SwitchCase",
nameForDiagnostics: "switch case",
kind: "Syntax",
traits: [
"WithStatements"
],
parserFunction: "parseSwitchCase",
children: [
Child(name: "UnknownAttr",
kind: "Attribute",
isOptional: true),
Child(name: "Label",
kind: "Syntax",
nodeChoices: [
Child(name: "Default",
kind: "SwitchDefaultLabel"),
Child(name: "Case",
kind: "SwitchCaseLabel")
]),
Child(name: "Statements",
kind: "CodeBlockItemList",
collectionElementName: "Statement",
isIndented: true)
]),

Node(name: "SwitchCaseLabel",
nameForDiagnostics: nil,
kind: "Syntax",
children: [
Child(name: "CaseKeyword",
kind: "CaseToken",
tokenChoices: [
"Case"
]),
Child(name: "CaseItems",
kind: "CaseItemList",
collectionElementName: "CaseItem"),
Child(name: "Colon",
kind: "ColonToken",
tokenChoices: [
"Colon"
])
]),

Node(name: "SwitchDefaultLabel",
nameForDiagnostics: nil,
kind: "Syntax",
children: [
Child(name: "DefaultKeyword",
kind: "DefaultToken",
tokenChoices: [
"Default"
]),
Child(name: "Colon",
kind: "ColonToken",
tokenChoices: [
"Colon"
])
]),

Node(name: "CaseItem",
nameForDiagnostics: nil,
kind: "Syntax",
traits: [
"WithTrailingComma"
],
children: [
Child(name: "Pattern",
kind: "Pattern"),
Child(name: "WhereClause",
kind: "WhereClause",
isOptional: true),
Child(name: "TrailingComma",
kind: "CommaToken",
isOptional: true,
tokenChoices: [
"Comma"
])
]),

Node(name: "UnresolvedTernaryExpr",
nameForDiagnostics: nil,
kind: "Expr",
Expand Down
152 changes: 152 additions & 0 deletions CodeGeneration/Sources/SyntaxSupport/gyb_generated/StmtNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ public let STMT_NODES: [Node] = [
kind: "Expr")
]),

Node(name: "SwitchCaseList",
nameForDiagnostics: nil,
kind: "SyntaxCollection",
element: "Syntax",
elementName: "SwitchCase",
elementChoices: ["SwitchCase", "IfConfigDecl"],
elementsSeparatedByNewline: true),

Node(name: "RepeatWhileStmt",
nameForDiagnostics: "'repeat' statement",
kind: "Stmt",
Expand Down Expand Up @@ -204,6 +212,36 @@ public let STMT_NODES: [Node] = [
kind: "CodeBlock")
]),

Node(name: "SwitchStmt",
nameForDiagnostics: "'switch' statement",
kind: "Stmt",
traits: [
"Braced"
],
children: [
Child(name: "SwitchKeyword",
kind: "SwitchToken",
tokenChoices: [
"Switch"
]),
Child(name: "Expression",
kind: "Expr"),
Child(name: "LeftBrace",
kind: "LeftBraceToken",
tokenChoices: [
"LeftBrace"
]),
Child(name: "Cases",
kind: "SwitchCaseList",
collectionElementName: "Case"),
Child(name: "RightBrace",
kind: "RightBraceToken",
tokenChoices: [
"RightBrace"
],
requiresLeadingNewline: true)
]),

Node(name: "CatchClauseList",
nameForDiagnostics: "'catch' clause",
kind: "SyntaxCollection",
Expand Down Expand Up @@ -482,6 +520,101 @@ public let STMT_NODES: [Node] = [
kind: "Expr")
]),

Node(name: "IfStmt",
nameForDiagnostics: "'if' statement",
kind: "Stmt",
traits: [
"WithCodeBlock"
],
children: [
Child(name: "IfKeyword",
kind: "IfToken",
tokenChoices: [
"If"
]),
Child(name: "Conditions",
kind: "ConditionElementList",
collectionElementName: "Condition"),
Child(name: "Body",
kind: "CodeBlock"),
Child(name: "ElseKeyword",
kind: "ElseToken",
isOptional: true,
tokenChoices: [
"Else"
]),
Child(name: "ElseBody",
kind: "Syntax",
isOptional: true,
nodeChoices: [
Child(name: "IfStmt",
kind: "IfStmt"),
Child(name: "CodeBlock",
kind: "CodeBlock")
])
]),

Node(name: "SwitchCase",
nameForDiagnostics: "switch case",
kind: "Syntax",
traits: [
"WithStatements"
],
parserFunction: "parseSwitchCase",
children: [
Child(name: "UnknownAttr",
kind: "Attribute",
isOptional: true),
Child(name: "Label",
kind: "Syntax",
nodeChoices: [
Child(name: "Default",
kind: "SwitchDefaultLabel"),
Child(name: "Case",
kind: "SwitchCaseLabel")
]),
Child(name: "Statements",
kind: "CodeBlockItemList",
collectionElementName: "Statement",
isIndented: true)
]),

Node(name: "SwitchDefaultLabel",
nameForDiagnostics: nil,
kind: "Syntax",
children: [
Child(name: "DefaultKeyword",
kind: "DefaultToken",
tokenChoices: [
"Default"
]),
Child(name: "Colon",
kind: "ColonToken",
tokenChoices: [
"Colon"
])
]),

Node(name: "CaseItem",
nameForDiagnostics: nil,
kind: "Syntax",
traits: [
"WithTrailingComma"
],
children: [
Child(name: "Pattern",
kind: "Pattern"),
Child(name: "WhereClause",
kind: "WhereClause",
isOptional: true),
Child(name: "TrailingComma",
kind: "CommaToken",
isOptional: true,
tokenChoices: [
"Comma"
])
]),

Node(name: "CatchItem",
nameForDiagnostics: nil,
kind: "Syntax",
Expand All @@ -503,6 +636,25 @@ public let STMT_NODES: [Node] = [
])
]),

Node(name: "SwitchCaseLabel",
nameForDiagnostics: nil,
kind: "Syntax",
children: [
Child(name: "CaseKeyword",
kind: "CaseToken",
tokenChoices: [
"Case"
]),
Child(name: "CaseItems",
kind: "CaseItemList",
collectionElementName: "CaseItem"),
Child(name: "Colon",
kind: "ColonToken",
tokenChoices: [
"Colon"
])
]),

Node(name: "CatchClause",
nameForDiagnostics: "'catch' clause",
kind: "Syntax",
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftBasicFormat/generated/BasicFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ open class BasicFormat: SyntaxRewriter {
return true
case \MemberDeclBlockSyntax.rightBrace:
return true
case \SwitchExprSyntax.rightBrace:
case \SwitchStmtSyntax.rightBrace:
return true
default:
return putNextTokenOnNewLine
Expand Down
Loading