Skip to content

Commit

Permalink
added Header and Footer to tikz code. Still missing } for trees.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtischle committed Dec 8, 2023
1 parent 2e2ab96 commit 48e5cbf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2517,8 +2517,14 @@ void Printer::Cpp::print_value_pp_tree(const AST &ast) {
dec_indent();
stream << indent() << "} else {" << endl;
inc_indent();
stream << indent() << "out << res << '\\n';" << endl;
stream << indent() << "file_stream << res << '\\n' << std::endl;" << endl;
stream << indent() << "out << res;" << endl;
stream << indent() << "file_stream << \"\\\\documentclass[tikz, border=1mm]{standalone} \" << std::endl;" << endl;
stream << indent() << "file_stream << \"\\\\begin{document} \" << std::endl;" << endl;
stream << indent() << "file_stream << \"\\\\begin{tikzpicture}\" << std::endl;" << endl;
stream << indent() << "file_stream << \"\\\\node {root} \" << std::endl;" << endl; // Each Root generates a subplot; Need to name them individually so they can be generated all in one file. Should be possible since the root name won't need any senseful name
stream << indent() << "file_stream << res;" << endl; // TO-DO -> split res on "\n"(?) so we can generate a node entry for each entry in res
stream << indent() << "file_stream << \"\\\\end{tikzpicture} \" << std::endl;" << endl;
stream << indent() << "file_stream << \"\\\\end{document} \" << std::endl;" << endl;
indent();
stream << indent() << '}' << endl;
dec_indent();
Expand Down

0 comments on commit 48e5cbf

Please sign in to comment.