Commit 5922fd0e authored by Alan Mackenzie's avatar Alan Mackenzie
Browse files

(c-guess-basic-syntax CASE 5D.5): Fix an infinite loop on invalid syntax.

parent 6971de07
......@@ -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.
(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))
(eq (char-before) ?}))))
(eq (char-before) ?}))
(< (point) placeholder)))
(if (eq char-before-ip ?,)
((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.
((eq char-before-ip ?,) 'topmost-intro-cont)
(t 'statement-cont))
nil nil containing-sexp paren-state))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment