From 648c594489f8d0ffdde9596b87f5c1ff6ccef612 Mon Sep 17 00:00:00 2001 From: letouzey Date: Mon, 18 Feb 2013 13:57:09 +0000 Subject: Minor code cleanups, especially take advantage of Dir_path.is_empty git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16210 85f007b7-540e-0410-9357-904b9bb8a0f7 --- plugins/syntax/ascii_syntax.ml | 2 +- plugins/syntax/numbers_syntax.ml | 11 ++++++----- plugins/syntax/r_syntax.ml | 2 +- plugins/syntax/z_syntax.ml | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'plugins/syntax') diff --git a/plugins/syntax/ascii_syntax.ml b/plugins/syntax/ascii_syntax.ml index 601a4ffd1..fc64da58e 100644 --- a/plugins/syntax/ascii_syntax.ml +++ b/plugins/syntax/ascii_syntax.ml @@ -16,7 +16,7 @@ open Coqlib exception Non_closed_ascii -let make_dir l = Dir_path.make (List.map Id.of_string (List.rev l)) +let make_dir l = Dir_path.make (List.rev_map Id.of_string l) let make_kn dir id = Globnames.encode_mind (make_dir dir) (Id.of_string id) let make_path dir id = Libnames.make_path (make_dir dir) (Id.of_string id) diff --git a/plugins/syntax/numbers_syntax.ml b/plugins/syntax/numbers_syntax.ml index 643dacbab..ef4636699 100644 --- a/plugins/syntax/numbers_syntax.ml +++ b/plugins/syntax/numbers_syntax.ml @@ -9,18 +9,19 @@ (* digit-based syntax for int31, bigN bigZ and bigQ *) open Bigint +open Names open Globnames open Glob_term (*** Constants for locating int31 / bigN / bigZ / bigQ constructors ***) -let make_dir l = Names.Dir_path.make (List.map Names.Id.of_string (List.rev l)) -let make_path dir id = Libnames.make_path (make_dir dir) (Names.Id.of_string id) +let make_dir l = Dir_path.make (List.rev_map Id.of_string l) +let make_path dir id = Libnames.make_path (make_dir dir) (Id.of_string id) -let make_mind mp id = Names.make_mind mp Names.Dir_path.empty (Names.Label.make id) -let make_mind_mpfile dir id = make_mind (Names.MPfile (make_dir dir)) id +let make_mind mp id = Names.make_mind mp Dir_path.empty (Label.make id) +let make_mind_mpfile dir id = make_mind (MPfile (make_dir dir)) id let make_mind_mpdot dir modname id = - let mp = Names.MPdot (Names.MPfile (make_dir dir), Names.Label.make modname) + let mp = MPdot (MPfile (make_dir dir), Label.make modname) in make_mind mp id diff --git a/plugins/syntax/r_syntax.ml b/plugins/syntax/r_syntax.ml index d84fad6ff..055b99adc 100644 --- a/plugins/syntax/r_syntax.ml +++ b/plugins/syntax/r_syntax.ml @@ -19,7 +19,7 @@ exception Non_closed_number open Glob_term open Bigint -let make_dir l = Dir_path.make (List.map Id.of_string (List.rev l)) +let make_dir l = Dir_path.make (List.rev_map Id.of_string l) let rdefinitions = make_dir ["Coq";"Reals";"Rdefinitions"] let make_path dir id = Libnames.make_path dir (Id.of_string id) diff --git a/plugins/syntax/z_syntax.ml b/plugins/syntax/z_syntax.ml index d583f44cb..ca02f61b7 100644 --- a/plugins/syntax/z_syntax.ml +++ b/plugins/syntax/z_syntax.ml @@ -23,7 +23,7 @@ open Glob_term let binnums = ["Coq";"Numbers";"BinNums"] -let make_dir l = Dir_path.make (List.map Id.of_string (List.rev l)) +let make_dir l = Dir_path.make (List.rev_map Id.of_string l) let make_path dir id = Libnames.make_path (make_dir dir) (Id.of_string id) let positive_path = make_path binnums "positive" -- cgit v1.2.3