Function: c-laomib-loop

c-laomib-loop is a byte-compiled function defined in cc-engine.el.gz.

Signature

(c-laomib-loop LIM)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-engine.el.gz
(defun c-laomib-loop (lim)
  ;; The "expensive" loop from `c-looking-at-or-maybe-in-bracelist'.  Move
  ;; backwards over comma separated sexps as far as possible, but no further
  ;; than LIM, which may be nil, meaning no limit.  Return the final value of
  ;; `braceassignp', which is t if we encountered "= {", usually nil
  ;; otherwise.
  (let ((braceassignp 'dontknow)
	  (class-key
	   ;; Pike can have class definitions anywhere, so we must
	   ;; check for the class key here.
	   (and (c-major-mode-is 'pike-mode)
		c-decl-block-key)))
    (while (eq braceassignp 'dontknow)
      (cond ((or (eq (char-after) ?\;)
		 (save-excursion
		   (progn (c-backward-syntactic-ws)
			  (c-at-vsemi-p))))
	     (setq braceassignp nil))
	    ((and class-key
		  (looking-at class-key))
	     (setq braceassignp nil))
	    ((and c-has-compound-literals
		  (looking-at c-return-key))
	     (setq braceassignp t)
	     nil)
	    ((eq (char-after) ?=)
	     ;; We've seen a =, but must check earlier tokens so
	     ;; that it isn't something that should be ignored.
	     (setq braceassignp 'maybe)
	     (while (and (eq braceassignp 'maybe)
			 (zerop (c-backward-token-2 1 t lim)))
	       (setq braceassignp
		     (cond
		      ;; Check for operator =
		      ((and c-opt-op-identifier-prefix
			    (looking-at c-opt-op-identifier-prefix))
		       nil)
		      ;; Check for `<opchar>= in Pike.
		      ((and (c-major-mode-is 'pike-mode)
			    (or (eq (char-after) ?`)
				;; Special case for Pikes
				;; `[]=, since '[' is not in
				;; the punctuation class.
				(and (eq (char-after) ?\[)
				     (eq (char-before) ?`))))
		       nil)
		      ((looking-at "\\s.") 'maybe)
		      ;; make sure we're not in a C++ template
		      ;; argument assignment
		      ((and
			(c-major-mode-is 'c++-mode)
			(save-excursion
			  (let ((here (point))
				(pos< (progn
					(skip-chars-backward "^<>")
					(point))))
			    (and (eq (char-before) ?<)
				 (not (c-crosses-statement-barrier-p
				       pos< here))
				 (not (c-in-literal))
				 ))))
		       nil)
		      (t t)))))
	    ((and
	      (c-major-mode-is 'c++-mode)
	      (eq (char-after) ?\[)
	      ;; Be careful of "operator []"
	      (not (save-excursion
		     (c-backward-token-2 1 nil lim)
		     (looking-at c-opt-op-identifier-prefix))))
	     (setq braceassignp t)
	     nil))
      (when (eq braceassignp 'dontknow)
	(cond ((and
		(not (eq (char-after) ?,))
		(save-excursion
		  (c-backward-syntactic-ws)
		  (eq (char-before) ?})))
	       (setq braceassignp nil))
	      ((/= (c-backward-token-2 1 t lim) 0)
	       (if (save-excursion
		     (and c-has-compound-literals
			  (eq (c-backward-token-2 1 nil lim) 0)
			  (eq (char-after) ?\()))
		   (setq braceassignp t)
		 (setq braceassignp nil))))))
    braceassignp))