1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-01 08:23:05 +03:00

Do not allow whitespaces as % string delimiters

This commit is contained in:
Maxime Coste 2017-06-07 13:09:45 +01:00
parent 81118552c8
commit a0d848da8d

View File

@ -210,11 +210,13 @@ Token parse_percent_token(Reader& reader)
++reader;
StringView type_name = reader.substr_from(type_start);
if (throw_on_unterminated and not reader)
throw parse_error{format("expected a string delimiter after '%{}'",
type_name)};
else if (not reader)
if (not reader or is_blank(*reader))
{
if (throw_on_unterminated)
throw parse_error{format("expected a string delimiter after '%{}'",
type_name)};
return {};
}
Token::Type type = token_type<throw_on_unterminated>(type_name);