tools/preprocessor: do not print the EOF end sentinel The preprocess subcommand now appends the lexer's EOF token to the stream so that ScanStream sees an EOF-terminated view (a truncated callable-macro call stops at EOF instead of running off the end of the stream view). ScanStream forwards that token, and the tool's print loop echoed it as an extra trailing newline, which broke verilog-preprocessor_test. Skip the EOF token when printing; it is a sentinel, not part of the source.
diff --git a/verible/verilog/tools/preprocessor/verilog-preprocessor.cc b/verible/verilog/tools/preprocessor/verilog-preprocessor.cc index af781f3..26907dc 100644 --- a/verible/verilog/tools/preprocessor/verilog-preprocessor.cc +++ b/verible/verilog/tools/preprocessor/verilog-preprocessor.cc
@@ -129,7 +129,10 @@ verilog::VerilogPreprocessData preprocessed_data = preprocessor.ScanStream(lexed_streamview); auto &preprocessed_stream = preprocessed_data.preprocessed_token_stream; - for (auto u : preprocessed_stream) outs << u->text(); + for (auto u : preprocessed_stream) { + if (u->isEOF()) continue; // end sentinel, not part of the source + outs << u->text(); + } for (auto &u : preprocessed_data.errors) outs << u.error_message << '\n'; if (!preprocessed_data.errors.empty()) { return absl::InvalidArgumentError("Error: The preprocessing has failed.");