aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>2004-03-01 08:46:47 +0000
committerGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>2004-03-01 08:46:47 +0000
commita412c028eb7c8400e8c4f45058beafab1c08f84f (patch)
tree4441d9acd790f7d4854eb6a587984c68d03cec20 /tools
parent186ab90bd0f68223f4490f5ebbf16c9d3ed90564 (diff)
ocaml 3.07 -> 3.06
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5402 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tools')
-rw-r--r--tools/coqdoc/pretty.mll13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/coqdoc/pretty.mll b/tools/coqdoc/pretty.mll
index 983baa596..935b3500b 100644
--- a/tools/coqdoc/pretty.mll
+++ b/tools/coqdoc/pretty.mll
@@ -180,6 +180,14 @@
with _ ->
()
+ let extract_ident_re = Str.regexp "([ \t]*\\([^ \t]+\\)[ \t]*:="
+ let extract_ident s =
+ assert (String.length s >= 3);
+ if Str.string_match extract_ident_re s 0 then
+ Str.matched_group 1 s
+ else
+ String.sub s 1 (String.length s - 3)
+
}
(*s Regular expressions *)
@@ -330,8 +338,9 @@ and coq = parse
{ let s = lexeme lexbuf in
if !gallina then gallina_id s;
ident s (lexeme_start lexbuf); coq lexbuf }
- | "(" space* (identifier as id) space* ":="
- { symbol "("; ident id (lexeme_start lexbuf); symbol ":="; coq lexbuf }
+ | "(" space* identifier space* ":="
+ { let id = extract_ident (lexeme lexbuf) in
+ symbol "("; ident id (lexeme_start lexbuf); symbol ":="; coq lexbuf }
| (identifier '.')* identifier
{ let id = lexeme lexbuf in
if !gallina then gallina_id id;