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
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/AST.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_ast_ts.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/ASTKind.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_ast_kind_ts.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/ASTSlot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_ast_slot_ts.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/ASTVisitor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_ast_visitor_ts.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/RecursiveASTVisitor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_ast_recursive_visitor_ts.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-frontend/src/TokenKind.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_tokenkind_ts.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export function gen_ast_cc({ ast, output }: { ast: AST; output: string }) {
emit(` return kASTKindNames[int(kind)];`);
emit(`}`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_cc.ts
${cpy_header}
#include <cxx/ast.h>

namespace cxx {
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_decoder_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export function gen_ast_decoder_cc({
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_decoder_cc.ts
${cpy_header}
#include <cxx/private/ast_decoder.h>

// cxx
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_decoder_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export function gen_ast_decoder_h({
emit(` Arena* pool_ = nullptr;`);
emit(`};`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_decoder_h.ts
${cpy_header}
#pragma once

#include <cxx/ast_fwd.h>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_encoder_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export function gen_ast_encoder_cc({
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_encoder_cc.ts
${cpy_header}
#include <cxx/private/ast_encoder.h>

// cxx
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_encoder_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export function gen_ast_encoder_h({

emit(`};`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_encoder_h.ts
${cpy_header}
#pragma once

#include <cxx/ast_visitor.h>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_fbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export function gen_ast_fbs({ ast, output }: { ast: AST; output: string }) {
});
}

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_fbs.ts
${cpy_header}
namespace cxx.io;

table Source {
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_fwd_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function gen_ast_fwd_h({ ast, output }: { ast: AST; output: string }) {
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_fwd_h.ts
${cpy_header}

#pragma once

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ template <typename T>
emit(`}`);
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_h.ts
${cpy_header}
#pragma once

#include <cxx/arena.h>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_kind_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export function gen_ast_kind_h({ ast, output }: { ast: AST; output: string }) {

emit(`};`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_kind_h.ts
${cpy_header}

#pragma once

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_kind_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export async function gen_ast_kind_ts({

emit(`}`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_kind_ts.ts
${cpy_header}
${code.join("\n")}
`;

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_pretty_printer_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ if (ast->op == TokenKind::T_NEW_ARRAY) {
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_pretty_printer_cc.ts
${cpy_header}

#include <cxx/ast_pretty_printer.h>

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_pretty_printer_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export function gen_ast_pretty_printer_h({
emit(` struct ${className}Visitor;`);
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_pretty_printer_h.ts
${cpy_header}

#pragma once

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_printer_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export function gen_ast_printer_cc({
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_printer_cc.ts
${cpy_header}
#include <cxx/ast_printer.h>

// cxx
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_printer_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export function gen_ast_printer_h({
emit(` int indent_ = -1;`);
emit(`};`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_printer_h.ts
${cpy_header}
#pragma once

#include <cxx/ast_visitor.h>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_recursive_visitor_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export async function gen_ast_recursive_visitor_ts({
emit(`}`);
emit();

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_recursive_visitor_ts.ts
${cpy_header}
import * as ast from "./AST";
import { ASTVisitor } from "./ASTVisitor";
${code.join("\n")}
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_slot_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export function gen_ast_slot_cc({ ast, output }: { ast: AST; output: string }) {
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_slot_cc.ts
${cpy_header}
#include <cxx/ast_slot.h>
#include <cxx/ast.h>
#include <algorithm>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_slot_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export async function gen_ast_slot_ts({

emit(`}`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_slot_ts.ts
${cpy_header}
${code.join("\n")}
`;

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ export async function gen_ast_ts({
});
emit(`];`);

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_ts.ts
${cpy_header}
import { cxx } from "./cxx";
import { SourceLocation } from "./SourceLocation";
import { ASTCursor } from "./ASTCursor";
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_visitor_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export function gen_ast_visitor_cc({
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_visitor_cc.ts
${cpy_header}
#include <cxx/ast_visitor.h>

// cxx
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_visitor_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export function gen_ast_visitor_h({
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_visitor_h.ts
${cpy_header}

#pragma once

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_ast_visitor_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export async function gen_ast_visitor_ts({
emit(`}`);
emit();

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_visitor_ts.ts
${cpy_header}
import * as ast from "./AST";

${code.join("\n")}
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_syntax_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function gen_syntax_cc({ ast, output }: { ast: AST; output: string }) {
emit(`}`);
});

const out = `${cpy_header}
const out = `// Generated file by: gen_syntax_cc.ts
${cpy_header}
#include <cxx/syntax.h>
#include <cxx/ast.h>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_syntax_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export function gen_syntax_h({ ast, output }: { ast: AST; output: string }) {
emit(`auto from(${base}* ast) -> std::optional<${variantName}>;`);
});

const out = `${cpy_header}
const out = `// Generated file by: gen_syntax_h.ts
${cpy_header}
#pragma once
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_token_fwd_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export function gen_token_fwd_h({ output }: { output: string }) {
emit(` V(${tk.toUpperCase()}, ${other}) \\`),
);

const out = `${cpy_header}
const out = `// Generated file by: gen_token_fwd_h.ts
${cpy_header}
#pragma once

#include <cxx/cxx_fwd.h>
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/gen_tokenkind_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export function gen_tokenkind_ts({ output }: { output: string }) {
tokens.C_AND_CXX_KEYWORDS.forEach((tk) => emit(` ${tk.toUpperCase()},`));
emit("}");

const out = `${cpy_header}
const out = `// Generated file by: gen_tokenkind_ts.ts
${cpy_header}
${code.join("\n")}
`;

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/get_ast_slot_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export function gen_ast_slot_h({ ast, output }: { ast: AST; output: string }) {
});
});

const out = `${cpy_header}
const out = `// Generated file by: gen_ast_slot_h.ts
${cpy_header}
#pragma once

#include <cxx/ast_visitor.h>
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-ast/src/kwgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function kwgen(options: Options) {
const emit = (s: string) => out.push(s);

if (copyright !== undefined) {
emit("// Generated file by: kwgen.ts");
emit(copyright);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/new_ast_op_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export function new_ast_op_cc({
});
});

const out = `${cpy_header}
const out = `// Generated file by: new_ast_op_cc.ts
${cpy_header}

#include <cxx/${opHeader}>

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/new_ast_op_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export function new_ast_op_h({
emit(` [[nodiscard]] auto operator()(${name}* ast) -> ${resultTy};`);
});

const out = `${cpy_header}
const out = `// Generated file by: new_ast_op_h.ts
${cpy_header}
#pragma once
Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/new_ast_rewriter_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ if (auto param = symbol_cast<NonTypeParameterSymbol>(ast->symbol);
});
});

const out = `${cpy_header}
const out = `// Generated file by: new_ast_rewriter_cc.ts
${cpy_header}

#include <cxx/${opHeader}>

Expand Down
3 changes: 2 additions & 1 deletion packages/cxx-gen-ast/src/new_ast_rewriter_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export function new_ast_rewriter_h({
emit(` struct ${className}Visitor;`);
});

const out = `${cpy_header}
const out = `// Generated file by: new_ast_rewriter_h.ts
${cpy_header}

#pragma once

Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_enums_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function gen_enums_cc({ model, outputDirectory }: { model: MetaModel; out
out += `${s}\n`;
};

emit("// Generated file by: gen_enums_cc.ts");
emit(copyrightHeader);
emit();
emit(`#include <cxx/lsp/enums.h>`);
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_enums_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function gen_enums_h({ model, outputDirectory }: { model: MetaModel; outp
out += `${s}\n`;
};

emit("// Generated file by: gen_enums_h.ts");
emit(copyrightHeader);
emit();
emit(`#pragma once`);
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_fwd_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export function gen_fwd_h({ model, outputDirectory }: { model: MetaModel; output
out += `${s}\n`;
};

emit("// Generated file by: gen_fwd_h.ts");
emit(copyrightHeader);
emit();
emit(`#pragma once`);
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_requests_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class RequestGenerator extends TypeGenerator {
}

begin() {
this.emit("// Generated file by: gen_requests_cc.ts");
this.emit(copyrightHeader);
this.emit();
this.emit(`#include <cxx/lsp/requests.h>`);
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_requests_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function gen_requests_h({ model, outputDirectory }: { model: MetaModel; o
out += `${s}\n`;
};

emit("// Generated file by: gen_requests_h.ts");
emit(copyrightHeader);
emit(beginHeaderFragment);

Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_types_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class TypeGenerator {
}

begin() {
this.emit("// Generated file by: gen_types_cc.ts");
this.emit(copyrightHeader);
this.emit();
this.emit(`#include <cxx/lsp/types.h>`);
Expand Down
1 change: 1 addition & 0 deletions packages/cxx-gen-lsp/src/gen_types_h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function gen_types_h({ model, outputDirectory }: { model: MetaModel; outp
return propertyType;
};

emit("// Generated file by: gen_types_h.ts");
emit(copyrightHeader);
emit();
emit(`#pragma once`);
Expand Down
1 change: 1 addition & 0 deletions src/parser/cxx/ast.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Generated file by: gen_ast_cc.ts
// Copyright (c) 2025 Roberto Raggi <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Loading