diff options
author | filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2004-03-01 08:46:47 +0000 |
---|---|---|
committer | filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2004-03-01 08:46:47 +0000 |
commit | a412c028eb7c8400e8c4f45058beafab1c08f84f (patch) | |
tree | 4441d9acd790f7d4854eb6a587984c68d03cec20 /tools/coqdoc/pretty.mll | |
parent | 186ab90bd0f68223f4490f5ebbf16c9d3ed90564 (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/coqdoc/pretty.mll')
-rw-r--r-- | tools/coqdoc/pretty.mll | 13 |
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; |