Skip to content

Commit

Permalink
Remove unused parsing code
Browse files Browse the repository at this point in the history
  • Loading branch information
jfehrle committed Nov 22, 2020
1 parent 9c84110 commit 2ca8fd3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
24 changes: 1 addition & 23 deletions parsing/pcoq.ml
Expand Up @@ -175,28 +175,7 @@ let rec remove_grammars n =
camlp5_entries := EntryDataMap.add tag (EntryData.Ex entries) !camlp5_entries;
remove_grammars (n - 1)

let make_rule r = [None, None, r]

(** An entry that checks we reached the end of the input. *)

let eoi_entry en =
let e = Entry.make ((Entry.name en) ^ "_eoi") in
let symbs = Rule.next (Rule.next Rule.stop (Symbol.nterm en)) (Symbol.token Tok.PEOI) in
let act = fun _ x loc -> x in
let ext = { pos = None; data = make_rule [Production.make symbs act] } in
safe_extend e ext;
e

let map_entry f en =
let e = Entry.make ((Entry.name en) ^ "_map") in
let symbs = Rule.next Rule.stop (Symbol.nterm en) in
let act = fun x loc -> f x in
let ext = { pos = None; data = make_rule [Production.make symbs act] } in
safe_extend e ext;
e

(* Parse a string, does NOT check if the entire string was read
(use eoi_entry) *)
(* Parse a string, does NOT check if the entire string was read *)

let parse_string f ?loc x =
let strm = Stream.of_string x in
Expand Down Expand Up @@ -310,7 +289,6 @@ module Constr =
let constr = Entry.create "constr"
let term = Entry.create "term"
let operconstr = term
let constr_eoi = eoi_entry constr
let lconstr = Entry.create "lconstr"
let binder_constr = Entry.create "binder_constr"
let ident = Entry.create "ident"
Expand Down
3 changes: 0 additions & 3 deletions parsing/pcoq.mli
Expand Up @@ -120,8 +120,6 @@ end
(** Parse a string *)

val parse_string : 'a Entry.t -> ?loc:Loc.t -> string -> 'a
val eoi_entry : 'a Entry.t -> 'a Entry.t
val map_entry : ('a -> 'b) -> 'a Entry.t -> 'b Entry.t

type gram_universe [@@deprecated "Deprecated in 8.13"]
[@@@ocaml.warning "-3"]
Expand Down Expand Up @@ -182,7 +180,6 @@ module Prim :
module Constr :
sig
val constr : constr_expr Entry.t
val constr_eoi : constr_expr Entry.t
val lconstr : constr_expr Entry.t
val binder_constr : constr_expr Entry.t
val term : constr_expr Entry.t
Expand Down
2 changes: 0 additions & 2 deletions plugins/ltac/pltac.ml
Expand Up @@ -46,8 +46,6 @@ let binder_tactic = Entry.create "binder_tactic"
let tactic = Entry.create "tactic"

(* Main entry for quotations *)
let tactic_eoi = eoi_entry tactic

let () =
let open Stdarg in
let open Tacarg in
Expand Down
1 change: 0 additions & 1 deletion plugins/ltac/pltac.mli
Expand Up @@ -39,4 +39,3 @@ val tactic_expr : raw_tactic_expr Entry.t
[@@deprecated "Deprecated in 8.13; use 'ltac_expr' instead"]
val binder_tactic : raw_tactic_expr Entry.t
val tactic : raw_tactic_expr Entry.t
val tactic_eoi : raw_tactic_expr Entry.t

0 comments on commit 2ca8fd3

Please sign in to comment.