Skip to content

Commit

Permalink
Add 'std::' in several places as suggested by clang
Browse files Browse the repository at this point in the history
  • Loading branch information
mingodad authored and Charles Baker committed Jul 15, 2023
1 parent aeacb29 commit 4aca034
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/lalr/Grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ GrammarSymbol* Grammar::add_symbol( const char* lexeme, int line, LexemeType lex
symbol->set_line( line );
symbol->set_lexeme_type( lexeme_type );
symbol->set_symbol_type( symbol_type );
symbols_.push_back( move(symbol) );
symbols_.push_back( std::move(symbol) );
return symbols_.back().get();
}

Expand All @@ -389,12 +389,12 @@ GrammarProduction* Grammar::add_production( GrammarSymbol* symbol, int line )
unique_ptr<GrammarProduction> production( new GrammarProduction(int(productions_.size()), start_symbol_, 0, 0, NULL) );
production->append_symbol( symbol );
start_symbol_->append_production( production.get() );
productions_.push_back( move(production) );
productions_.push_back( std::move(production) );
}

unique_ptr<GrammarProduction> production( new GrammarProduction(int(productions_.size()), symbol, line, -1, nullptr) );
symbol->append_production( production.get() );
productions_.push_back( move(production) );
productions_.push_back( std::move(production) );
return productions_.back().get();
}

Expand All @@ -410,7 +410,7 @@ GrammarAction* Grammar::add_action( const char* identifier )
{
int index = int(actions_.size());
unique_ptr<GrammarAction> action( new GrammarAction(index, identifier) );
actions_.push_back( move(action) );
actions_.push_back( std::move(action) );
return actions_.back().get();
}
return i->get();
Expand Down
8 changes: 4 additions & 4 deletions src/lalr/GrammarCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void GrammarCompiler::set_actions( std::unique_ptr<ParserAction[]>& actions, int
LALR_ASSERT( parser_state_machine_ );
LALR_ASSERT( actions || actions_size == 0 );
LALR_ASSERT( actions_size >= 0 );
actions_ = move( actions );
actions_ = std::move( actions );
parser_state_machine_->actions_size = actions_size;
parser_state_machine_->actions = actions_.get();
}
Expand All @@ -159,7 +159,7 @@ void GrammarCompiler::set_symbols( std::unique_ptr<ParserSymbol[]>& symbols, int
LALR_ASSERT( parser_state_machine_ );
LALR_ASSERT( symbols );
LALR_ASSERT( symbols_size >= 3 );
symbols_ = move( symbols );
symbols_ = std::move( symbols );
parser_state_machine_->symbols_size = symbols_size;
parser_state_machine_->symbols = symbols_.get();
parser_state_machine_->start_symbol = &symbols_[0];
Expand All @@ -172,7 +172,7 @@ void GrammarCompiler::set_transitions( std::unique_ptr<ParserTransition[]>& tran
{
LALR_ASSERT( transitions );
LALR_ASSERT( transitions_size >= 0 );
transitions_ = move( transitions );
transitions_ = std::move( transitions );
parser_state_machine_->transitions_size = transitions_size;
parser_state_machine_->transitions = transitions_.get();
}
Expand All @@ -182,7 +182,7 @@ void GrammarCompiler::set_states( std::unique_ptr<ParserState[]>& states, int st
LALR_ASSERT( states );
LALR_ASSERT( states_size >= 0 );
LALR_ASSERT( start_state );
states_ = move( states );
states_ = std::move( states );
parser_state_machine_->states_size = states_size;
parser_state_machine_->states = states_.get();
parser_state_machine_->start_state = start_state;
Expand Down
8 changes: 4 additions & 4 deletions src/lalr/RegexCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RegexCompiler::RegexCompiler()
, actions_()
, transitions_()
, states_()
, state_machine_()
, state_machine_()
{
}

Expand Down Expand Up @@ -64,21 +64,21 @@ const char* RegexCompiler::add_string( const std::string& string )

void RegexCompiler::set_actions( std::unique_ptr<LexerAction[]>& actions, int actions_size )
{
actions_ = move( actions );
actions_ = std::move( actions );
state_machine_->actions_size = actions_size;
state_machine_->actions = actions_.get();
}

void RegexCompiler::set_transitions( std::unique_ptr<LexerTransition[]>& transitions, int transitions_size )
{
transitions_ = move( transitions );
transitions_ = std::move( transitions );
state_machine_->transitions_size = transitions_size;
state_machine_->transitions = transitions_.get();
}

void RegexCompiler::set_states( std::unique_ptr<LexerState[]>& states, int states_size, const LexerState* start_state )
{
states_ = move( states );
states_ = std::move( states );
state_machine_->states_size = states_size;
state_machine_->states = states_.get();
state_machine_->start_state = start_state;
Expand Down
6 changes: 3 additions & 3 deletions src/lalr/RegexGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const RegexAction* RegexGenerator::add_lexer_action( const std::string& identifi
if ( i == actions_.end() )
{
unique_ptr<RegexAction> action( new RegexAction(int(actions_.size()), identifier) );
actions_.push_back( move(action) );
actions_.push_back( std::move(action) );
i = actions_.end() - 1;
}
return i->get();
Expand Down Expand Up @@ -241,7 +241,7 @@ void RegexGenerator::generate_states( const RegexSyntaxTree& syntax_tree )
state->add_item( syntax_tree.node()->get_first_positions() );
generate_symbol_for_state( state.get() );
start_state_ = state.get();
states_.insert( move(state) );
states_.insert( std::move(state) );

vector<RegexState*> next_states;
vector<RegexState*> states;
Expand Down Expand Up @@ -287,7 +287,7 @@ void RegexGenerator::generate_states( const RegexSyntaxTree& syntax_tree )
state->add_transition( begin, end, goto_state.get() );
generate_symbol_for_state( goto_state.get() );
next_states.push_back(goto_state.get() );
states_.insert( move(goto_state) );
states_.insert( std::move(goto_state) );
}
else
{
Expand Down

0 comments on commit 4aca034

Please sign in to comment.