• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:face +defs:or +defs:list

19 ;; GNU Emacs is free software; you can redistribute it and/or modify
21 ;; the Free Software Foundation; either version 2, or (at your option)
26 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 ;; or even disappear in the future.
52 ;; `c-save-buffer-state' or a similar function that saves and restores
62 ;; in their doc string or comment.
88 ;; always treated as front and rear nonsticky (or start and end open
115 ;; recognized simply by looking for a token like ";" or "}".
125 ;; in the declarator list of a declaration. They are also used
177 ;; key like `{' is pressed (or an electric keyword like `else').
190 ;; Calculate the new state of PREVSTATE, t or nil, based on arg. If
191 ;; arg is nil or zero, toggle the state. If arg is negative, turn
193 (if (or (not arg)
265 ;; "#define"d (or whatever c-opt-cpp-macro-define specifies). Non-nil
277 ;; if it's a "#define" (or whatever c-opt-cpp-macro-define
293 ;; whitespace is removed or, where necessary, replaced with a single
303 (let* ((parts (list nil)) (tail parts) pos in-paren)
323 (setcdr tail (list (buffer-substring-no-properties from pos)
326 (setcdr tail (list (buffer-substring-no-properties from pos)))
331 (setcdr tail (list (buffer-substring-no-properties
337 (setcdr tail (list (buffer-substring-no-properties from to)))
416 ;; locking is in use. This variable is extended with the face in
417 ;; `c-doc-face-name' when fontification is activated in cc-fonts.el.
419 (append '(font-lock-comment-face font-lock-string-face)
420 (when (facep 'font-lock-comment-delimiter-face)
422 '(font-lock-comment-delimiter-face))))
456 (defun c-debug-add-face (beg end face)
461 (when (eq (overlay-get overlay 'face) face)
465 (overlay-put (make-overlay beg end) 'face face)))
467 (defun c-debug-remove-face (beg end face)
473 (when (eq (overlay-get overlay 'face) face)
478 (overlay-put (make-overlay ol-beg beg) 'face face))
480 (overlay-put (make-overlay end ol-end) 'face face))))
534 "Move to the start of the current statement or declaration, or to
537 move into or out of sexps (not even normal expression parentheses).
554 of the content in the macro, i.e. the expression of an \"#if\" or the
561 from a statement continuation clause to its start clause, or 'macro if
566 point will be left at the closest following token, or at the start
587 ;; sexp at a time (where a sexp is, more or less, either a token or the
589 ;; boundary is crossed or a "while"-like token is found, update the state of
597 ;; statement boundary, or nil otherwise.
604 ;; saved-pos: A vector of either saved positions (tok ptok pptok, etc.) or
618 ;; "catch" or "finally": Push state, goto state `catch'.
671 ;; The position of the last sexp or bound that follows the
687 ;; Symbol just scanned back over (e.g. 'while or 'boundary).
697 (cond-key (or c-opt-block-stmt-key
701 ;; Positions of the last three sexps or bounds we've stopped at.
729 (or (memq (char-before) delims)
744 ;; etc. with contents, or symbol or suchlike) each iteration. This
773 ;; statement boundary or passed a "while"-like token.
774 ((or sym
795 (or (cond
857 ;; Is this a real while, or a do-while?
860 (when (or (not pptok)
865 ;; or the like.
881 ;; We're either past a statement boundary or at the
917 ;; Check if the sexp movement crossed a statement or
952 (goto-char (1+ (c-down-list-backward
961 ;; Passed a symbol sexp or line
997 ;; (including a case label) or something like C++'s "public:"?
998 (if (or (not (looking-at c-nonlabel-token-key)) ; proper label
1006 (setq last-label-pos (or tok start)))
1007 (setq after-labels-pos (or tok start)))
1018 (setq label-good-pos (or tok start))))
1048 (or (not label-good-pos)
1077 "Return non-nil if buffer positions FROM to TO cross one or more
1078 statement or declaration boundaries. The returned value is actually
1080 a string or comment.
1086 For AWK, a statement which is terminated by an EOL (not a \; or a }) is
1131 or somewhere in the syntactic whitespace before it.
1144 (or (bobp)
1149 (c-looking-at-special-brace-list)))))
1153 "Return non-nil if the point is at the first token in an expression or
1154 statement, or somewhere in the syntactic whitespace before it.
1173 (or (bobp)
1228 (while (or
1334 ;; must be handled separately, e.g. whitespace inside a comment or
1349 ;; or cpp directive and must not be considered part of the "rung".
1366 ;; a later call to `c-forward-sws' or `c-backward-sws' will use the
1386 ; (defface c-debug-is-sws-face
1388 ; "Debug face to mark the `c-is-sws' property.")
1389 ; (defface c-debug-in-sws-face
1391 ; "Debug face to mark the `c-in-sws' property.")
1398 ; (c-save-buffer-state (in-face)
1400 ; (setq in-face (if (get-text-property (point) 'c-is-sws)
1405 ; (if in-face
1407 ; (c-debug-add-face in-face (point) 'c-debug-is-sws-face)
1408 ; (setq in-face nil))
1409 ; (setq in-face (point)))
1412 ; (setq in-face (if (get-text-property (point) 'c-in-sws)
1417 ; (if in-face
1419 ; (c-debug-add-face in-face (point) 'c-debug-in-sws-face)
1420 ; (setq in-face nil))
1421 ; (setq in-face (point)))
1432 ,@(when (facep 'c-debug-is-sws-face)
1433 `((c-debug-add-face beg end 'c-debug-is-sws-face)))))
1439 ,@(when (facep 'c-debug-is-sws-face)
1440 `((c-debug-add-face beg end 'c-debug-in-sws-face)))))
1446 ,@(when (facep 'c-debug-is-sws-face)
1447 `((c-debug-remove-face beg end 'c-debug-is-sws-face)))))
1453 ,@(when (facep 'c-debug-is-sws-face)
1454 `((c-debug-remove-face beg end 'c-debug-in-sws-face)))))
1460 ,@(when (facep 'c-debug-is-sws-face)
1461 `((c-debug-remove-face beg end 'c-debug-is-sws-face)
1462 (c-debug-remove-face beg end 'c-debug-in-sws-face)))))
1466 ;; `c-forward-sws' or `c-backward-sws' are used outside
1467 ;; `c-save-buffer-state' or similar then this will remove the cache
1538 ;; inside a line comment or cpp directive we must set `rung-pos' as
1555 (or (get-text-property (1- (point)) 'c-is-sws)
1601 (or (bobp)
1620 (if (or
1622 ;; either from a marked rung or from a completely uncached
1625 (or rung-is-marked
1669 ;; possible since we can't be in the ending ws of a line comment or
1679 ;; comment or macro).
1841 ;; comment or cpp directive that's been partially
1852 (if (or
1853 ;; Cache if we started either from a marked rung or from a
1902 ;; comment or macro).
1926 ;; Is the region (beg end) WS, and is there WS (or BOB/EOB) next to the
1936 (or (progn (goto-char (max (point-min) (1- beg)))
1967 ;; It's a position inside one of the recorded unclosed parens or the
1968 ;; top level, but not further nested inside any literal or subparen
1980 ;; at POS or higher. This is much like `c-whack-state-after', but
1984 (while (and (or c-state-cache
1990 (or (< pos (cdr elem))
1994 (or (<= pos elem)
2008 (while (not (or (bobp) (zerop cnt)))
2017 ;; beginning of the top-level construct we are in, or the beginning
2020 ;; The returned value is a list of the noteworthy parens with the
2021 ;; last one first. If an element in the list is an integer, it's
2048 (in-macro-start (or c-macro-start (point)))
2082 (if (or (not last-pos)
2135 (c-up-list-forward last-pos)))
2207 (when (and (or set-good-pos set-brace-pair)
2208 (or (>= pos in-macro-start)
2231 ;; outside a macro or within the same macro as point, and
2236 (when (and (or (>= last-pos in-macro-start)
2249 (if (setq last-pos (c-up-list-forward pos))
2254 (setq pos (c-up-list-backward pos)
2257 (when (or (not pos)
2290 (goto-char (or (c-least-enclosing-brace res2) (point)))
2292 (while (not (or (bobp) (eq (char-after) ?{)))
2312 (let* ((newstate (list nil))
2320 (setcdr ptr (list car))
2325 ;; Whack off any state information from PAREN-STATE which lies at or
2357 ;; bufpos, or nil if none was found.
2359 (or bufpos (setq bufpos 134217727))
2363 (if (or (consp enclosingp)
2370 ;; Return the bufpos of the outermost enclosing open paren, or nil
2386 ;; A "safe" position is a position at or after a recorded open
2387 ;; paren, or after a recorded close paren. The returned position is
2388 ;; thus either the first position after a close brace, or the first
2389 ;; position after an enclosing paren, or at the enclosing paren in
2413 ;; any string literal or comment. `c-state-cache' is used if it has
2439 ;; outside a comment or string in current emacsen). FIXME:
2450 "Return non-nil if the point is on or directly after an identifier.
2464 (or
2488 (or (not c-opt-op-identifier-prefix)
2508 (or (< (skip-syntax-backward "w_") 0)
2532 (while (let ((pos (or (and (looking-at c-nonsymbol-token-regexp)
2536 ;; or paren syntax, but consume one char in case
2559 ;; we've skipped backward over punctuator or paren
2581 token or not moved at all. COUNT specifies the number of tokens to
2588 The case when LIMIT is set in the middle of a token, comment or macro
2591 Return the number of tokens left to move \(positive or negative). If
2601 (or count (setq count 1))
2670 (or count (setq count 1))
2674 (or limit (setq limit (point-min)))
2695 (or (/= (char-after) ?#)
2702 (or (bobp)
2756 or string literals are ignored. The start point is assumed to be
2757 outside any comment, macro or string literal, or else the content of
2762 outside the current list sexp, which has the effect that if the point
2765 the current list sexp is encountered first.
2775 isn't used or if that subexpression didn't match then the start
2782 i.e. the end of comments or cpp directives. This since the function
2794 (or bound (setq bound (point-max)))
2830 (or (not paren-level)
2840 ;; syntactic whitespace (i.e. strings or in nested
2863 ;; Match in the middle of the opener of a block or line
2902 (signal 'search-failed (list regexp)))))
2906 (if (or lookbehind-submatch
2928 (t (signal 'search-failed (list regexp)))))
2931 (or (< check-pos last-token-end-pos)
2951 (or (/= search-pos (point))
2955 (signal 'search-failed (list regexp)))
2963 ;;(message "c-syntactic-re-search-forward done %s" (or (match-end 0) (point)))
2978 i.e. don't stop at positions inside syntactic whitespace or string
2985 However, if LIMIT or the buffer limit is reached inside a nested paren
2995 ;; A list of syntactically relevant positions in descending
2999 safe-pos-list
3000 ;; The position at the beginning of `safe-pos-list'.
3002 ;; The result from `c-beginning-of-macro' at the start position or the
3023 (while (and safe-pos-list
3024 (> (car safe-pos-list) (point)))
3025 (setq safe-pos-list (cdr safe-pos-list)))
3026 (unless (setq safe-pos (car-safe safe-pos-list))
3027 (setq safe-pos (max (or (c-safe-position
3028 (point) (or c-state-cache
3032 safe-pos-list (list safe-pos)))
3040 ;; safe-pos is in a nested list. That's both uncommon
3047 safe-pos-list (cons safe-pos safe-pos-list)))
3050 ((or (elt state 3) (elt state 4))
3051 ;; Inside string or comment. Continue search at the
3066 ;; Now check whether it precedes or is
3076 ;; so the hit was inside a nested list. Go up
3089 (goto-char (or limit (point-min)))
3092 ;; The hit was outside the list at the start
3093 ;; position. Go to the start of the list and exit.
3100 (or start-macro-beg
3117 ;; positions into the list.
3120 safe-pos-list (cons safe-pos safe-pos-list))))
3164 ;;i.e. don't stop at positions inside syntactic whitespace or string
3166 ;;point is within a comment, string literal or preprocessor directory to
3173 ;;However, if LIMIT or the buffer limit is reached inside a nested paren
3212 ;; ;; We're at the end of a string literal or paren
3223 ;; ;; At the end of some syntactic ws or possibly
3233 ;; ;; Now the point is either at `stop-pos' or at some
3256 is non-nil and in a preprocessor line, or nil if somewhere else.
3258 or nil, `c-beginning-of-defun' is used.
3271 (lim (or lim (progn
3328 "Return a cons of the beginning and end positions of the comment or
3329 string surrounding point (including both delimiters), or nil if point
3344 (lim (or lim (progn
3351 (cons (point) (or (c-safe (c-forward-sexp 1) (point))
3374 (cons (point) (or (c-safe (c-forward-sexp 1) (point))
3377 ((looking-at c-comment-start-regexp) ; Line or block comment.
3411 empty lines or non-whitespace characters between them). Otherwise the
3446 returns nil or the type of literal that the range surrounds. It's
3457 ((or (looking-at "//") ; c++ line comment
3479 ;; the syntactic whitespace less or equal to some start position.
3484 ;; at `c-find-decl-syntactic-pos', or nil if there's no such match.
3495 ; (defface c-debug-decl-spot-face
3497 ; "Debug face to mark the spots where `c-find-decl-spots' stopped.")
3498 ; (defface c-debug-decl-sws-face
3500 ; "Debug face to mark the syntactic whitespace between the declaration
3504 (when (facep 'c-debug-decl-spot-face)
3506 (c-debug-add-face (max match-pos (point-min)) decl-pos
3507 'c-debug-decl-sws-face)
3508 (c-debug-add-face decl-pos (min (1+ decl-pos) (point-max))
3509 'c-debug-decl-spot-face))))
3511 (when (facep 'c-debug-decl-spot-face)
3513 (c-debug-remove-face ,beg ,end 'c-debug-decl-spot-face)
3514 (c-debug-remove-face ,beg ,end 'c-debug-decl-sws-face))))
3536 ;; Find the next `c-decl-prefix-or-start-re' match if we haven't
3544 (re-search-forward c-decl-prefix-or-start-re
3547 ;; Match. Check if it's inside a comment or string literal.
3548 (c-got-face-at
3566 (point) 'face nil cfd-limit))
3568 (c-got-face-at (point) c-literal-faces)))))
3597 (defun c-find-decl-spots (cfd-limit cfd-decl-re cfd-face-checklist cfd-fun)
3598 ;; Call CFD-FUN for each possible spot for a declaration, cast or
3603 ;; `c-decl-prefix-or-start-re' when that submatch matches.
3604 ;; o The start of each `c-decl-prefix-or-start-re' match when
3610 ;; Only a spot that match CFD-DECL-RE and whose face is in the
3611 ;; CFD-FACE-CHECKLIST list causes CFD-FUN to be called. The face
3622 ;; preceding the spot, or 0 for the implicit match at bob. The
3629 ;; It's however the positions where `c-decl-prefix-or-start-re'
3651 ;; with `c-decl-prefix-or-start-re'. `cfd-limit' if there's
3654 ;; The end position of the last `c-decl-prefix-or-start-re'
3672 ;; hits inside macros or at `c-decl-end' positions inside
3679 ;; before the point, and do the first `c-decl-prefix-or-start-re'
3684 ;; statement or declaration, which is earlier than the first
3689 ;; Begin by backing out of comment or string literals.
3691 (when (c-got-face-at (point) c-literal-faces)
3696 (c-got-face-at (1- (point)) c-literal-faces))
3698 (point) 'face nil (point-min))))
3703 (eq (get-text-property (point) 'face)
3704 'font-lock-string-face)
3713 ;; arrived at something that looks like a start or else
3723 ;; only check that if the limit is at or before bonl to save
3731 (point) 'face nil cfd-limit))
3733 (c-got-face-at (point) c-literal-faces))))
3792 ;; letting `c-decl-prefix-or-start-re' match bob, so that
3807 ;; The closest continue position that might have effect at or
3810 ;; region is completely within a literal or macro.
3820 (goto-char (or start-in-literal cfd-start-pos))
3889 ;; within a literal or macro. `cfd-continue-pos' is set to a
3899 (or
3907 ;; If `cfd-continue-pos' is less or equal to
3928 (when (or (>= (point) cfd-limit)
3930 (and cfd-face-checklist
3931 (not (c-got-face-at
3932 (point) cfd-face-checklist))))
3993 ;; `c-forward-decl-or-cast-1').
3999 ;; arglist replaced with "<>" in references or "<" for the one in the
4022 ;; or added in the middle. We'd need the position of point when the
4043 (defun c-list-found-types ()
4044 ;; Return all the types in `c-found-types' as a sorted list of
4046 (let (type-list)
4048 (setq type-list (cons (symbol-name type)
4049 type-list)))
4051 (sort type-list 'string-lessp)))
4084 (or (= beg end) ; removal of WS
4101 ;; c-recognize-<>-arglists' is set. It ensures that no "<" or ">"
4103 ;; or ">=".
4109 (when (or (looking-at "[<>]")
4124 (when (or (looking-at "[<>]")
4138 ;; treat possible types (i.e. those that it normally returns 'maybe or
4163 ;; template or not. We can't do that, so we assume it is a template
4165 ;; comparison expressions on the forms "a < b > c" or "a < b, c > d"
4176 ;; `c-forward-name', `c-forward-type', `c-forward-decl-or-cast-1', and
4233 ;; over a type (if TYPE is 'type) or a name (otherwise) which
4236 ;; with a keyword. Return t if a known or found type is moved
4239 ;; if TYPE is 'type or as a reference if TYPE is 'ref.
4255 (defmacro c-forward-id-comma-list (type update-safe-pos)
4257 ;; over a comma separated list of types or names using
4276 ;; recognized are those specified by `c-type-list-kwds',
4277 ;; `c-ref-list-kwds', `c-colon-type-list-kwds',
4285 ;; Note that for `c-colon-type-list-kwds', which doesn't necessary
4286 ;; apply directly after the keyword, the type list is moved over
4288 ;; that isn't moved over due to some other keyword list). The
4289 ;; identifier ranges in the list are still recorded if that should
4308 ((and (c-keyword-member kwd-sym 'c-type-list-kwds)
4310 ;; There's a type directly after a keyword in `c-type-list-kwds'.
4311 (c-forward-id-comma-list type t))
4313 ((and (c-keyword-member kwd-sym 'c-ref-list-kwds)
4315 ;; There's a name directly after a keyword in `c-ref-list-kwds'.
4316 (c-forward-id-comma-list ref t))
4323 (when (and (setq pos (c-up-list-forward))
4351 (when (c-keyword-member kwd-sym 'c-colon-type-list-kwds)
4354 ;; list after it.
4359 (c-forward-id-comma-list type t)))
4361 ;; ranges in the type list later on should still be
4366 ;; this one, we match `c-colon-type-list-re' after the
4369 (looking-at c-colon-type-list-re))
4374 ;; There's a type after the `c-colon-type-list-re' match
4375 ;; after a keyword in `c-colon-type-list-kwds'.
4376 (c-forward-id-comma-list type nil))))
4443 (if (and (c-go-up-list-forward)
4451 ;; to narrowing or some temporary change.
4489 (or (when (eq (char-after) ?>)
4520 ;; Either an operator starting with '>' or the end of
4540 ;; Either an operator starting with '<' or a nested arglist.
4553 ;; bracket arglist, or a keyword in
4554 ;; `c-<>-type-kwds' or `c-<>-arglist-kwds'.
4558 (when (or (setq keyword-match
4580 ;; or reference depending on whether the arglist is last
4607 (or c-record-found-types t)))))
4628 (if (and (c-go-up-list-backward)
4641 ;; Stopped at bob or a char that isn't allowed in an
4678 ;; could be something as simple as "foo" in C or something as
4686 ;; or t if it's some other kind of name.
4729 ;; Handle a C++ operator or template identifier.
4745 ;; '*', '&' or a name followed by ":: *",
4792 (when (or c-opt-identifier-concat-key
4842 ;; type that can't be a name or other expression, 'known if it's an
4846 ;; that might be a type, or nil if it can't be a type (the point
4905 (or (not id-end)
4913 ;; Looking at a primitive or known type identifier. We've
4920 (or c-promote-possible-types (eq res t)))
4956 (if (or res c-promote-possible-types)
5003 (let* ((c-promote-possible-types (or (memq res '(t known))
5062 ;; Macro used inside `c-forward-decl-or-cast-1'. It ought to be a
5063 ;; defsubst or perhaps even a defun, but it contains lots of free
5064 ;; variables that refer to things inside `c-forward-decl-or-cast-1'.
5066 ;; `c-forward-decl-or-cast-1' can consume an arbitrary length list
5093 (or at-type-decl
5095 (or maybe-typeless
5102 (defun c-forward-decl-or-cast-1 (preceding-token-end context last-cast-end)
5103 ;; Move forward over a declaration or a cast if at the start of one.
5105 ;; returned if no declaration or cast is recognized, and the point
5149 ;; Use a value less than or equal to (point-min) if the point is at
5157 ;; nil Some other context or unknown context.
5160 ;; preceding cast, or nil if none is known. If
5161 ;; `c-forward-decl-or-cast-1' is used in succession, it should be
5180 ;; believe is the type in the declaration or cast, after any
5208 ;; Whether we've found a declaration or a cast. We might know
5213 at-decl-or-cast
5222 ;; that it isn't a declaration or cast.
5241 ;; Found a known or possible type or a prefix of a known type.
5246 (setq at-decl-or-cast 'ids)
5278 (setq at-decl-or-cast t)
5295 ;; specifier or a type prefix, so set the backup
5312 (setq at-decl-or-cast t)
5345 ;; "foo::foo" or "foo::~foo", i.e. if it's the name of a
5374 ;; that is or might be a type. This can't be skipped since we
5443 (or got-identifier
5479 (or backup-at-type
5484 (setq pos (c-up-list-forward (point)))
5492 (when (and (or maybe-typeless backup-maybe-typeless)
5502 at-decl-or-cast
5503 (catch 'at-decl-or-cast
5513 (throw 'at-decl-or-cast (eq at-decl-or-cast t)))
5528 (when (and (or at-type maybe-typeless)
5529 (not (or got-prefix got-parens)))
5532 (throw 'at-decl-or-cast t))
5537 (or backup-at-type
5543 ;; declarator and "gnu" a function argument or initializer (if
5555 ;; Got a plain list of identifiers. If a colon follows it's
5562 (throw 'at-decl-or-cast (eq at-decl-or-cast t))
5564 (throw 'at-decl-or-cast t)))
5569 ;; Got a plain list of identifiers followed by some suffix.
5574 (throw 'at-decl-or-cast t)))
5581 (throw 'at-decl-or-cast t))
5594 ;; type, else we require that it's known or found
5596 (or (and (not c-recognize-knr-p)
5604 (throw 'at-decl-or-cast t)
5605 ;; Can't be a valid declaration or cast, but if we've found a
5607 ;; an invalid/unfinished declaration or cast.
5608 (throw 'at-decl-or-cast at-decl-or-cast))))
5614 (or backup-at-type
5618 (or (not got-suffix)
5629 ;; looking at either `c-after-suffixed-type-decl-key' or "[;,]".
5639 (when (and got-prefix (or got-parens got-suffix))
5640 ;; Require `got-prefix' together with either `got-parens' or
5649 (throw 'at-decl-or-cast t))
5657 ;; normal function call afterall (or perhaps a C++ style object
5659 (throw 'at-decl-or-cast nil))))
5661 (when at-decl-or-cast
5664 (throw 'at-decl-or-cast t))
5682 (throw 'at-decl-or-cast t))
5684 (when (and (or got-prefix (not got-parens))
5688 (throw 'at-decl-or-cast t))
5690 ;; If we get here we can't tell if this is a type decl or a normal
5697 (unless (or at-decl-end (looking-at "=[^=]"))
5698 ;; If this is a declaration it should end here or its initializer(*)
5706 ;; If `at-decl-or-cast' is then we've found some other sign that
5707 ;; it's a declaration or cast, so then it's probably an
5709 (throw 'at-decl-or-cast at-decl-or-cast))
5717 (throw 'at-decl-or-cast t))
5725 (or (memq identifier-type '(found known))
5729 ;; type name being checked against the list of
5732 (or (save-excursion
5748 (throw 'at-decl-or-cast t))
5754 (or at-decl-end (looking-at "=[^=]"))
5762 (throw 'at-decl-or-cast t))
5764 (when (and (or got-suffix-after-parens
5768 ;; Got something like "a (*b) (c);" or "a (b) = c;". It could
5769 ;; be an odd expression or it could be a declaration. Treat
5772 (throw 'at-decl-or-cast t)))
5775 (or got-prefix
5778 (or got-parens got-suffix))))
5781 ;; `got-parens' or `got-suffix' is set it's "a()", "a[]", "a()[]",
5782 ;; or similar, which we accept only if the context rules out
5784 (throw 'at-decl-or-cast t)))
5819 (or
5824 ;; it as a cast if it's a type decl or if we've
5826 (or at-decl-or-cast
5836 (or (not (looking-at c-nonsymbol-token-regexp))
5839 ;; There should either be a cast before it or something that isn't an
5840 ;; identifier or close paren.
5844 (or (eq (point) last-cast-end)
5868 (at-decl-or-cast
5903 ;; (ii) A case label - either the entire construct "case FOO:", or just the
5905 ;; (iii) a keyword which needs a colon, like "default:" or "private:"; We
5918 ;; The end of the label is taken to be just after the colon, or the end of
5921 ;; `c-decl-end' to improve recognition of the following declaration or
5929 ;; syntactic ws from the point. Use a value less than or equal to
5947 ;; "case" or "default" (Doesn't apply to AWK).
5979 ;; @private, @protected, @public, in Objective C, or similar.
5998 (or
6013 (or
6020 (or (looking-at c-label-prefix-re)
6026 (or
6030 (or (looking-at c-label-prefix-re)
6067 ;; Check that the next nonsymbol token is ":", or that we're in one
6082 ;; QT double keyword like "protected slots:" or goto target.
6162 ;; types here since the protocol reference list might then be
6163 ;; considered part of the preceding name or superclass-name.
6166 (if (or
6192 ;; Look for ": superclass-name" or "( category-name )".
6203 ;; Look for a protocol reference list.
6220 (defun c-beginning-of-inheritance-list (&optional lim)
6228 (while (and (or (looking-at c-symbol-start)
6248 ;; This should be called with point inside an argument list.
6259 (backward-up-list 1)
6266 enclosing block (such function definition), or only inside a class,
6267 namespace or other block that contains another declaration level.
6280 (or (not (c-most-enclosing-brace paren-state))
6285 ;; list of a function and its opening brace (or semicolon in case it
6291 ;; function header (see `c-forward-decl-or-cast-1' for details) and
6305 (not (or (c-major-mode-is 'objc-mode)
6309 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil)))
6312 ;; There should not be a '=' or ',' between beg and the
6315 (or (> (point) beg)
6337 ;; inside a K&R style argument declaration list, nil otherwise.
6339 ;; position that bounds the backward search for the argument list.
6352 (lim (max (or lim (point-min)) (or macro-start (point-min))))
6356 ;; Search backwards for the defun's argument list. We give up if we
6357 ;; encounter a "}" (end of a previous defun) or BOB.
6359 ;; The criterion for a paren structure being the arg list is:
6362 ;; o - it is preceded by either an identifier (the function name) or
6364 ;; o - its content is a non-empty comma-separated list of identifiers
6365 ;; (an empty arg list won't have a knr region).
6381 (t ; either } (hit previous defun) or no more parens/brackets
6385 ;; We're inside a paren. Could it be our argument list....?
6390 (unless (c-go-list-backward) (throw 'knr nil)) ;
6394 ;; It can't be the arg list if next token is ; or {
6399 ;; Is the thing preceding the list an identifier (the
6400 ;; function name), or a macro expansion?
6404 (or (c-on-identifier)
6406 (c-go-up-list-backward)
6410 ;; Have we got a non-empty list of comma-separated
6418 (catch 'id-list
6421 (unless (c-on-identifier) (throw 'id-list nil))
6425 ;; ...Yes. We've identified the function's argument list.
6431 ;; ...No. The current parens aren't the function's arg list.
6434 (or (c-go-list-backward) ; backwards over [ .... ]
6463 (or (looking-at c-block-stmt-1-key)
6481 (or (not c-opt-op-identifier-prefix)
6512 ;; starts, or the first variable initializer, or the ending
6514 ;; (syntactically relevant) '{', '=' or ';' token. Point is left
6515 ;; _after_ the first found token, or at point-max if none is found.
6526 (or
6535 (if (c-safe (goto-char (c-up-list-forward (point))))
6547 ;; Go to the beginning of the current declaration, or the beginning
6570 ;; or an open paren.
6573 ;; after a ;, }, or :, or at BOB or the start of a macro or start of
6623 ;; If they were brace list initializers we might not have moved over a
6637 ; no more, or get to one which isn't an "operator ="
6650 (c-safe (goto-char (c-up-list-forward (point))) t)
6660 ;; or C++. If a proper end was found then t is returned, otherwise
6685 (goto-char (c-up-list-forward (point)))
6688 (if (or (not c-opt-block-decls-with-vars-key)
6723 ;; statement block or a brace list, and if so return non-nil.
6734 ;; paren, or nil if none.
6765 ;; first possible position of a leading specifier list.
6778 (or
6798 (not (or (looking-at c-symbol-start)
6801 ;; In Pike a list of modifiers may be followed by a brace
6820 ;; earliest possible position where the specifier list can
6829 ;; like `c-forward-decl-or-cast-1' skip forward over
6874 ;; return the buffer position of the beginning of the brace list
6875 ;; statement if we're inside a brace list, otherwise return nil.
6885 (or
6886 ;; This will pick up brace list declarations.
6892 (if (and (or (looking-at c-brace-list-key)
6894 (looking-at c-brace-list-key)))
6895 (setq bracepos (c-down-list-forward (point)))
6924 ;; see if the open brace is preceded by = or [...] in
6929 (when (and c-opt-inexpr-brace-list-key
6931 ;; In Java, an initialization brace list may follow
6937 ((looking-at c-opt-inexpr-brace-list-key) t)
6941 ;; or another "[]" sexp.
6966 (or (eq (char-after) ?`)
7001 ;; we've hit the beginning of the aggregate list
7009 (defun c-looking-at-special-brace-list (&optional lim)
7010 ;; If we're looking at the start of a pike-style list, ie `({�})',
7013 ;; otherwise. The ending position is nil if the list is still open.
7015 ;; the `(' or at the following paren character. Tries to check the
7018 ;; a special brace list).
7063 (if (or (/= (char-syntax (char-before)) ?\))
7069 (cons (list beg) type)))))
7073 ;; Return non-nil if between two statements or declarations, assuming
7074 ;; point is not inside a literal or comment.
7076 ;; Obsolete - `c-at-statement-start-p' or `c-at-expression-start-p'
7086 ;; either 'inlambda, 'inexpr-statement or 'inexpr-class and the
7090 ;; position of the closest containing list. If it's nil, the
7092 ;; expression or not. If both LIM and CONTAINING-SEXP are used, LIM
7104 (closest-lim (or containing-sexp lim (point-min)))
7125 (or (not (looking-at c-class-key))
7150 (when (or (not passed-paren)
7175 (if (or (save-excursion
7177 (and (> (point) (or lim (point-min)))
7180 (c-looking-at-special-brace-list)))
7227 ;; Like `c-add-syntax' but appends to the end of the syntax list.
7230 (list (cons symbol args)))))
7245 ;; find a statement or block start that begins at boi without a
7246 ;; label or comment.
7253 ;; SYNTAX-EXTRA-ARGS are a list of the extra arguments for the
7284 (while (or (/= (point) boi)
7297 ;; Skip to the beginning of this statement or backward
7324 ;; over previous or containing statements to try to
7349 ;; Don't stop in the middle of a special brace list opener
7352 (let ((special-list (c-looking-at-special-brace-list)))
7353 (when (and special-list
7354 (< (car (car special-list)) (point)))
7355 (setq containing-sexp (car (car special-list)))
7376 (or (not (looking-at "\\>"))
7458 beg-of-same-or-containing-stmt
7462 ;; cases 18 and 10. It's a continued statement or top level
7467 (let (special-brace-list)
7473 ;; CASE B: open braces for class or brace-lists
7474 ((setq special-brace-list
7475 (or (and c-special-brace-lists
7476 (c-looking-at-special-brace-list))
7484 (setq beg-of-same-or-containing-stmt (point))))
7485 (c-add-syntax 'class-open beg-of-same-or-containing-stmt))
7487 ;; CASE B.2: brace-list-open
7488 ((or (consp special-brace-list)
7490 (goto-char beg-of-same-or-containing-stmt)
7494 ;; brace-list-open, but we normally report it simply as a
7496 ;; brace-list-open for brace lists as top-level constructs,
7504 'brace-list-open
7521 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
7536 ;; CASE C: iostream insertion or extraction operator
7539 (goto-char beg-of-same-or-containing-stmt)
7553 ;; declarations or throws clauses there.
7570 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
7598 step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos
7609 ;; The open paren of the closest surrounding sexp or nil if
7613 ;; (nested sexps are ignored), or the position after
7614 ;; `containing-sexp' if there is none, or (point-min) if
7617 ;; The paren state outside `containing-sexp', or at
7664 ;; If we're in a parenthesis list then ',' delimits the
7693 ;; CASE 2: in a C or C++ style comment.
7713 (or (not c-syntactic-indentation-in-macros)
7721 ;; or anywhere in a non-#define directive.
7748 ;; CASE 13: A catch or finally clause? This case is simpler
7778 (or (not (eq char-before-ip ?}))
7840 ;; CASE 14: A case or default label
7903 ;; It's a statement block or an anonymous class.
7906 ;; lambda keyword and the argument list or at the defun
7919 ;; CASE 5: Line is inside a declaration level block or at top level.
7920 ((or containing-decl-open (null containing-sexp))
7923 ;; CASE 5A: we are looking at a defun, brace list, class,
7924 ;; or inline-inclass method opening brace
7925 ((setq special-brace-list
7926 (or (and c-special-brace-lists
7927 (c-looking-at-special-brace-list))
7960 ;; CASE 5A.3: brace list open
7967 (or (consp special-brace-list)
7968 (and (or (save-excursion
7974 (and c-opt-inexpr-brace-list-key
7976 (looking-at c-opt-inexpr-brace-list-key)
7979 (looking-at c-brace-list-key))
7990 ;; belongs to a "new Foo[]" initialization list,
7991 ;; which means the brace list is part of an
7995 ;; is brace-list-open, on the same grounds as in
8000 (c-add-syntax 'brace-list-open placeholder)))
8016 (if (or containing-decl-open macro-start)
8022 ;; CASE 5B: After a function header but before the body (or
8029 ;; CASE 5B.1: Member init list.
8031 (if (or (> tmp-pos indent-point)
8057 ;; CASE 5B.4: Nether region after a C++ or Java func
8065 ;; line, or continuation of a multiple inheritance
8066 ((or (and (c-major-mode-is 'c++-mode)
8072 (and (or (eq char-before-ip ?:)
8098 ((or (not (c-safe (c-forward-sexp -1) t))
8146 (c-beginning-of-inheritance-list lim)
8153 ;; member init list continuation, or a template argument
8154 ;; list continuation.
8163 (or
8170 (or (c-backward-<>-arglist nil lim)
8187 ;; CASE 5D.3: perhaps a template list continuation?
8193 (setq placeholder (c-up-list-backward))
8307 ;; CASE 5P: AWK pattern or function or continuation
8320 ;; definition or some other block declaration that doesn't
8353 (or (memq char-before-ip '(?\; ?{ ?} nil))
8446 ;; likely we are either in a function prototype or a function
8447 ;; call argument list
8448 ((not (or (and c-special-brace-lists
8451 (c-looking-at-special-brace-list)))
8460 (if (and (c-safe (backward-up-list 1) t)
8466 (c-add-stmt-syntax 'arglist-close (list containing-sexp) t
8471 ;; in-expression block or brace list. C.f. cases 4, 16A
8478 (setq tmpsymbol '(brace-list-open . inexpr-class))
8498 ;; argument list. Use arglist-close if we're actually
8499 ;; looking at a close paren or bracket.
8503 (if (and (c-safe (backward-up-list 1) t)
8509 (c-add-stmt-syntax 'arglist-intro (list containing-sexp) t
8542 ;; for-list continuation line. C.f. case 7A.
8551 (if (and (c-safe (backward-up-list 1) t)
8557 (c-add-stmt-syntax 'arglist-cont-nonempty (list containing-sexp) t
8588 (c-beginning-of-inheritance-list lim)
8592 ;; CASE 9: we are inside a brace-list
8594 (setq special-brace-list
8595 (or (and c-special-brace-lists ;;;; ALWAYS NIL FOR AWK!!
8598 (c-looking-at-special-brace-list)))
8602 ;; CASE 9A: In the middle of a special brace list opener.
8603 ((and (consp special-brace-list)
8607 (eq char-after-ip (car (cdr special-brace-list))))
8608 (goto-char (car (car special-brace-list)))
8620 (c-add-syntax 'brace-list-open (c-point 'boi))))
8622 ;; CASE 9B: brace-list-close brace
8623 ((if (consp special-brace-list)
8624 ;; Check special brace list closer.
8626 (goto-char (car (car special-brace-list)))
8630 (or
8633 (eq (1+ (point)) (cdr (car special-brace-list))))
8635 (and (eq (char-after) (cdr (cdr special-brace-list)))
8637 (eq (1+ (point)) (cdr (car special-brace-list)))))))
8638 ;; Normal brace list check.
8640 (c-safe (goto-char (c-up-list-backward (point))) t)
8643 (c-add-syntax 'brace-list-close (point))
8646 (c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
8651 (if (consp special-brace-list)
8653 (goto-char (car (car special-brace-list)))
8663 ;; CASE 9C: we're looking at the first line in a brace-list
8665 (if (consp special-brace-list)
8666 (goto-char (car (car special-brace-list)))
8669 (c-add-syntax 'brace-list-intro (point))
8672 (c-add-stmt-syntax 'brace-list-intro nil t lim paren-state)))
8674 ;; CASE 9D: this is just a later brace-list-entry or
8676 (t (if (or (eq char-after-ip ?{)
8681 (c-looking-at-special-brace-list (point)))))
8683 (c-add-syntax 'brace-list-entry (point))
8687 ;; CASE 10: A continued statement or top level construct.
8690 (or (not (eq char-before-ip ?}))
8704 ;; CASE 16: block close brace, possibly closing the defun or
8720 ;; CASE 16A: closing a lambda defun or an in-expression
8740 ;; CASE 16B: does this close an inline or a function in
8759 ;; in a statement block, e.g. in Pike or when using gcc
8771 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
8806 ;; CASE 17: Statement or defun catchall.
8815 (setq step-type (or step-type last-step-type))
8884 ;; CASE 17F: first statement in an inline, or first
8889 (or (not (setq placeholder (c-most-enclosing-brace
8913 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
8967 ;; Start of or a continuation of a preprocessor directive?
8975 (when (or
8977 (not (or
8994 (or (not (c-forward-to-cpp-define-body))
9010 ;; offset can be a number, a function, a variable, a list, or one of
9011 ;; the symbols + or -
9107 (if (or (null res) (integerp res)
9115 ;; Get offset from LANGELEM which is a list beginning with the
9117 ;; That data may be zero or more elements, but if at least one is
9118 ;; given then the first is the anchor position (or nil). The symbol
9133 (or (and (numberp offset) offset)
9142 ;; new list form.
9146 (c-calc-offset (list (c-langelem-sym langelem)
9158 ;; precede topmost-intro in the LANGELEMS list.
9171 ;; further down the langelems list.