diff options
| author | msozeau | 2009-10-13 15:56:38 +0000 |
|---|---|---|
| committer | msozeau | 2009-10-13 15:56:38 +0000 |
| commit | 290bc531699755ef8c559d1886a5c97d8bc72f36 (patch) | |
| tree | 75e81ff9fc3f1c017da7b5109d1f80a8256f6804 /tools | |
| parent | aa49d0523c769de01bc66f0f2b9e663ff0731cd6 (diff) | |
Better handling of emphasis.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12385 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/coqdoc/cpretty.mll | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/coqdoc/cpretty.mll b/tools/coqdoc/cpretty.mll index 22d81d6f54..d92b34e25e 100644 --- a/tools/coqdoc/cpretty.mll +++ b/tools/coqdoc/cpretty.mll @@ -65,7 +65,11 @@ let brackets = ref 0 let comment_level = ref 0 let in_proof = ref None + let in_emph = ref false + let start_emph () = in_emph := true; Output.start_emph () + let stop_emph () = if !in_emph then (Output.stop_emph (); in_emph := false) + let backtrack lexbuf = lexbuf.lex_curr_pos <- lexbuf.lex_start_pos let backtrack_past_newline lexbuf = let buf = lexeme lexbuf in @@ -675,7 +679,7 @@ and doc_bol = parse | eof { true } | '_' - { Output.start_emph (); + { start_emph (); doc None lexbuf } | _ { backtrack lexbuf; doc None lexbuf } @@ -823,10 +827,10 @@ and doc indents = parse doc indents lexbuf} | nonidentchar '_' { Output.char (lexeme_char lexbuf 0); - Output.start_emph (); + start_emph (); doc indents lexbuf } | '_' nonidentchar - { Output.stop_emph (); + { stop_emph (); Output.char (lexeme_char lexbuf 1); doc indents lexbuf } | eof |
