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

JSSpecCompiler: Split Parser/SpecParser.cpp into 8 files

This SpecParser.cpp had an ever increasing number of lines and contained
an implementation of 8 different classes. So I figured out it's about
the time to split it.

No behavior change.
This commit is contained in:
Dan Klishch 2024-03-07 23:24:13 -05:00 committed by Andrew Kaster
parent b9cfb50f71
commit 7ea2138b6c
11 changed files with 606 additions and 513 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/OwnPtr.h>
#include <AK/TemporaryChange.h>
#include "AST/AST.h"
#include "CompilationPipeline.h"
@ -30,11 +31,21 @@ public:
DiagnosticEngine& diag();
template<typename Func>
auto with_new_logical_scope(Func&& func);
auto with_new_logical_scope(Func&& func)
{
TemporaryChange<RefPtr<LogicalLocation>> change(m_current_logical_scope, make_ref_counted<LogicalLocation>());
return func();
}
LogicalLocation& current_logical_scope();
template<typename Func>
auto with_new_step_list_nesting_level(Func&& func);
auto with_new_step_list_nesting_level(Func&& func)
{
TemporaryChange change(m_step_list_nesting_level, m_step_list_nesting_level + 1);
return func();
}
int step_list_nesting_level() const;
Location file_scope() const;