]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix abnf parsing of <prose> elements
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 31 Aug 2021 01:17:21 +0000 (03:17 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 31 Aug 2021 01:17:21 +0000 (03:17 +0200)
* lisp/progmodes/ebnf-abn.el (ebnf-abn-lex): Make <prose> parsing
work (bug#39663).

lisp/progmodes/ebnf-abn.el

index 2a37110f6ae2da4263e24a035f8ce9104c353c01..c3b240ad8be8338737b04c5d060b143704d6ab71 100644 (file)
@@ -530,13 +530,14 @@ See documentation for variable `ebnf-abn-lex'."
        (let ((prose-p (= (following-char) ?<)))
          (when prose-p
            (forward-char)
-           (or (looking-at ebnf-abn-non-terminal-letter-chars)
+           (or (looking-at (concat "[" ebnf-abn-non-terminal-letter-chars "]"))
                (error "Invalid prose value")))
          (setq ebnf-abn-lex
                (ebnf-buffer-substring ebnf-abn-non-terminal-chars))
          (when prose-p
            (or (= (following-char) ?>)
                (error "Invalid prose value"))
+            (forward-char)
            (setq ebnf-abn-lex (concat "<" ebnf-abn-lex ">"))))
        'non-terminal)
        ;; equal: =, =/