ParserError.h 520 B

123456789101112131415161718192021222324
  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. #pragma once
  8. #include <AK/Optional.h>
  9. #include <AK/String.h>
  10. #include <LibJS/SourceRange.h>
  11. namespace JS {
  12. struct ParserError {
  13. String message;
  14. Optional<Position> position;
  15. String to_string() const;
  16. String source_location_hint(StringView source, char const spacer = ' ', char const indicator = '^') const;
  17. };
  18. }