Remove duplicate newl at end of code generation for a file
This commit is contained in:
parent
27fd67bad1
commit
59eee1f75a
2 changed files with 7 additions and 8 deletions
|
|
@ -60,8 +60,10 @@ namespace
|
|||
code_generator::output output(type_safe::ref(generator), type_safe::ref(f), true);
|
||||
if (output)
|
||||
{
|
||||
write_container(output, f, newl);
|
||||
output << newl;
|
||||
auto need_sep = write_container(output, f, newl);
|
||||
if (!need_sep)
|
||||
// file empty, write newl
|
||||
output << newl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@ enum class bar
|
|||
|
||||
void func(int(*)(int));
|
||||
|
||||
extern void(* ptr)(int(*)(int))=&func;
|
||||
)";
|
||||
extern void(* ptr)(int(*)(int))=&func;)";
|
||||
|
||||
auto file = parse({}, "code_generator.cpp", code);
|
||||
REQUIRE(get_code(*file) == code);
|
||||
|
|
@ -49,8 +48,7 @@ namespace a {}
|
|||
namespace b = a;
|
||||
|
||||
using c = int*;
|
||||
typedef int d;
|
||||
)";
|
||||
typedef int d;)";
|
||||
|
||||
auto synopsis = R"(namespace a{
|
||||
}
|
||||
|
|
@ -59,8 +57,7 @@ namespace b=excluded;
|
|||
|
||||
using c=excluded;
|
||||
|
||||
using d=excluded;
|
||||
)";
|
||||
using d=excluded;)";
|
||||
|
||||
auto file = parse({}, "code_generator_exclude_target.cpp", code);
|
||||
REQUIRE(get_code(*file, code_generator::exclude_target) == synopsis);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue