From cc40c18845dcd9b0bc3264b82940091b26ca53ff Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Mon, 7 Apr 2003 15:57:50 +0000 Subject: [PATCH] moved "is_blank_line" from Http_getter_common to Http_getter_misc --- helm/http_getter/http_getter_common.ml | 5 ----- helm/http_getter/http_getter_common.mli | 3 --- helm/http_getter/http_getter_misc.ml | 6 ++++++ helm/http_getter/http_getter_misc.mli | 3 +++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/helm/http_getter/http_getter_common.ml b/helm/http_getter/http_getter_common.ml index 636bbe5a7..ad549330b 100644 --- a/helm/http_getter/http_getter_common.ml +++ b/helm/http_getter/http_getter_common.ml @@ -41,11 +41,6 @@ let is_nuprl_uri uri = Pcre.pmatch ~pat:"^nuprl:" uri let is_rdf_uri uri = Pcre.pmatch ~pat:"^helm:rdf(.*):(.*)//(.*)" uri let is_xsl_uri uri = Pcre.pmatch ~pat:"^\\w+\\.xsl" uri -let is_blank_line = - let blank_line_RE = Pcre.regexp "(^#)|(^\\s*$)" in - fun line -> - Pcre.pmatch ~rex:blank_line_RE line - let rec http_getter_uri_of_string = function | uri when is_rdf_uri uri -> (match Pcre.split ~pat:"//" uri with diff --git a/helm/http_getter/http_getter_common.mli b/helm/http_getter/http_getter_common.mli index 09d45f182..236644452 100644 --- a/helm/http_getter/http_getter_common.mli +++ b/helm/http_getter/http_getter_common.mli @@ -36,9 +36,6 @@ val is_nuprl_uri: string -> bool val is_rdf_uri: string -> bool val is_xsl_uri: string -> bool - (** true on blanks-only and #-commented lines, false otherwise *) -val is_blank_line: string -> bool - val http_getter_uri_of_string: string -> http_getter_uri val patch_xml : string -> string diff --git a/helm/http_getter/http_getter_misc.ml b/helm/http_getter/http_getter_misc.ml index 9ab708297..7b70a14b1 100644 --- a/helm/http_getter/http_getter_misc.ml +++ b/helm/http_getter/http_getter_misc.ml @@ -273,3 +273,9 @@ let remove_line ~fname position = remove position ([], lines)) ;; +let is_blank_line = + let blank_line_RE = Pcre.regexp "(^#)|(^\\s*$)" in + fun line -> + Pcre.pmatch ~rex:blank_line_RE line +;; + diff --git a/helm/http_getter/http_getter_misc.mli b/helm/http_getter/http_getter_misc.mli index c6e2e72c6..0551161b9 100644 --- a/helm/http_getter/http_getter_misc.mli +++ b/helm/http_getter/http_getter_misc.mli @@ -80,3 +80,6 @@ val add_line: fname:string -> ?position:int -> string -> unit first line of file is line 0) *) val remove_line: fname:string -> int -> unit + (** true on blanks-only and #-commented lines, false otherwise *) +val is_blank_line: string -> bool + -- 2.39.2