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
48 changes: 38 additions & 10 deletions packages/cxx-frontend/src/AST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9623,13 +9623,6 @@ export class EnumSpecifierAST extends SpecifierAST {
return Token.from(cxx.getASTSlot(this.getHandle(), 7), this.parser);
}

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

/**
* Returns the enumeratorList of this node
*/
Expand All @@ -9656,6 +9649,13 @@ export class EnumSpecifierAST extends SpecifierAST {
};
}

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

/**
* Returns the location of the rbrace token in this node
*/
Expand Down Expand Up @@ -9863,15 +9863,29 @@ export class TypenameSpecifierAST extends SpecifierAST {
);
}

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

/**
* Returns the unqualifiedId of this node
*/
getUnqualifiedId(): UnqualifiedIdAST | undefined {
return AST.from<UnqualifiedIdAST>(
cxx.getASTSlot(this.getHandle(), 2),
cxx.getASTSlot(this.getHandle(), 3),
this.parser,
);
}

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

/**
Expand Down Expand Up @@ -11677,12 +11691,19 @@ export class TypeRequirementAST extends RequirementAST {
);
}

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

/**
* Returns the unqualifiedId of this node
*/
getUnqualifiedId(): UnqualifiedIdAST | undefined {
return AST.from<UnqualifiedIdAST>(
cxx.getASTSlot(this.getHandle(), 2),
cxx.getASTSlot(this.getHandle(), 3),
this.parser,
);
}
Expand All @@ -11691,7 +11712,14 @@ export class TypeRequirementAST extends RequirementAST {
* Returns the location of the semicolon token in this node
*/
getSemicolonToken(): Token | undefined {
return Token.from(cxx.getASTSlot(this.getHandle(), 3), this.parser);
return Token.from(cxx.getASTSlot(this.getHandle(), 4), this.parser);
}

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

Expand Down
24 changes: 17 additions & 7 deletions packages/cxx-gen-ast/src/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// SOFTWARE.

import { gen_ast_cc } from "./gen_ast_cc.js";
import { gen_ast_dump_cc } from "./gen_ast_dump_cc.js";
import { gen_ast_dump_h } from "./gen_ast_dump_h.js";
import { gen_ast_printer_cc } from "./gen_ast_printer_cc.js";
import { gen_ast_printer_h } from "./gen_ast_printer_h.js";
import { gen_ast_fwd_h } from "./gen_ast_fwd_h.js";
import { gen_ast_h } from "./gen_ast_h.js";
import { gen_ast_kind_h } from "./gen_ast_kind_h.js";
Expand All @@ -40,14 +40,16 @@ import { gen_ast_encoder_cc } from "./gen_ast_encoder_cc.js";
import { gen_ast_decoder_h } from "./gen_ast_decoder_h.js";
import { gen_ast_decoder_cc } from "./gen_ast_decoder_cc.js";
import { gen_ast_slot_ts } from "./gen_ast_slot_ts.js";
import { gen_token_fwd_h } from "./gen_token_fwd_h.js";
import { gen_tokenkind_ts } from "./gen_tokenkind_ts.js";
import { gen_keywords_kwgen } from "./gen_keywords_kwgen.js";
import { gen_ast_pretty_printer_h } from "./gen_ast_pretty_printer_h.js";
import { gen_ast_pretty_printer_cc } from "./gen_ast_pretty_printer_cc.js";

import * as fs from "fs";
import * as path from "path";
import * as process from "process";
import * as child_process from "child_process";
import { gen_token_fwd_h } from "./gen_token_fwd_h.js";
import { gen_tokenkind_ts } from "./gen_tokenkind_ts.js";
import { gen_keywords_kwgen } from "./gen_keywords_kwgen.js";

const outdir = process.cwd();

Expand All @@ -65,14 +67,22 @@ gen_ast_visitor_h({
ast,
output: path.join(outdir, "src/parser/cxx/ast_visitor.h"),
});
gen_ast_dump_h({
gen_ast_printer_h({
ast,
output: path.join(outdir, "src/parser/cxx/ast_printer.h"),
});
gen_ast_dump_cc({
gen_ast_printer_cc({
ast,
output: path.join(outdir, "src/parser/cxx/ast_printer.cc"),
});
gen_ast_pretty_printer_h({
ast,
output: path.join(outdir, "src/parser/cxx/ast_pretty_printer.h"),
});
gen_ast_pretty_printer_cc({
ast,
output: path.join(outdir, "src/parser/cxx/ast_pretty_printer.cc"),
});
gen_ast_kind_h({ ast, output: path.join(outdir, "src/parser/cxx/ast_kind.h") });
gen_ast_slot_h({ ast, output: path.join(outdir, "src/parser/cxx/ast_slot.h") });
gen_ast_slot_cc({
Expand Down
Loading