Skip to content

Commit

Permalink
Erase ALL newlines that are directly before and/or conjunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
TadeasKucera committed Mar 25, 2020
1 parent ca0c780 commit f604315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/types/token_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ void TokenStream::addMissingNewLines()
if (current == NEW_LINE)
{
if (next == OR || next == AND)
it = std::prev(erase(it));
while (it->getType() == NEW_LINE)
it = std::prev(erase(it));
else
++lineCounter;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/cpp/parser_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3128,13 +3128,16 @@ R"(rule rule_1 {
any of them
or (
true
and false)
}
rule rule_2
{
condition:
true
or
false
}
Expand Down

0 comments on commit f604315

Please sign in to comment.