aboutsummaryrefslogtreecommitdiff
path: root/gramlib
diff options
context:
space:
mode:
Diffstat (limited to 'gramlib')
-rw-r--r--gramlib/grammar.ml5
-rw-r--r--gramlib/plexing.ml2
-rw-r--r--gramlib/plexing.mli3
-rw-r--r--gramlib/ploc.ml5
-rw-r--r--gramlib/ploc.mli3
5 files changed, 2 insertions, 16 deletions
diff --git a/gramlib/grammar.ml b/gramlib/grammar.ml
index 0ad11d075f..e959e9b9e6 100644
--- a/gramlib/grammar.ml
+++ b/gramlib/grammar.ml
@@ -663,13 +663,8 @@ let init_entry_functions entry =
entry.econtinue <- f; f lev bp a strm)
let extend_entry ~warning entry position rules =
- try
let elev = Gramext.levels_of_rules ~warning entry position rules in
entry.edesc <- Dlevels elev; init_entry_functions entry
- with Plexing.Error s ->
- Printf.eprintf "Lexer initialization error:\n- %s\n" s;
- flush stderr;
- failwith "Grammar.extend"
(* Deleting a rule *)
diff --git a/gramlib/plexing.ml b/gramlib/plexing.ml
index f99a3c2480..fce5445ad8 100644
--- a/gramlib/plexing.ml
+++ b/gramlib/plexing.ml
@@ -4,8 +4,6 @@
type pattern = string * string
-exception Error of string
-
type location_function = int -> Loc.t
type 'te lexer_func = char Stream.t -> 'te Stream.t * location_function
diff --git a/gramlib/plexing.mli b/gramlib/plexing.mli
index eed4082e00..6139dc4020 100644
--- a/gramlib/plexing.mli
+++ b/gramlib/plexing.mli
@@ -19,9 +19,6 @@ type pattern = string * string
- The way tokens patterns are interpreted to parse tokens is done
by the lexer, function [tok_match] below. *)
-exception Error of string
- (** A lexing error exception to be used by lexers. *)
-
(** Lexer type *)
type 'te lexer =
diff --git a/gramlib/ploc.ml b/gramlib/ploc.ml
index 9342fc6c1d..056a2b7ad3 100644
--- a/gramlib/ploc.ml
+++ b/gramlib/ploc.ml
@@ -6,17 +6,16 @@ open Loc
let make_unlined (bp, ep) =
{fname = InFile ""; line_nb = 1; bol_pos = 0; line_nb_last = -1; bol_pos_last = 0;
- bp = bp; ep = ep; comm = ""; ecomm = ""}
+ bp = bp; ep = ep; }
let dummy =
{fname = InFile ""; line_nb = 1; bol_pos = 0; line_nb_last = -1; bol_pos_last = 0;
- bp = 0; ep = 0; comm = ""; ecomm = ""}
+ bp = 0; ep = 0; }
(* *)
let sub loc sh len = {loc with bp = loc.bp + sh; ep = loc.bp + sh + len}
let after loc sh len = {loc with bp = loc.ep + sh; ep = loc.ep + sh + len}
-let with_comment loc comm = {loc with comm = comm}
exception Exc of Loc.t * exn
diff --git a/gramlib/ploc.mli b/gramlib/ploc.mli
index 100fbc7271..15a5a74455 100644
--- a/gramlib/ploc.mli
+++ b/gramlib/ploc.mli
@@ -35,6 +35,3 @@ val after : Loc.t -> int -> int -> Loc.t
(** [Ploc.after loc sh len] is the location just after loc (starting at
the end position of [loc]) shifted with [sh] characters and of length
[len]. *)
-
-val with_comment : Loc.t -> string -> Loc.t
- (** Change the comment part of the given location *)