1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 03:55:06 +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

@ -97,7 +97,7 @@ bool AlgorithmStep::parse()
{
TextParser parser(m_ctx, m_tokens, m_node);
TextParseErrorOr<Tree> parse_result = TextParseError {};
TextParseErrorOr<NullableTree> parse_result = TextParseError {};
if (m_substeps)
parse_result = parser.parse_step_with_substeps(RefPtr(m_substeps).release_nonnull());
else
@ -133,10 +133,12 @@ Optional<AlgorithmStepList> AlgorithmStepList::create(SpecificationParsingContex
update_logical_scope_for_step(ctx, parent_scope, step_number);
return AlgorithmStep::create(ctx, child);
});
if (!step_creation_result.has_value())
if (!step_creation_result.has_value()) {
all_steps_parsed = false;
else
step_expressions.append(step_creation_result.release_value().tree());
} else {
if (auto expression = step_creation_result.release_value().tree())
step_expressions.append(expression.release_nonnull());
}
++step_number;
return;
}