Skip to content

Commit

Permalink
Rename get_string to move_string to imply side-effect
Browse files Browse the repository at this point in the history
  • Loading branch information
pjkundert committed Oct 5, 2017
1 parent e0d890c commit 8665e25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2702,8 +2702,8 @@ class lexer
return value_float;
}

/// return string value
std::string get_string()
/// return current string value (implicitly resets the token; useful only once)
std::string move_string()
{
return std::move( yytext );
}
Expand Down Expand Up @@ -3004,7 +3004,7 @@ class parser
{
return;
}
key = m_lexer.get_string();
key = m_lexer.move_string();

bool keep_tag = false;
if (keep)
Expand Down Expand Up @@ -3142,7 +3142,7 @@ class parser
case token_type::value_string:
{
result.m_type = value_t::string;
result.m_value = m_lexer.get_string();
result.m_value = m_lexer.move_string();
break;
}

Expand Down

0 comments on commit 8665e25

Please sign in to comment.