-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser_errors.ml
More file actions
18 lines (14 loc) · 893 Bytes
/
Copy pathparser_errors.ml
File metadata and controls
18 lines (14 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(* SPDX-License-Identifier: MPL-2.0 *)
(* SPDX-FileCopyrightText: 2024-2026 Jonathan D.A. Jewell (hyperpolymath) *)
(** Shared exceptions for parser semantic actions.
This module exists because exceptions defined in the [%{ %}] prologue
of [parser.mly] are not exported through [parser.mli], so consumers
(notably [parse_driver.ml]) cannot pattern-match on them. Defining the
exception here lets both [parser.mly] and [parse_driver.ml] reference
it without a circular dependency. *)
(** Raised by a parser semantic action when a syntactically valid form
carries a value the action rejects (e.g. a quantity literal that is
neither 0 nor 1, an unknown [@]-attribute name).
Caught by [Parse_driver] and translated to its [Parse_error]
exception with proper [Span.t] resolution. *)
exception Parse_action_error of string * Lexing.position * Lexing.position