aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-06-18 16:08:47 +0200
committerLars Ingebrigtsen2019-06-18 16:08:47 +0200
commit4956e7610c782cace51943ee41f4c357703bdae1 (patch)
tree3bb474932b696a8db3ecb4831ed55a2f25d0e115
parentf21ec24524c705e18674a2e9e4db37b11fa3ebab (diff)
downloademacs-4956e7610c782cace51943ee41f4c357703bdae1.tar.gz
emacs-4956e7610c782cace51943ee41f4c357703bdae1.zip
Revert "Add a mechanism to specify expected shift/reduce .wy conflicts"
This reverts commit f21ec24524c705e18674a2e9e4db37b11fa3ebab. *sigh* Revert again because this created a bootstrap problem in a different part of the process.
-rw-r--r--admin/grammars/python.wy1
-rw-r--r--lisp/cedet/semantic/grammar.el9
-rw-r--r--lisp/cedet/semantic/wisent/comp.el18
3 files changed, 8 insertions, 20 deletions
diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy
index 0e926ad3636..082850df59c 100644
--- a/admin/grammars/python.wy
+++ b/admin/grammars/python.wy
@@ -88,7 +88,6 @@
88 88
89%package wisent-python-wy 89%package wisent-python-wy
90%provide semantic/wisent/python-wy 90%provide semantic/wisent/python-wy
91%expectedconflicts 4
92 91
93%{ 92%{
94(declare-function wisent-python-reconstitute-function-tag 93(declare-function wisent-python-reconstitute-function-tag
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 39161420f98..8ffa4c6d83e 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -277,13 +277,6 @@ foo.by it is foo-by."
277 (i (string-match (format "\\([.]\\)%s\\'" ext) file))) 277 (i (string-match (format "\\([.]\\)%s\\'" ext) file)))
278 (concat (substring file 0 i) "-" ext)))) 278 (concat (substring file 0 i) "-" ext))))
279 279
280(defun semantic-grammar-expected-conflicts ()
281 "Return the number of expected shift/reduce conflicts in the package."
282 (let ((conflicts (semantic-grammar-tag-symbols 'expectedconflicts)))
283 (if conflicts
284 (string-to-number conflicts)
285 0)))
286
287(defsubst semantic-grammar-languagemode () 280(defsubst semantic-grammar-languagemode ()
288 "Return the %languagemode value as a list of symbols or nil." 281 "Return the %languagemode value as a list of symbols or nil."
289 (semantic-grammar-tag-symbols 'languagemode)) 282 (semantic-grammar-tag-symbols 'languagemode))
@@ -994,7 +987,7 @@ Return non-nil if there were no errors, nil if errors."
994 (vc-handled-backends nil)) 987 (vc-handled-backends nil))
995 (setq semanticdb-new-database-class 'semanticdb-project-database) 988 (setq semanticdb-new-database-class 'semanticdb-project-database)
996 (semantic-mode 1) 989 (semantic-mode 1)
997 (semantic-grammar-create-package t))) 990 (semantic-grammar-create-package)))
998 (error 991 (error
999 (message "%s" (error-message-string err)) 992 (message "%s" (error-message-string err))
1000 nil)))) 993 nil))))
diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el
index ff434f555da..051b898ed78 100644
--- a/lisp/cedet/semantic/wisent/comp.el
+++ b/lisp/cedet/semantic/wisent/comp.el
@@ -2264,28 +2264,24 @@ there are any reduce/reduce conflicts."
2264 :group 'wisent 2264 :group 'wisent
2265 :type '(choice (const nil) integer)) 2265 :type '(choice (const nil) integer))
2266 2266
2267(declare-function semantic-grammar-expected-conflicts "semantic/grammar")
2268
2269(defun wisent-total-conflicts () 2267(defun wisent-total-conflicts ()
2270 "Report the total number of conflicts." 2268 "Report the total number of conflicts."
2271 (require 'semantic/grammar)
2272 (unless (and (zerop rrc-total) 2269 (unless (and (zerop rrc-total)
2273 (or (zerop src-total) 2270 (or (zerop src-total)
2274 (= src-total (or wisent-expected-conflicts 0)))) 2271 (= src-total (or wisent-expected-conflicts 0))))
2275 (let* ((src (wisent-source)) 2272 (let* ((src (wisent-source))
2276 (src (if src (concat " in " src) "")) 2273 (src (if src (concat " in " src) ""))
2277 (msg (format "Grammar%s contains" src))) 2274 (msg (format "Grammar%s contains" src)))
2278 (when (and (> src-total 0) 2275 (if (> src-total 0)
2279 (not (= rrc-total (semantic-grammar-expected-conflicts)))) 2276 (setq msg (format "%s %d shift/reduce conflict%s"
2280 (setq msg (format "%s %d shift/reduce conflict%s" 2277 msg src-total (if (> src-total 1)
2281 msg src-total (if (> src-total 1) 2278 "s" ""))))
2282 "s" ""))))
2283 (if (and (> src-total 0) (> rrc-total 0)) 2279 (if (and (> src-total 0) (> rrc-total 0))
2284 (setq msg (format "%s and" msg))) 2280 (setq msg (format "%s and" msg)))
2285 (if (> rrc-total 0) 2281 (if (> rrc-total 0)
2286 (setq msg (format "%s %d reduce/reduce conflict%s" 2282 (setq msg (format "%s %d reduce/reduce conflict%s"
2287 msg rrc-total (if (> rrc-total 1) 2283 msg rrc-total (if (> rrc-total 1)
2288 "s" "")))) 2284 "s" ""))))
2289 (message msg)))) 2285 (message msg))))
2290 2286
2291(defun wisent-print-conflicts () 2287(defun wisent-print-conflicts ()