]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable error
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 23 Jun 2011 16:55:59 +0000 (12:55 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 23 Jun 2011 16:55:59 +0000 (12:55 -0400)
messages for adjacent non-terminals.

lisp/ChangeLog
lisp/emacs-lisp/smie.el

index 6b5f33a778201523560adba5c75bffb34ab84deb..029003c0429a21eb33727790f1a3e61a0b077f87 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable error
+       messages for adjacent non-terminals.
+
 2011-06-23  Richard Stallman  <rms@gnu.org>
 
        * mail/rmail.el (rmail-retry-ignored-headers): Add message-id.
index 17cc5668b5f9716ef040dc4babc4322eb97dd562..0206abb9f53a596e879d6bea2ce1273a58844fba 100644 (file)
@@ -229,14 +229,18 @@ one of those elements share the same precedence level and associativity."
               ;; the trouble, and it lets the writer of the BNF
               ;; be a bit more sloppy by skipping uninteresting base
               ;; cases which are terminals but not OPs.
-              (assert (not (member (cadr rhs) nts)))
+              (when (member (cadr rhs) nts)
+                (error "Adjacent non-terminals: %s %s"
+                       (car rhs) (cadr rhs)))
               (pushnew (cadr rhs) first-ops)))
           (let ((shr (reverse rhs)))
             (if (not (member (car shr) nts))
                 (pushnew (car shr) last-ops)
               (pushnew (car shr) last-nts)
               (when (consp (cdr shr))
-                (assert (not (member (cadr shr) nts)))
+                (when (member (cadr rhs) nts)
+                  (error "Adjacent non-terminals: %s %s"
+                         (cadr rhs) (car rhs)))
                 (pushnew (cadr shr) last-ops)))))
         (push (cons nt first-ops) first-ops-table)
         (push (cons nt last-ops) last-ops-table)