summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/ParserError.h
blob: 0d6b43c5cb65aff48c8b3620e843fe340149685b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
};

}