aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/smie.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2011-06-23 12:55:59 -0400
committerStefan Monnier <[email protected]>2011-06-23 12:55:59 -0400
commit273d2baf9bfe78df24047666b7e6cdb52e44e66d (patch)
treeb7b2358f6c9e70a360e533908cc697a63e0776d2 /lisp/emacs-lisp/smie.el
parentf444564c73d7c7546d60d2d899a02cf838316c6c (diff)
* lisp/emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable error
messages for adjacent non-terminals.
Diffstat (limited to 'lisp/emacs-lisp/smie.el')
-rw-r--r--lisp/emacs-lisp/smie.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 17cc5668b5..0206abb9f5 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -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)