JSSpecCompiler: Allow storing error text in ErrorNode
This will be the main way to communicate errors from compilation passes.
This commit is contained in:
parent
72794e7843
commit
4eede5282c
Notes:
sideshowbarker
2024-07-17 02:05:41 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/4eede5282c Pull-request: https://github.com/SerenityOS/serenity/pull/20917
2 changed files with 7 additions and 2 deletions
Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/AST
|
@ -57,7 +57,12 @@ protected:
|
|||
|
||||
class ErrorNode : public Node {
|
||||
public:
|
||||
ErrorNode() { }
|
||||
ErrorNode(StringView error = ""sv)
|
||||
: m_error(error)
|
||||
{
|
||||
}
|
||||
|
||||
StringView m_error;
|
||||
|
||||
protected:
|
||||
void dump_tree(StringBuilder& builder) override;
|
||||
|
|
|
@ -31,7 +31,7 @@ void Node::dump_node(StringBuilder& builder, AK::CheckedFormatString<Parameters.
|
|||
|
||||
void ErrorNode::dump_tree(StringBuilder& builder)
|
||||
{
|
||||
dump_node(builder, "Error");
|
||||
dump_node(builder, "Error \"{}\"", m_error);
|
||||
}
|
||||
|
||||
void MathematicalConstant::dump_tree(StringBuilder& builder)
|
||||
|
|
Loading…
Add table
Reference in a new issue