diff options
| author | Stefan Monnier | 2011-06-23 12:55:59 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-06-23 12:55:59 -0400 |
| commit | 273d2baf9bfe78df24047666b7e6cdb52e44e66d (patch) | |
| tree | b7b2358f6c9e70a360e533908cc697a63e0776d2 | |
| parent | f444564c73d7c7546d60d2d899a02cf838316c6c (diff) | |
| download | emacs-273d2baf9bfe78df24047666b7e6cdb52e44e66d.tar.gz emacs-273d2baf9bfe78df24047666b7e6cdb52e44e66d.zip | |
* lisp/emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable error
messages for adjacent non-terminals.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b5f33a7782..029003c0429 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-06-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable error | ||
| 4 | messages for adjacent non-terminals. | ||
| 5 | |||
| 1 | 2011-06-23 Richard Stallman <rms@gnu.org> | 6 | 2011-06-23 Richard Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * mail/rmail.el (rmail-retry-ignored-headers): Add message-id. | 8 | * mail/rmail.el (rmail-retry-ignored-headers): Add message-id. |
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 17cc5668b5f..0206abb9f53 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." | |||
| 229 | ;; the trouble, and it lets the writer of the BNF | 229 | ;; the trouble, and it lets the writer of the BNF |
| 230 | ;; be a bit more sloppy by skipping uninteresting base | 230 | ;; be a bit more sloppy by skipping uninteresting base |
| 231 | ;; cases which are terminals but not OPs. | 231 | ;; cases which are terminals but not OPs. |
| 232 | (assert (not (member (cadr rhs) nts))) | 232 | (when (member (cadr rhs) nts) |
| 233 | (error "Adjacent non-terminals: %s %s" | ||
| 234 | (car rhs) (cadr rhs))) | ||
| 233 | (pushnew (cadr rhs) first-ops))) | 235 | (pushnew (cadr rhs) first-ops))) |
| 234 | (let ((shr (reverse rhs))) | 236 | (let ((shr (reverse rhs))) |
| 235 | (if (not (member (car shr) nts)) | 237 | (if (not (member (car shr) nts)) |
| 236 | (pushnew (car shr) last-ops) | 238 | (pushnew (car shr) last-ops) |
| 237 | (pushnew (car shr) last-nts) | 239 | (pushnew (car shr) last-nts) |
| 238 | (when (consp (cdr shr)) | 240 | (when (consp (cdr shr)) |
| 239 | (assert (not (member (cadr shr) nts))) | 241 | (when (member (cadr rhs) nts) |
| 242 | (error "Adjacent non-terminals: %s %s" | ||
| 243 | (cadr rhs) (car rhs))) | ||
| 240 | (pushnew (cadr shr) last-ops))))) | 244 | (pushnew (cadr shr) last-ops))))) |
| 241 | (push (cons nt first-ops) first-ops-table) | 245 | (push (cons nt first-ops) first-ops-table) |
| 242 | (push (cons nt last-ops) last-ops-table) | 246 | (push (cons nt last-ops) last-ops-table) |