Use unescape rather than a regex in command manager parsing

This commit is contained in:
Maxime Coste 2014-11-04 13:35:54 +00:00
parent 97df59ddb7
commit 60c1bb1315

View File

@ -254,10 +254,10 @@ TokenList parse(StringView line)
++pos; ++pos;
if (start_pos != pos) if (start_pos != pos)
{ {
String token = line.substr(token_start, pos - token_start); result.emplace_back(
static const Regex regex{R"(\\([ \t;\n]))"}; Token::Type::Raw, token_start, pos,
result.emplace_back(Token::Type::Raw, token_start, pos, unescape(line.substr(token_start, pos - token_start),
regex_replace(token, regex, "\\1")); " \t;\n", '\\'));
} }
} }