From a412c028eb7c8400e8c4f45058beafab1c08f84f Mon Sep 17 00:00:00 2001 From: filliatr Date: Mon, 1 Mar 2004 08:46:47 +0000 Subject: ocaml 3.07 -> 3.06 git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5402 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/coqdoc/pretty.mll | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/coqdoc/pretty.mll b/tools/coqdoc/pretty.mll index 983baa596f..935b3500ba 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; -- cgit v1.2.3