From 19474f4c1db0cdb46d1e6d6ae8cafeda6d831ed5 Mon Sep 17 00:00:00 2001 From: Julien Lopez Date: Fri, 20 Jun 2014 10:15:41 +0200 Subject: [PATCH] Fix on parsing of type variables in brackets --- parser/ulexer.ml | 2 +- schema/schema_builtin.ml | 2 -- schema/schema_pcre.ml | 2 -- schema/schema_pcre.mli | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/parser/ulexer.ml b/parser/ulexer.ml index de509439..6fdd0870 100644 --- a/parser/ulexer.ml +++ b/parser/ulexer.ml @@ -279,7 +279,7 @@ and token2 = lexer return lexbuf (STRING2 s) | "('" qname ")" -> let s = L.utf8_lexeme lexbuf in - let s = String.sub s 1 (String.length s - 1) in + let s = String.sub s 2 (String.length s - 3) in return lexbuf (PTYPE s) | "(*" -> in_comment := true; diff --git a/schema/schema_builtin.ml b/schema/schema_builtin.ml index 6058d96b..1c45a474 100644 --- a/schema/schema_builtin.ml +++ b/schema/schema_builtin.ml @@ -5,8 +5,6 @@ open Schema_pcre open Schema_common open Schema_types -module Pcre = Re_pcre - (* TODO dates: boundary checks (e.g. 95/26/2003) *) (* TODO a lot of almost cut-and-paste code, expecially in gFoo types validation *) diff --git a/schema/schema_pcre.ml b/schema/schema_pcre.ml index c56e90cd..a3420d15 100644 --- a/schema/schema_pcre.ml +++ b/schema/schema_pcre.ml @@ -1,7 +1,5 @@ open Encodings.Utf8 -module Pcre = Re_pcre - let pcre_replace ~rex ?templ s = match templ with | None -> mk (Pcre.replace ~rex (get_str s)) diff --git a/schema/schema_pcre.mli b/schema/schema_pcre.mli index 510ec65f..d85d5f22 100644 --- a/schema/schema_pcre.mli +++ b/schema/schema_pcre.mli @@ -2,7 +2,6 @@ * Given Pcre.regexp regular expressions should be compiled with `UTF8 flag * or with pcre_regexp below *) open Encodings.Utf8 -module Pcre = Re_pcre val pcre_regexp: string -> Pcre.regexp (* compile using `UTF8 flag *) val pcre_replace: rex:Pcre.regexp -> ?templ:t -> t -> t val pcre_extract: rex:Pcre.regexp -> t -> t array -- GitLab