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
8 changes: 6 additions & 2 deletions packages/cxx-gen-ast/src/gen_ast_pretty_printer_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export function gen_ast_pretty_printer_cc({
nodes.forEach(({ name, members }) => {
emit();
emit(
`void ASTPrettyPrinter::${className}Visitor::operator()(${name}* ast) {`,
`void ASTPrettyPrinter::${className}Visitor::operator()(${name}* ast) {`
);

members.forEach((m) => {
Expand Down Expand Up @@ -303,6 +303,10 @@ if (ast->op == TokenKind::T_NEW_ARRAY) {
emit(`accept.write("{}", Token::spell(ast->op));`);
} else {
emit(`accept.writeToken(ast->${m.name});`);

if (m.name == "captureDefaultLoc") {
emit(`if (ast->captureList) accept.write(",");`);
}
}

// post token
Expand Down Expand Up @@ -331,7 +335,7 @@ if (ast->op == TokenKind::T_NEW_ARRAY) {
if (isCommaSeparated(m, name)) {
if (["enumeratorList"].includes(m.name)) {
emit(
`if (it->next) { nospace(); accept.write(","); newline(); }`,
`if (it->next) { nospace(); accept.write(","); newline(); }`
);
} else {
emit(`if (it->next) { nospace(); accept.write(","); }`);
Expand Down
1 change: 1 addition & 0 deletions src/parser/cxx/ast_pretty_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2256,6 +2256,7 @@ void ASTPrettyPrinter::ExpressionVisitor::operator()(LambdaExpressionAST* ast) {
}
if (ast->captureDefaultLoc) {
accept.writeToken(ast->captureDefaultLoc);
if (ast->captureList) accept.write(",");
}

for (auto it = ast->captureList; it; it = it->next) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/cxx/gcc_linux_toolchain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace cxx {
GCCLinuxToolchain::GCCLinuxToolchain(Preprocessor* preprocessor,
std::string arch)
: Toolchain(preprocessor), arch_(std::move(arch)) {
for (int version : {14, 13, 12, 11, 10, 9}) {
for (int version : {15, 14, 13, 12, 11, 10, 9}) {
const auto path = fs::path(
std::format("/usr/lib/gcc/{}-linux-gnu/{}/include", arch_, version));

Expand Down
5 changes: 2 additions & 3 deletions src/parser/cxx/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,14 @@ Parser::Parser(TranslationUnit* unit) : unit(unit), binder_(unit) {
globalScope_ = unit->globalScope();
setScope(globalScope_);

// temporary workarounds to the gnu until we have a proper
// temporary workarounds to GNU STL until we have a proper
// support for templates
mark_maybe_template_name(control_->getIdentifier("__remove_reference_t"));
// mark_maybe_template_name(control_->getIdentifier("__integer_pack"));

template_names_.insert(control_->getIdentifier("_S_invoke"));
template_names_.insert(control_->getIdentifier("__type_pack_element"));
template_names_.insert(control_->getIdentifier("__make_integer_seq"));
template_names_.insert(control_->getIdentifier("_S_nothrow_construct"));
template_names_.insert(control_->getIdentifier("_S_nothrow_destroy"));
}

Parser::~Parser() = default;
Expand Down