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
61 changes: 58 additions & 3 deletions packages/cxx-frontend/src/AST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3490,27 +3490,41 @@ export class GotoStatementAST extends StatementAST {
return Token.from(cxx.getASTSlot(this.getHandle(), 0), this.parser);
}

/**
* Returns the location of the star token in this node
*/
getStarToken(): Token | undefined {
return Token.from(cxx.getASTSlot(this.getHandle(), 1), this.parser);
}

/**
* Returns the location of the identifier token in this node
*/
getIdentifierToken(): Token | undefined {
return Token.from(cxx.getASTSlot(this.getHandle(), 1), this.parser);
return Token.from(cxx.getASTSlot(this.getHandle(), 2), this.parser);
}

/**
* Returns the location of the semicolon token in this node
*/
getSemicolonToken(): Token | undefined {
return Token.from(cxx.getASTSlot(this.getHandle(), 2), this.parser);
return Token.from(cxx.getASTSlot(this.getHandle(), 3), this.parser);
}

/**
* Returns the identifier attribute of this node
*/
getIdentifier(): string | undefined {
const slot = cxx.getASTSlot(this.getHandle(), 3);
const slot = cxx.getASTSlot(this.getHandle(), 4);
return cxx.getIdentifierValue(slot);
}

/**
* Returns the isIndirect attribute of this node
*/
getIsIndirect(): boolean {
return cxx.getASTSlot(this.getHandle(), 5) !== 0;
}
}

/**
Expand Down Expand Up @@ -5666,6 +5680,46 @@ export class ReflectExpressionAST extends ExpressionAST {
}
}

/**
* LabelAddressExpressionAST node.
*/
export class LabelAddressExpressionAST extends ExpressionAST {
/**
* Traverse this node using the given visitor.
* @param visitor the visitor.
* @param context the context.
* @returns the result of the visit.
*/
accept<Context, Result>(
visitor: ASTVisitor<Context, Result>,
context: Context,
): Result {
return visitor.visitLabelAddressExpression(this, context);
}

/**
* Returns the location of the ampAmp token in this node
*/
getAmpAmpToken(): Token | undefined {
return Token.from(cxx.getASTSlot(this.getHandle(), 0), this.parser);
}

/**
* Returns the location of the identifier token in this node
*/
getIdentifierToken(): Token | undefined {
return Token.from(cxx.getASTSlot(this.getHandle(), 1), this.parser);
}

/**
* Returns the identifier attribute of this node
*/
getIdentifier(): string | undefined {
const slot = cxx.getASTSlot(this.getHandle(), 2);
return cxx.getIdentifierValue(slot);
}
}

/**
* UnaryExpressionAST node.
*/
Expand Down Expand Up @@ -13279,6 +13333,7 @@ const AST_CONSTRUCTORS: Array<
NamespaceReflectExpressionAST,
TypeIdReflectExpressionAST,
ReflectExpressionAST,
LabelAddressExpressionAST,
UnaryExpressionAST,
AwaitExpressionAST,
SizeofExpressionAST,
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/ASTKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export enum ASTKind {
NamespaceReflectExpression,
TypeIdReflectExpression,
ReflectExpression,
LabelAddressExpression,
UnaryExpression,
AwaitExpression,
SizeofExpression,
Expand Down
Loading