mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 21:28:40 +00:00
Shell: Add runtime errors and implement break/continue
Such errors are raised when SyntaxError nodes are executed, and are also used for internal control flow. The 'break' and 'continue' commands are currently only allowed inside for loops, and outside function bodies. This also adds a 'loop' keyword for infinite loops.
This commit is contained in:
committed by
Andreas Kling
parent
9bd81f34a5
commit
5e5eb615ec
@@ -190,6 +190,13 @@ private:
|
||||
auto& span = span_for_node(node);
|
||||
span.color = m_palette.syntax_comment();
|
||||
}
|
||||
virtual void visit(const AST::ContinuationControl* node) override
|
||||
{
|
||||
NodeVisitor::visit(node);
|
||||
|
||||
auto& span = span_for_node(node);
|
||||
span.color = m_palette.syntax_control_keyword();
|
||||
}
|
||||
virtual void visit(const AST::DynamicEvaluate* node) override
|
||||
{
|
||||
NodeVisitor::visit(node);
|
||||
|
||||
Reference in New Issue
Block a user