Skip to content

Commit 6d2fa79

Browse files
committed
Parse optional attribute lists after lambda introducer
1 parent 05de9a2 commit 6d2fa79

File tree

14 files changed

+921
-824
lines changed

14 files changed

+921
-824
lines changed

packages/cxx-frontend/src/AST.ts

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5679,19 +5679,45 @@ export class LambdaExpressionAST extends ExpressionAST {
56795679
);
56805680
}
56815681

5682+
/**
5683+
* Returns the expressionAttributeList of this node
5684+
*/
5685+
getExpressionAttributeList(): Iterable<AttributeSpecifierAST | undefined> {
5686+
let it = cxx.getASTSlot(this.getHandle(), 0);
5687+
let value: AttributeSpecifierAST | undefined;
5688+
let done = false;
5689+
const p = this.parser;
5690+
function advance() {
5691+
done = it === 0;
5692+
if (done) return;
5693+
const ast = cxx.getListValue(it);
5694+
value = AST.from<AttributeSpecifierAST>(ast, p);
5695+
it = cxx.getListNext(it);
5696+
}
5697+
function next() {
5698+
advance();
5699+
return { done, value };
5700+
}
5701+
return {
5702+
[Symbol.iterator]() {
5703+
return { next };
5704+
},
5705+
};
5706+
}
5707+
56825708
/**
56835709
* Returns the location of the lparen token in this node
56845710
*/
56855711
getLparenToken(): Token | undefined {
5686-
return Token.from(cxx.getASTSlot(this.getHandle(), 8), this.parser);
5712+
return Token.from(cxx.getASTSlot(this.getHandle(), 9), this.parser);
56875713
}
56885714

56895715
/**
56905716
* Returns the parameterDeclarationClause of this node
56915717
*/
56925718
getParameterDeclarationClause(): ParameterDeclarationClauseAST | undefined {
56935719
return AST.from<ParameterDeclarationClauseAST>(
5694-
cxx.getASTSlot(this.getHandle(), 9),
5720+
cxx.getASTSlot(this.getHandle(), 10),
56955721
this.parser,
56965722
);
56975723
}
@@ -5700,7 +5726,7 @@ export class LambdaExpressionAST extends ExpressionAST {
57005726
* Returns the location of the rparen token in this node
57015727
*/
57025728
getRparenToken(): Token | undefined {
5703-
return Token.from(cxx.getASTSlot(this.getHandle(), 10), this.parser);
5729+
return Token.from(cxx.getASTSlot(this.getHandle(), 11), this.parser);
57045730
}
57055731

57065732
/**
@@ -5760,7 +5786,7 @@ export class LambdaExpressionAST extends ExpressionAST {
57605786
*/
57615787
getExceptionSpecifier(): ExceptionSpecifierAST | undefined {
57625788
return AST.from<ExceptionSpecifierAST>(
5763-
cxx.getASTSlot(this.getHandle(), 13),
5789+
cxx.getASTSlot(this.getHandle(), 14),
57645790
this.parser,
57655791
);
57665792
}
@@ -5796,7 +5822,7 @@ export class LambdaExpressionAST extends ExpressionAST {
57965822
*/
57975823
getTrailingReturnType(): TrailingReturnTypeAST | undefined {
57985824
return AST.from<TrailingReturnTypeAST>(
5799-
cxx.getASTSlot(this.getHandle(), 15),
5825+
cxx.getASTSlot(this.getHandle(), 16),
58005826
this.parser,
58015827
);
58025828
}
@@ -5806,7 +5832,7 @@ export class LambdaExpressionAST extends ExpressionAST {
58065832
*/
58075833
getRequiresClause(): RequiresClauseAST | undefined {
58085834
return AST.from<RequiresClauseAST>(
5809-
cxx.getASTSlot(this.getHandle(), 16),
5835+
cxx.getASTSlot(this.getHandle(), 17),
58105836
this.parser,
58115837
);
58125838
}
@@ -5816,7 +5842,7 @@ export class LambdaExpressionAST extends ExpressionAST {
58165842
*/
58175843
getStatement(): CompoundStatementAST | undefined {
58185844
return AST.from<CompoundStatementAST>(
5819-
cxx.getASTSlot(this.getHandle(), 17),
5845+
cxx.getASTSlot(this.getHandle(), 18),
58205846
this.parser,
58215847
);
58225848
}
@@ -5825,7 +5851,7 @@ export class LambdaExpressionAST extends ExpressionAST {
58255851
* Returns the captureDefault attribute of this node
58265852
*/
58275853
getCaptureDefault(): TokenKind {
5828-
return cxx.getASTSlot(this.getHandle(), 18);
5854+
return cxx.getASTSlot(this.getHandle(), 19);
58295855
}
58305856
}
58315857

0 commit comments

Comments
 (0)