mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-21 02:22:51 +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:
parent
b9cfb50f71
commit
7ea2138b6c
Notes:
sideshowbarker
2024-07-17 09:41:18 +09:00
Author: https://github.com/DanShaders
Commit: 7ea2138b6c
Pull-request: https://github.com/SerenityOS/serenity/pull/23522
Reviewed-by: https://github.com/ADKaster ✅
11 changed files with 606 additions and 513 deletions
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2023-2024, Dan Klishch <danilklishch@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "Parser/SpecParser.h"
|
||||
|
||||
namespace JSSpecCompiler {
|
||||
|
||||
TranslationUnitRef SpecificationParsingContext::translation_unit()
|
||||
{
|
||||
return m_translation_unit;
|
||||
}
|
||||
|
||||
DiagnosticEngine& SpecificationParsingContext::diag()
|
||||
{
|
||||
return m_translation_unit->diag();
|
||||
}
|
||||
|
||||
LogicalLocation& SpecificationParsingContext::current_logical_scope()
|
||||
{
|
||||
return *m_current_logical_scope;
|
||||
}
|
||||
|
||||
int SpecificationParsingContext::step_list_nesting_level() const
|
||||
{
|
||||
return m_step_list_nesting_level;
|
||||
}
|
||||
|
||||
Location SpecificationParsingContext::file_scope() const
|
||||
{
|
||||
return { .filename = m_translation_unit->filename() };
|
||||
}
|
||||
|
||||
Location SpecificationParsingContext::location_from_xml_offset(LineTrackingLexer::Position position) const
|
||||
{
|
||||
return {
|
||||
.filename = m_translation_unit->filename(),
|
||||
.line = position.line,
|
||||
.column = position.column,
|
||||
.logical_location = m_current_logical_scope,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue