Function: antlr-downcase-literals

antlr-downcase-literals is an interactive and byte-compiled function defined in antlr-mode.el.gz.

Signature

(antlr-downcase-literals &optional TRANSFORM)

Documentation

Convert all literals in buffer to lower case.

If non-nil, TRANSFORM is used on literals instead of downcase-region.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
;;;===========================================================================
;;;  Literal normalization, Hide Actions
;;;===========================================================================

(defun antlr-downcase-literals (&optional transform)
  "Convert all literals in buffer to lower case.
If non-nil, TRANSFORM is used on literals instead of `downcase-region'."
  (interactive)
  (or transform (setq transform #'downcase-region))
  (let ((literals 0))
    (save-excursion
      (goto-char (point-min))
      (while (antlr-re-search-forward "\"\\(\\sw\\(\\sw\\|\\s_\\|-\\)*\\)\"" nil) ; TODO: '...'
        (funcall transform (match-beginning 0) (match-end 0))
        (cl-incf literals)))
    (message "Transformed %d literals" literals)))