Fix maximal munch parsing issue

This commit is contained in:
Jonathan Müller 2017-04-11 19:15:44 +02:00
commit 1b57248fc8
2 changed files with 6 additions and 3 deletions

View file

@ -148,7 +148,8 @@ namespace
{
auto iter = detail::find_closing_bracket(stream);
scope += detail::to_string(stream, iter);
detail::skip(stream, ">");
if (!detail::skip_if(stream, ">>"))
detail::skip(stream, ">");
scope += ">";
}
else

View file

@ -292,8 +292,10 @@ detail::token_iterator detail::find_closing_bracket(detail::token_stream stream)
--paren_count;
}
stream.bump_back();
DEBUG_ASSERT(paren_count == 0 && stream.peek().value() == close_bracket, parse_error_handler{},
stream.cursor(), "find_closing_bracket() internal parse error");
// only check first parameter, token might be ">>"
DEBUG_ASSERT(paren_count == 0 && stream.peek().value()[0] == close_bracket[0],
parse_error_handler{}, stream.cursor(),
"find_closing_bracket() internal parse error");
return stream.cur();
}