Function: semantic-lex-spp-extract-regex-and-compare

semantic-lex-spp-extract-regex-and-compare is a byte-compiled function defined in lex-spp.el.gz.

Signature

(semantic-lex-spp-extract-regex-and-compare ANALYZER VALUE)

Documentation

Extract a regexp from an ANALYZER and use to match VALUE.

Return non-nil if it matches

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/lex-spp.el.gz
;;; MACRO EXPANSION: Simple cases
;;
;; If a user fills in the table with simple strings, we can
;; support that by converting them into tokens with the
;; various analyzers that are available.

(defun semantic-lex-spp-extract-regex-and-compare (analyzer value)
  "Extract a regexp from an ANALYZER and use to match VALUE.
Return non-nil if it matches"
  (let* ((condition (car analyzer))
	 (regex (cond ((eq (car condition) 'looking-at)
		       (nth 1 condition))
		      (t
		       nil))))
    (when regex
      (string-match regex value))
    ))