diff options
| author | Maxime Dénès | 2017-08-16 09:37:21 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2017-08-16 09:37:21 +0200 |
| commit | f052c7fea6b0b9c0628ad77908ede7aac8712bd5 (patch) | |
| tree | 98eed89cf4d4b78806e774716da53ebc1dbbb237 /tools | |
| parent | f0b4757d291ce3e07c8ccfcd4217d204fd2059ba (diff) | |
| parent | f3bb625fb2d118168042b97162e1ece1bda4a039 (diff) | |
Merge PR #880: Fix coqdoc bug #5648 on user idents colliding with keywords wrongly tagged as keywords
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/coqdoc/output.ml | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/tools/coqdoc/output.ml b/tools/coqdoc/output.ml index 5c0d2a39b0..d043c4a584 100644 --- a/tools/coqdoc/output.ml +++ b/tools/coqdoc/output.ml @@ -693,25 +693,21 @@ module Html = struct printf "<span class=\"id\" title=\"keyword\">%s</span>" (translate s) let ident s loc = - if is_keyword s then begin - printf "<span class=\"id\" title=\"keyword\">%s</span>" (translate s) - end else begin - try - match loc with - | None -> raise Not_found - | Some loc -> - reference (translate s) (Index.find (get_module false) loc) - with Not_found -> - if is_tactic s then - printf "<span class=\"id\" title=\"tactic\">%s</span>" (translate s) - else - if !Cdglobals.interpolate && !in_doc (* always a var otherwise *) - then - try reference (translate s) (Index.find_string (get_module false) s) - with _ -> Tokens.output_tagged_ident_string s - else - Tokens.output_tagged_ident_string s - end + try + match loc with + | None -> raise Not_found + | Some loc -> + reference (translate s) (Index.find (get_module false) loc) + with Not_found -> + if is_tactic s then + printf "<span class=\"id\" title=\"tactic\">%s</span>" (translate s) + else if is_keyword s then + printf "<span class=\"id\" title=\"keyword\">%s</span>" (translate s) + else if !Cdglobals.interpolate && !in_doc (* always a var otherwise *) then + try reference (translate s) (Index.find_string (get_module false) s) + with Not_found -> Tokens.output_tagged_ident_string s + else + Tokens.output_tagged_ident_string s let proofbox () = printf "<font size=-2>☐</font>" |
