emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/tuareg a06468c 09/10: Repair handling of ocamldoc section


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg a06468c 09/10: Repair handling of ocamldoc section headers like {2:text}
Date: Fri, 30 Jul 2021 16:57:28 -0400 (EDT)

branch: elpa/tuareg
commit a06468cbbc2b26b6c36637da9c728a7da2e0d1f4
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>

    Repair handling of ocamldoc section headers like {2:text}
---
 tuareg.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index 088c91c..e7baa3b 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -764,12 +764,13 @@ delimiting the region of interest. "
       (let ((case-fold-search nil))
         (funcall
          (tuareg--syntax-rules
-          ((rx "[")
+          ((rx (or "[" "{["))
            ;; Fontify opening bracket.
-           (put-text-property start (1+ start) 'face
+           (put-text-property start (point) 'face
                               'tuareg-font-lock-doc-markup-face)
            ;; Skip balanced set of brackets.
-           (let ((level 1))
+           (let ((start-end (point))
+                 (level 1))
              (while (and (< (point) end)
                          (re-search-forward (rx (? "\\") (in "[]"))
                                             end 'noerror)
@@ -785,11 +786,11 @@ delimiting the region of interest. "
                                (forward-char -1)
                                nil))
                             (t t)))))
-             (put-text-property (1+ start) (point) 'face
+             (put-text-property start-end (point) 'face
                                 tuareg-font-lock-doc-code-face)
              (if (> level 0)
                  ;; Highlight unbalanced opening bracket.
-                 (put-text-property start (1+ start) 'face
+                 (put-text-property start start-end 'face
                                     'tuareg-font-lock-error-face)
                ;; Fontify closing bracket.
                (put-text-property (point) (1+ (point)) 'face
@@ -817,11 +818,11 @@ delimiting the region of interest. "
              (goto-char (match-end 0))))
 
           ;; Cross-reference.
-          ((rx "{!" (? (or "tag" "module" "modtype" "class"
-                            "classtype" "val" "type"
-                            "exception" "attribute" "method"
-                            "section" "const" "recfield")
-                        ":")
+          ((rx (or "{!" "{{!")
+               (? (or "tag" "module" "modtype" "class" "classtype" "val" "type"
+                      "exception" "attribute" "method" "section" "const"
+                      "recfield")
+                  ":")
                 (group (* (in "a-zA-Z0-9" "_.'"))))
            (put-text-property start (match-beginning group) 'face
                               'tuareg-font-lock-doc-markup-face)
@@ -847,7 +848,7 @@ delimiting the region of interest. "
                         (or (or "-" ":" "_" "^"
                                 "b" "i" "e" "C" "L" "R"
                                 "ul" "ol" "%"
-                                "")
+                                "{:")
                             ;; Section header with optional label.
                             (seq (+ digit)
                                  (? ":"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]