diff --git a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/AST/AST.h b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/AST/AST.h index 27841c64ac..2ae3026af5 100644 --- a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/AST/AST.h +++ b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/AST/AST.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -27,9 +28,9 @@ public: { } - Tree& get() { return *m_tree_ptr; } + Tree& get(Badge) { return *m_tree_ptr; } - void replace_subtree(Tree tree) { *m_tree_ptr = move(tree); } + void replace_subtree(Badge, Tree tree) { *m_tree_ptr = move(tree); } private: Tree* m_tree_ptr; diff --git a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Compiler/GenericASTPass.cpp b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Compiler/GenericASTPass.cpp index aae5168488..f37dd23a6b 100644 --- a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Compiler/GenericASTPass.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Compiler/GenericASTPass.cpp @@ -18,7 +18,7 @@ void RecursiveASTVisitor::run_in_subtree(Tree& tree) void RecursiveASTVisitor::replace_current_node_with(Tree tree) { - m_current_subtree_pointer->replace_subtree(move(tree)); + m_current_subtree_pointer->replace_subtree({}, move(tree)); } RecursionDecision RecursiveASTVisitor::recurse(Tree root, NodeSubtreePointer& pointer) @@ -30,7 +30,7 @@ RecursionDecision RecursiveASTVisitor::recurse(Tree root, NodeSubtreePointer& po if (decision == RecursionDecision::Recurse) { for (auto& child : root->subtrees()) { - if (recurse(child.get(), child) == RecursionDecision::Break) + if (recurse(child.get({}), child) == RecursionDecision::Break) return RecursionDecision::Break; } } diff --git a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Forward.h b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Forward.h index a6cd0f0e6b..7ffdb27aa7 100644 --- a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Forward.h +++ b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Forward.h @@ -37,6 +37,9 @@ class Variable; class FunctionPointer; using FunctionPointerRef = NonnullRefPtr; +// Compiler/GenericASTPass.h +class RecursiveASTVisitor; + // Parser/SpecParser.h class AlgorithmStep; class AlgorithmStepList;