Function: web-mode-annotate-comment
web-mode-annotate-comment is a natively compiled function defined in
web-mode.el.
Signature
(web-mode-annotate-comment BEG END)
Source Code
;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-annotate-comment (beg end)
(save-excursion
;;(message "beg=%S end=%S" beg end)
(goto-char beg)
(when (looking-at-p "/\\*\\*")
(while (re-search-forward "\\(.+\\)" end t)
(font-lock-prepend-text-property (match-beginning 1) (match-end 1)
'font-lock-face
'web-mode-annotation-face))
(goto-char beg)
(while (re-search-forward "[ ]+\\({[^}]+}\\)" end t)
(font-lock-prepend-text-property (match-beginning 1) (match-end 1)
'font-lock-face
'web-mode-annotation-type-face))
(goto-char beg)
(while (re-search-forward "\\(@[[:alnum:]]+\\)" end t)
(font-lock-prepend-text-property (match-beginning 1) (match-end 1)
'font-lock-face
'web-mode-annotation-tag-face))
(goto-char beg)
(while (re-search-forward "}[[:blank:]]+\\([[:graph:]]+\\)" end t)
(font-lock-prepend-text-property (match-beginning 1) (match-end 1)
'font-lock-face
'web-mode-annotation-value-face))
(goto-char beg)
(while (re-search-forward "@see[[:blank:]]+\\([[:graph:]]+\\)" end t)
(font-lock-prepend-text-property (match-beginning 1) (match-end 1)
'font-lock-face
'web-mode-annotation-value-face))
(goto-char beg)
(while (re-search-forward "{\\(@\\(?:link\\|code\\)\\)\\s-+\\([^}\n]+\\)\\(#.+\\)?}" end t)
(font-lock-prepend-text-property (match-beginning 2) (match-end 2)
'font-lock-face
'web-mode-annotation-value-face))
(goto-char beg)
(while (re-search-forward "\\(</?\\)\\([[:alnum:]]+\\)\\s-*\\(/?>\\)" end t)
(font-lock-prepend-text-property (match-beginning 1) (match-end 1)
'font-lock-face
'web-mode-annotation-html-face)
(font-lock-prepend-text-property (match-beginning 2) (match-end 2)
'font-lock-face
'web-mode-annotation-html-face)
(font-lock-prepend-text-property (match-beginning 3) (match-end 3)
'font-lock-face
'web-mode-annotation-html-face))
) ;when
))