zeek/src/script_opt/CPP/Emit.cc
Benjamin Bannier f5a76c1aed Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00

24 lines
490 B
C++

// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/script_opt/CPP/Compile.h"
namespace zeek::detail {
using namespace std;
void CPPCompile::StartBlock() {
IndentUp();
Emit("{");
}
void CPPCompile::EndBlock(bool needs_semi) {
Emit("}%s", needs_semi ? ";" : "");
IndentDown();
}
void CPPCompile::Indent() const {
for ( auto i = 0; i < block_level; ++i )
fprintf(write_file, "%s", "\t");
}
} // namespace zeek::detail