File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1599,6 +1599,7 @@ ParserResult<Stmt> Parser::parseStmtGuard() {
1599
1599
// / stmt-while:
1600
1600
// / (identifier ':')? 'while' expr-basic stmt-brace
1601
1601
ParserResult<Stmt> Parser::parseStmtWhile (LabeledStmtInfo LabelInfo) {
1602
+ SyntaxContext->setCreateSyntax (SyntaxKind::WhileStmt);
1602
1603
SourceLoc WhileLoc = consumeToken (tok::kw_while);
1603
1604
1604
1605
Scope S (this , ScopeKind::WhileVars);
Original file line number Diff line number Diff line change @@ -319,7 +319,9 @@ func statementTests<FunctionSignature><ParameterClause>() </ParameterClause></Fu
319
319
} </CodeBlock></CatchClause><CatchClause>catch <CodeBlock>{
320
320
}</CodeBlock></CatchClause></DoStmt><RepeatWhileStmt>
321
321
repeat <CodeBlock>{ } </CodeBlock>while <BooleanLiteralExpr>true</BooleanLiteralExpr></RepeatWhileStmt><RepeatWhileStmt>
322
- LABEL: repeat <CodeBlock>{ } </CodeBlock>while <BooleanLiteralExpr>false</BooleanLiteralExpr></RepeatWhileStmt><DoStmt>
322
+ LABEL: repeat <CodeBlock>{ } </CodeBlock>while <BooleanLiteralExpr>false</BooleanLiteralExpr></RepeatWhileStmt><WhileStmt>
323
+ while <ConditionElement><BooleanLiteralExpr>true </BooleanLiteralExpr></ConditionElement><CodeBlock>{ }</CodeBlock></WhileStmt><WhileStmt>
324
+ LABEL: while <ConditionElement><BooleanLiteralExpr>true </BooleanLiteralExpr></ConditionElement><CodeBlock>{ }</CodeBlock></WhileStmt><DoStmt>
323
325
LABEL: do <CodeBlock>{}</CodeBlock></DoStmt>
324
326
LABEL: switch <IdentifierExpr>foo </IdentifierExpr>{
325
327
case <ExpressionPattern><IntegerLiteralExpr>1</IntegerLiteralExpr></ExpressionPattern>:<FallthroughStmt>
Original file line number Diff line number Diff line change @@ -320,6 +320,8 @@ func statementTests() {
320
320
}
321
321
repeat { } while true
322
322
LABEL: repeat { } while false
323
+ while true { }
324
+ LABEL: while true { }
323
325
LABEL: do { }
324
326
LABEL: switch foo {
325
327
case 1 :
You can’t perform that action at this time.
0 commit comments