Variable: c-ts-mode--preproc-indent-rules

c-ts-mode--preproc-indent-rules is a variable defined in c-ts-mode.el.gz.

Value

(((node-is "preproc") column-0 0) ((node-is "#endif") column-0 0)
 ((match "preproc_call" "compound_statement") column-0 0)
 ((prev-line-is "#endif") c-ts-mode--prev-sibling 0)
 ((n-p-gp nil "preproc" "translation_unit") column-0 0)
 ((and no-node (parent-is "\\(?:\n\\|preproc\\)"))
  c-ts-mode--standalone-parent c-ts-mode--preproc-offset)
 ((match nil "preproc_\\(?:\\(?:el\\)?if\\)" nil 3 3)
  c-ts-mode--standalone-parent c-ts-mode-indent-offset)
 ((match nil "preproc_ifdef" nil 2 2) c-ts-mode--standalone-parent
  c-ts-mode-indent-offset)
 ((match nil "preproc_else" nil 1 1) c-ts-mode--standalone-parent
  c-ts-mode-indent-offset)
 ((parent-is "preproc") c-ts-mode--prev-sibling 0))

Documentation

Indent rules for preprocessors.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/c-ts-mode.el.gz
(defvar c-ts-mode--preproc-indent-rules
  `(((node-is "preproc") column-0 0)
    ((node-is "#endif") column-0 0)
    ((match "preproc_call" "compound_statement") column-0 0)
    ((prev-line-is "#endif") c-ts-mode--prev-sibling 0)
    ;; Top-level things under a preproc directive.  Note that
    ;; "preproc" matches more than one type: it matches
    ;; preproc_if, preproc_elif, etc.
    ((n-p-gp nil "preproc" "translation_unit") column-0 0)
    ;; Indent rule for an empty line after a preproc directive.
    ((and no-node (parent-is ,(rx (or "\n" "preproc"))))
     c-ts-mode--standalone-parent c-ts-mode--preproc-offset)
    ;; Statement under a preproc directive, the first statement
    ;; indents against parent, the rest statements indent to
    ;; their prev-sibling.
    ((match nil ,(rx "preproc_" (or "if" "elif")) nil 3 3)
     c-ts-mode--standalone-parent c-ts-mode-indent-offset)
    ((match nil "preproc_ifdef" nil 2 2)
     c-ts-mode--standalone-parent c-ts-mode-indent-offset)
    ((match nil "preproc_else" nil 1 1)
     c-ts-mode--standalone-parent c-ts-mode-indent-offset)
    ((parent-is "preproc") c-ts-mode--prev-sibling 0))
  "Indent rules for preprocessors.")