1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:37:43 +00:00

Shell: Avoid position push/pop when checking for next_is()

This operation is not a rule and cannot produce nodes.
This commit is contained in:
Ali Mohammad Pur 2021-04-29 07:00:52 +04:30 committed by Andreas Kling
parent 0d742557c6
commit cf4935e806

View file

@ -1867,9 +1867,9 @@ StringView Parser::consume_while(Function<bool(char)> condition)
bool Parser::next_is(const StringView& next) bool Parser::next_is(const StringView& next)
{ {
auto start = push_start(); auto start = current_position();
auto res = expect(next); auto res = expect(next);
restore_to(*start); restore_to(start.offset, start.line);
return res; return res;
} }