Rename get_string to move_string to imply side-effect
This commit is contained in:
1 parent
e0d890cc23
commit
8665e25942
1 file changed
+4
-4
+4
-4
@@ -2702,8 +2702,8 @@ scan_number_done:
|
|||||||
return value_float;
|
return value_float;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// return string value
|
/// return current string value (implicitly resets the token; useful only once)
|
||||||
std::string get_string()
|
std::string move_string()
|
||||||
{
|
{
|
||||||
return std::move( yytext );
|
return std::move( yytext );
|
||||||
}
|
}
|
||||||
@@ -3004,7 +3004,7 @@ class parser
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
key = m_lexer.get_string();
|
key = m_lexer.move_string();
|
||||||
|
|
||||||
bool keep_tag = false;
|
bool keep_tag = false;
|
||||||
if (keep)
|
if (keep)
|
||||||
@@ -3142,7 +3142,7 @@ class parser
|
|||||||
case token_type::value_string:
|
case token_type::value_string:
|
||||||
{
|
{
|
||||||
result.m_type = value_t::string;
|
result.m_type = value_t::string;
|
||||||
result.m_value = m_lexer.get_string();
|
result.m_value = m_lexer.move_string();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user