Function: bazelignore--syntax-propertize

bazelignore--syntax-propertize is a natively compiled function defined in bazel.el.

Signature

(bazelignore--syntax-propertize START END)

Documentation

Detect .bazelignore syntax between START and END.

‘bazelignore-mode’ uses this as ‘syntax-propertize-function’.
See Info node (elisp) Syntax Properties and Info node (elisp) Syntax Table Internals.

Source Code

;; Defined in /nix/store/ws8pkszjvcad1rgzqw6wja7qxacylfhn-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20261002.1510/bazel.el
(defun bazelignore--syntax-propertize (start end)
  "Detect .bazelignore syntax between START and END.
‘bazelignore-mode’ uses this as ‘syntax-propertize-function’.
See Info node ‘(elisp) Syntax Properties’
and Info node ‘(elisp) Syntax Table Internals’."
  (declare (ftype (function (integer integer) null)))
  (save-excursion
    (goto-char start)
    (let ((case-fold-search nil)
          (search-spaces-regexp nil))
      (while (re-search-forward (rx bol ?#) end t)
        ;; 11 = comment start, 12 = comment end
        (put-text-property (match-beginning 0) (match-end 0)
                           'syntax-table '(11))
        (end-of-line)
        (unless (eobp)                  ; otherwise (1+ (point)) is invalid
          (put-text-property (point) (1+ (point))
                             'syntax-table '(12))))))
  nil)