Serenity Operating System
1/*
2 * Copyright (c) 2020, Stephan Unverwerth <s.unverwerth@serenityos.org>
3 * Copyright (c) 2021-2022, David Tuin <davidot@serenityos.org>
4 *
5 * SPDX-License-Identifier: BSD-2-Clause
6 */
7
8#pragma once
9
10#include <AK/DeprecatedString.h>
11#include <AK/Error.h>
12#include <AK/Optional.h>
13#include <AK/String.h>
14#include <LibJS/SourceRange.h>
15
16namespace JS {
17
18struct ParserError {
19 DeprecatedString message;
20 Optional<Position> position;
21
22 ErrorOr<String> to_string() const;
23 DeprecatedString to_deprecated_string() const;
24 DeprecatedString source_location_hint(StringView source, char const spacer = ' ', char const indicator = '^') const;
25};
26
27}