From 3432aa39554502152abd397959f021e168720dca Mon Sep 17 00:00:00 2001 From: msozeau Date: Tue, 24 Mar 2009 20:02:25 +0000 Subject: Fix coqdoc bugs reported by Ian Lynagh. - Add coqdoccomment LaTeX environment to sty file - Fix buggy parsing in comments git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12013 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/coqdoc/coqdoc.sty | 3 +++ tools/coqdoc/cpretty.mll | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/coqdoc/coqdoc.sty b/tools/coqdoc/coqdoc.sty index ef4f41195f..fca9a1d769 100644 --- a/tools/coqdoc/coqdoc.sty +++ b/tools/coqdoc/coqdoc.sty @@ -70,6 +70,9 @@ % !!! CAUTION: This environment may have empty contents \newenvironment{coqdoccode}{}{} +% Environment for comments +\newenvironment{coqdoccomment}{\tt(*}{*)} + % newline and indentation %BEGIN LATEX % Base indentation length diff --git a/tools/coqdoc/cpretty.mll b/tools/coqdoc/cpretty.mll index 1420c9a924..234df6530d 100644 --- a/tools/coqdoc/cpretty.mll +++ b/tools/coqdoc/cpretty.mll @@ -675,8 +675,10 @@ and comments = parse (*s Skip comments *) and comment = parse - | "(*" { incr comment_level; comment lexbuf } - | "*)" space* nl { + | "(*" { incr comment_level; + if !Cdglobals.parse_comments then Output.start_comment (); + comment lexbuf } + | "*)" space* nl { if !Cdglobals.parse_comments then (Output.end_comment (); Output.line_break ()); decr comment_level; if !comment_level > 0 then comment lexbuf else true } @@ -692,7 +694,7 @@ and comment = parse and skip_to_dot = parse | '.' space* nl { true } - | eof | '.' space+ { false} + | eof | '.' space+ { false } | "(*" { comment_level := 1; ignore (comment lexbuf); skip_to_dot lexbuf } | _ { skip_to_dot lexbuf } @@ -712,7 +714,6 @@ and body = parse | "(*" { comment_level := 1; if !Cdglobals.parse_comments then Output.start_comment (); let eol = comment lexbuf in - if !Cdglobals.parse_comments then Output.end_comment (); if eol then begin Output.line_break(); body_bol lexbuf end else body lexbuf } -- cgit v1.2.3