1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

JSSpecCompiler: Ignore notes in algorithm steps

This commit is contained in:
Dan Klishch 2024-01-23 18:33:31 -05:00 committed by Andrew Kaster
parent ba61b61d67
commit f7c952f842
6 changed files with 30 additions and 8 deletions

View file

@ -598,10 +598,16 @@ TextParseErrorOr<Tree> TextParser::parse_else(Tree else_branch)
}
// <simple_step> | <inline_if>
TextParseErrorOr<Tree> TextParser::parse_step_without_substeps()
TextParseErrorOr<NullableTree> TextParser::parse_step_without_substeps()
{
auto rollback = rollback_point();
// NOTE: ...
if (auto result = consume_word("NOTE:"sv); !result.is_error()) {
rollback.disarm();
return nullptr;
}
// <simple_step>
if (auto result = parse_simple_step_or_inline_if_branch(); !result.is_error()) {
rollback.disarm();