2022-11-23 12:39:23 +01:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
#include <AK/DeprecatedString.h>
|
2023-02-16 11:03:49 -05:00
|
|
|
#include <AK/Error.h>
|
2022-11-23 12:39:23 +01:00
|
|
|
#include <AK/Optional.h>
|
2023-02-16 11:03:49 -05:00
|
|
|
#include <AK/String.h>
|
2022-11-23 12:39:23 +01:00
|
|
|
#include <LibJS/SourceRange.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
struct ParserError {
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString message;
|
2022-11-23 12:39:23 +01:00
|
|
|
Optional<Position> position;
|
|
|
|
|
2023-02-16 11:03:49 -05:00
|
|
|
ErrorOr<String> to_string() const;
|
2022-12-06 01:12:49 +00:00
|
|
|
DeprecatedString to_deprecated_string() const;
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString source_location_hint(StringView source, char const spacer = ' ', char const indicator = '^') const;
|
2022-11-23 12:39:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|