Skip to content

Commit 396e339

Browse files
committed
Remove 1adjust_remaining_token_columns_on_this_line_visitor1
It was always a bit clumsy, and the previous commit's simpler approach has made the visitor redundant -- removing it now has no effect on the regression tests' output
1 parent 38d4947 commit 396e339

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

source/cppfront.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,9 +2717,6 @@ class cppfront
27172717
|| i->op->type() == lexeme::Tilde
27182718
)
27192719
{
2720-
adjust_remaining_token_columns_on_this_line_visitor v(i->op->position(), 0 - i->op->length());
2721-
n.visit(v, 0);
2722-
27232720
// omit some needless parens
27242721
if (
27252722
!last_was_prefixed
@@ -3300,9 +3297,7 @@ class cppfront
33003297
}
33013298

33023299
assert(x.expr);
3303-
adjust_remaining_token_columns_on_this_line_visitor v(x.expr->position(), offset);
33043300
current_args.push_back( {x.pass} );
3305-
x.expr->visit(v, 0);
33063301
emit(*x.expr);
33073302
current_args.pop_back();
33083303

source/parse.h

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5650,53 +5650,6 @@ auto parser::debug_print(std::ostream& o)
56505650
}
56515651

56525652

5653-
//-----------------------------------------------------------------------
5654-
//
5655-
// Visitor for moving tokens that are to the right on the same line
5656-
// and shifting their positions left 'n' spaces - used only at the
5657-
// end when lowering to Cpp1, as a convenient way to adjust for other
5658-
// positions shifts we create (e.g., moving some operators to prefix
5659-
// notation, or inserting "std::move" prefixes)
5660-
//
5661-
//-----------------------------------------------------------------------
5662-
//
5663-
class adjust_remaining_token_columns_on_this_line_visitor
5664-
{
5665-
source_position line_to_adjust_pos;
5666-
colno_t col_offset;
5667-
5668-
public:
5669-
adjust_remaining_token_columns_on_this_line_visitor(
5670-
source_position start_pos,
5671-
colno_t offset
5672-
)
5673-
: line_to_adjust_pos{start_pos}
5674-
, col_offset{offset}
5675-
{ }
5676-
5677-
auto start(token& n, int) -> void
5678-
{
5679-
if (
5680-
n.position().lineno == line_to_adjust_pos.lineno
5681-
&& n.position().colno >= line_to_adjust_pos.colno
5682-
)
5683-
{
5684-
n.position_col_shift(col_offset);
5685-
}
5686-
}
5687-
5688-
auto start(auto const&, int) -> void
5689-
{
5690-
// Ignore other node types
5691-
}
5692-
5693-
auto end(auto const&, int) -> void
5694-
{
5695-
// Ignore other node types
5696-
}
5697-
};
5698-
5699-
57005653
}
57015654

57025655
#endif

0 commit comments

Comments
 (0)