diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-06-18 15:56:18 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-06-18 15:56:18 +0200 |
commit | d715ae8788e16b22f7f68cb82b51a40ad95c78c2 (patch) | |
tree | 38dc3b3f14c2074456e909de00761d5aa57998a3 /lisp/cedet/semantic/wisent/comp.el | |
parent | e09fcc1ff33c0643e9100cb5eee5ff351a85fcbb (diff) | |
download | emacs-d715ae8788e16b22f7f68cb82b51a40ad95c78c2.tar.gz emacs-d715ae8788e16b22f7f68cb82b51a40ad95c78c2.tar.bz2 emacs-d715ae8788e16b22f7f68cb82b51a40ad95c78c2.zip |
Add a mechanism to specify expected shift/reduce .wy conflicts
* admin/grammars/python.wy: Set the expected number of
shift/reduce conflicts to four.
* lisp/cedet/semantic/grammar.el
(semantic-grammar-expected-conflicts): New function.
* lisp/cedet/semantic/wisent/comp.el (wisent-total-conflicts): Use
it to suppress warnings about the expected number of shift/reduce
conflicts.
Diffstat (limited to 'lisp/cedet/semantic/wisent/comp.el')
-rw-r--r-- | lisp/cedet/semantic/wisent/comp.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 051b898ed78..733345f593f 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -40,6 +40,7 @@ ;;; Code: (require 'semantic/wisent) +(require 'semantic/grammar) (eval-when-compile (require 'cl-lib)) ;;;; ------------------- @@ -2272,16 +2273,17 @@ there are any reduce/reduce conflicts." (let* ((src (wisent-source)) (src (if src (concat " in " src) "")) (msg (format "Grammar%s contains" src))) - (if (> src-total 0) - (setq msg (format "%s %d shift/reduce conflict%s" - msg src-total (if (> src-total 1) - "s" "")))) + (when (and (> src-total 0) + (not (= rrc-total (semantic-grammar-expected-conflicts)))) + (setq msg (format "%s %d shift/reduce conflict%s" + msg src-total (if (> src-total 1) + "s" "")))) (if (and (> src-total 0) (> rrc-total 0)) (setq msg (format "%s and" msg))) (if (> rrc-total 0) - (setq msg (format "%s %d reduce/reduce conflict%s" - msg rrc-total (if (> rrc-total 1) - "s" "")))) + (setq msg (format "%s %d reduce/reduce conflict%s" + msg rrc-total (if (> rrc-total 1) + "s" "")))) (message msg)))) (defun wisent-print-conflicts () |