Function: c-ts-mode--compute-optional-keywords

c-ts-mode--compute-optional-keywords is a byte-compiled function defined in c-ts-mode.el.gz.

Signature

(c-ts-mode--compute-optional-keywords MODE)

Documentation

Return a list of keywords that are supported by the grammar.

MODE should be either c or cpp.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/c-ts-mode.el.gz
(defun c-ts-mode--compute-optional-keywords (mode)
  "Return a list of keywords that are supported by the grammar.
MODE should be either `c' or `cpp'."
  (if (eq mode 'c)
      (mapcan
       (lambda (entry)
         (let ((keywords (cdr entry)))
           (if (treesit-query-valid-p 'c `([,@keywords] @cap))
               (copy-sequence keywords)
             nil)))
       c-ts-mode--optional-c-keywords)
    ;; As for now, there aren't additional optional keywords for C++.
    ()))