1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/9fcb078500c0/
Changeset: 9fcb078500c0
User: acm
Date: 2014-06-29 12:00:52
Summary: Don't call c-parse-state when c++-template-syntax-table is active.
cc-engine.el (c-guess-continued-construct CASE G)
(c-guess-basic-syntax CASE 5D.3): Rearrange so that
c-syntactic-skip-backwards isn't called with the pertinent syntax table.
Affected #: 3 files
diff -r 24fbc1769202be12c1c7025c11155c0f628630b4 -r
9fcb078500c0b16a356756beb9c6e58fd05747a3 cc-defs.el
--- a/cc-defs.el
+++ b/cc-defs.el
@@ -840,6 +840,8 @@
(defmacro c-with-syntax-table (table &rest code)
;; Temporarily switches to the specified syntax table in a failsafe
;; way to execute code.
+ ;; Maintainers' note: If TABLE is `c++-template-syntax-table', DON'T call
+ ;; any forms inside this that call `c-parse-state'. !!!!
`(let ((c-with-syntax-table-orig-table (syntax-table)))
(unwind-protect
(progn
diff -r 24fbc1769202be12c1c7025c11155c0f628630b4 -r
9fcb078500c0b16a356756beb9c6e58fd05747a3 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -9390,16 +9390,16 @@
(not (looking-at c-<-op-cont-regexp))))))
(c-with-syntax-table c++-template-syntax-table
(goto-char placeholder)
- (c-beginning-of-statement-1 containing-sexp t)
- (if (save-excursion
- (c-backward-syntactic-ws containing-sexp)
- (eq (char-before) ?<))
- ;; In a nested template arglist.
- (progn
- (goto-char placeholder)
- (c-syntactic-skip-backward "^,;" containing-sexp t)
- (c-forward-syntactic-ws))
- (back-to-indentation)))
+ (c-beginning-of-statement-1 containing-sexp t))
+ (if (save-excursion
+ (c-backward-syntactic-ws containing-sexp)
+ (eq (char-before) ?<))
+ ;; In a nested template arglist.
+ (progn
+ (goto-char placeholder)
+ (c-syntactic-skip-backward "^,;" containing-sexp t)
+ (c-forward-syntactic-ws))
+ (back-to-indentation))
;; FIXME: Should use c-add-stmt-syntax, but it's not yet
;; template aware.
(c-add-syntax 'template-args-cont (point) placeholder))
@@ -10057,16 +10057,16 @@
(eq (char-after placeholder) ?<))))))
(c-with-syntax-table c++-template-syntax-table
(goto-char placeholder)
- (c-beginning-of-statement-1 lim t)
- (if (save-excursion
- (c-backward-syntactic-ws lim)
- (eq (char-before) ?<))
- ;; In a nested template arglist.
- (progn
- (goto-char placeholder)
- (c-syntactic-skip-backward "^,;" lim t)
- (c-forward-syntactic-ws))
- (back-to-indentation)))
+ (c-beginning-of-statement-1 lim t))
+ (if (save-excursion
+ (c-backward-syntactic-ws lim)
+ (eq (char-before) ?<))
+ ;; In a nested template arglist.
+ (progn
+ (goto-char placeholder)
+ (c-syntactic-skip-backward "^,;" lim t)
+ (c-forward-syntactic-ws))
+ (back-to-indentation))
;; FIXME: Should use c-add-stmt-syntax, but it's not yet
;; template aware.
(c-add-syntax 'template-args-cont (point) placeholder))
diff -r 24fbc1769202be12c1c7025c11155c0f628630b4 -r
9fcb078500c0b16a356756beb9c6e58fd05747a3 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -376,7 +376,9 @@
;; lists are parsed. Note that this encourages incorrect parsing of
;; templates since they might contain normal operators that uses the
;; '<' and '>' characters. Therefore this syntax table might go
- ;; away when CC Mode handles templates correctly everywhere.
+ ;; away when CC Mode handles templates correctly everywhere. WHILE
+ ;; THIS SYNTAX TABLE IS CURRENT, `c-parse-state' MUST _NOT_ BE
+ ;; CALLED!!!
t nil
(java c++) `(lambda ()
(let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
Repository URL:
https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches