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
4 changes: 2 additions & 2 deletions packages/cxx-gen-ast/src/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ gen_ast_visitor_h({
});
gen_ast_dump_h({
ast,
output: path.join(outdir, "src/frontend/cxx/ast_printer.h"),
output: path.join(outdir, "src/parser/cxx/ast_printer.h"),
});
gen_ast_dump_cc({
ast,
output: path.join(outdir, "src/frontend/cxx/ast_printer.cc"),
output: path.join(outdir, "src/parser/cxx/ast_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") });
Expand Down
7 changes: 5 additions & 2 deletions packages/cxx-gen-ast/src/gen_ast_dump_cc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export function gen_ast_dump_cc({ ast, output }: { ast: AST; output: string }) {
if (base == "ExpressionAST") {
emit(` out_ << "${astName(name)}";`);
emit(` if (ast->type) {`);
emit(` out_ << std::format(" [{} {}]", to_string(ast->valueCategory), to_string(ast->type));`);
emit(
` out_ << std::format(" [{} {}]", to_string(ast->valueCategory), to_string(ast->type));`
);
emit(` }`);
emit(` out_ << "\\n";`);
} else {
Expand Down Expand Up @@ -137,8 +139,9 @@ export function gen_ast_dump_cc({ ast, output }: { ast: AST; output: string }) {
});

const out = `${cpy_header}
#include "ast_printer.h"
#include <cxx/ast_printer.h>

// cxx
#include <cxx/ast.h>
#include <cxx/translation_unit.h>
#include <cxx/names.h>
Expand Down
1 change: 0 additions & 1 deletion src/frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


add_executable(cxx
cxx/ast_printer.cc
cxx/frontend.cc
cxx/verify_diagnostics_client.cc
)
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/cxx/frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@
#include <cxx/mlir/cxx_dialect.h>
#endif

#include <cxx/ast_printer.h>

#include <format>
#include <fstream>
#include <iostream>
#include <list>
#include <regex>
#include <string>

#include "ast_printer.h"
#include "verify_diagnostics_client.h"

namespace {
Expand Down
1 change: 1 addition & 0 deletions src/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ file(GLOB CXX_VIEWS_INCLUDE_HEADER_FILES cxx/views/*.h)
add_library(cxx-parser
cxx/ast_cursor.cc
cxx/ast_interpreter.cc
cxx/ast_printer.cc
cxx/ast_rewriter.cc
cxx/ast_slot.cc
cxx/ast.cc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#include "ast_printer.h"
#include <cxx/ast_printer.h>

// cxx
#include <cxx/ast.h>
#include <cxx/literals.h>
#include <cxx/names.h>
Expand Down
File renamed without changes.