From ea9ccff8b51832dd7c1d9400d73e859f05806273 Mon Sep 17 00:00:00 2001 From: notin Date: Mon, 27 Mar 2006 17:02:49 +0000 Subject: Correction d'un bug dans Coqdoc (indentation & mots clés) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@8666 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/coqdoc/pretty.mll | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/coqdoc/pretty.mll b/tools/coqdoc/pretty.mll index 096e64a81..e9fd9c65e 100644 --- a/tools/coqdoc/pretty.mll +++ b/tools/coqdoc/pretty.mll @@ -325,17 +325,22 @@ rule coq_bol = parse skip_to_dot lexbuf; coq_bol lexbuf end else begin - indentation (count_spaces s); - ident s (lexeme_start lexbuf); - let eol= body lexbuf in - if eol then coq_bol lexbuf else coq lexbuf + let s = lexeme lexbuf in + let nbsp = count_spaces s in + indentation nbsp; + let s = String.sub s nbsp (String.length s - nbsp) in + ident s (lexeme_start lexbuf + nbsp); + let eol= body lexbuf in + if eol then coq_bol lexbuf else coq lexbuf end } | space* gallina_kw { let s = lexeme lexbuf in - indentation (count_spaces s); - ident s (lexeme_start lexbuf); - let eol= body lexbuf in - if eol then coq_bol lexbuf else coq lexbuf } + let nbsp = count_spaces s in + indentation nbsp; + let s = String.sub s nbsp (String.length s - nbsp) in + ident s (lexeme_start lexbuf + nbsp); + let eol= body lexbuf in + if eol then coq_bol lexbuf else coq lexbuf } | space* "(**" space+ "printing" space+ (identifier | token) space+ { let tok = lexeme lexbuf in let s = printing_token lexbuf in -- cgit v1.2.3