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

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

[elpa] externals/rec-mode 3e2f5a7 46/98: rec-mode: support for multiple


From: Stefan Monnier
Subject: [elpa] externals/rec-mode 3e2f5a7 46/98: rec-mode: support for multiple field names in %type entries.
Date: Thu, 12 Nov 2020 13:18:38 -0500 (EST)

branch: externals/rec-mode
commit 3e2f5a77ad88a1c0a0a0c92d487859d4b787b48a
Author: Jose E. Marchesi <jemarch@gnu.org>
Commit: Antoine Kalmbach <ane@iki.fi>

    rec-mode: support for multiple field names in %type entries.
---
 etc/rec-mode.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index bbf459a..f975c93 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -1182,11 +1182,17 @@ returned."
        (with-temp-buffer
          (insert type-descr)
          (goto-char (point-min))
-         (when (looking-at "[ \n\t]*\\([a-zA-Z%][a-zA-Z0-9_-]*\\)[ \n\t]*")
-           (let ((name (match-string 1)))
-             (goto-char (match-end 0))
-             (when (equal name field-name)
-               (setq res-type (rec-parse-type (buffer-substring (point) 
(point-max)))))))))
+         (when (looking-at "[ 
\n\t]*\\([a-zA-Z%][a-zA-Z0-9_-]*\\(,[a-zA-Z%][a-zA-Z0-9_-]*\\)?\\)[ \n\t]*")
+           (let ((names (match-string 1))
+                 (begin-description (match-end 0))
+                 name)
+             (goto-char (match-beginning 1))
+             (while (looking-at "\\([a-zA-Z%][a-zA-Z0-9_-]*\\),?")
+               (if (equal (match-string 1) field-name)
+                   (progn
+                     (goto-char begin-description)
+                     (setq res-type (rec-parse-type (buffer-substring (point) 
(point-max)))))
+                 (goto-char (match-end 0))))))))
      types)
     res-type))
 



reply via email to

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