mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-09 21:20:45 -08:00
(c-guess-basic-syntax CASE 5D.5): Fix an infinite loop on invalid syntax.
This commit is contained in:
parent
6971de0774
commit
5922fd0ee0
1 changed files with 9 additions and 6 deletions
|
|
@ -8251,21 +8251,24 @@ comment at the start of cc-engine.el for more info."
|
|||
(c-add-syntax 'inher-cont (c-point 'boi)))
|
||||
|
||||
;; CASE 5D.5: Continuation of the "expression part" of a
|
||||
;; top level construct.
|
||||
;; top level construct. Or, perhaps, an unrecognised construct.
|
||||
(t
|
||||
(while (and (eq (car (c-beginning-of-decl-1 containing-sexp))
|
||||
(while (and (setq placeholder (point))
|
||||
(eq (car (c-beginning-of-decl-1 containing-sexp))
|
||||
'same)
|
||||
(save-excursion
|
||||
(c-backward-syntactic-ws)
|
||||
(eq (char-before) ?}))))
|
||||
(eq (char-before) ?}))
|
||||
(< (point) placeholder)))
|
||||
(c-add-stmt-syntax
|
||||
(if (eq char-before-ip ?,)
|
||||
(cond
|
||||
((eq (point) placeholder) 'statement) ; unrecognised construct
|
||||
;; A preceding comma at the top level means that a
|
||||
;; new variable declaration starts here. Use
|
||||
;; topmost-intro-cont for it, for consistency with
|
||||
;; the first variable declaration. C.f. case 5N.
|
||||
'topmost-intro-cont
|
||||
'statement-cont)
|
||||
((eq char-before-ip ?,) 'topmost-intro-cont)
|
||||
(t 'statement-cont))
|
||||
nil nil containing-sexp paren-state))
|
||||
))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue