mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
LibJS: Make Parser::Error a standalone ParserError class
This allows us to forward declare it and reduce the number of things that need to include Parser.h.
This commit is contained in:
parent
e0916dbb35
commit
e6331031c4
11 changed files with 74 additions and 36 deletions
24
Userland/Libraries/LibJS/ParserError.h
Normal file
24
Userland/Libraries/LibJS/ParserError.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
* Copyright (c) 2021-2022, David Tuin <davidot@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/SourceRange.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
struct ParserError {
|
||||
String message;
|
||||
Optional<Position> position;
|
||||
|
||||
String to_string() const;
|
||||
String source_location_hint(StringView source, char const spacer = ' ', char const indicator = '^') const;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue