verilog: formatting: tree_unwrapper: Added line continuation to LookAheadBeyondCurrentLeaf Added TK_LINE_CONT as another case where the Advancement should continue, alongside the comments Signed-off-by: Jan Bylicki <jbylicki@antmicro.com>
diff --git a/verilog/formatting/tree_unwrapper.cc b/verilog/formatting/tree_unwrapper.cc index c8f6176..ef0b748 100644 --- a/verilog/formatting/tree_unwrapper.cc +++ b/verilog/formatting/tree_unwrapper.cc
@@ -469,7 +469,8 @@ while (!NextUnfilteredToken()->isEOF()) { EatSpaces(); VLOG(4) << "lookahead token: " << VerboseToken(*NextUnfilteredToken()); - if (IsComment(verilog_tokentype(NextUnfilteredToken()->token_enum()))) { + if (auto next_tok = verilog_tokentype(NextUnfilteredToken()->token_enum()); + IsComment(next_tok) || next_tok == verilog_tokentype::TK_LINE_CONT) { // TODO(fangism): or IsAttribute(). Basically, any token that is not // in the syntax tree and not a space. AdvanceLastVisitedLeaf();