Function: wisent-javascript-jv-expand-tag
wisent-javascript-jv-expand-tag is a byte-compiled function defined in
javascript.el.gz.
Signature
(wisent-javascript-jv-expand-tag TAG)
Documentation
Expand TAG into a list of equivalent tags, or nil.
Expand multiple variable declarations in the same statement, that is
tags of class variable whose name is equal to a list of elements of
the form (NAME VALUE START . END). NAME is a variable name. VALUE is
an initializer START and END are the bounds in the declaration, related
to this variable NAME.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/wisent/javascript.el.gz
(defun wisent-javascript-jv-expand-tag (tag)
"Expand TAG into a list of equivalent tags, or nil.
Expand multiple variable declarations in the same statement, that is
tags of class `variable' whose name is equal to a list of elements of
the form (NAME VALUE START . END). NAME is a variable name. VALUE is
an initializer START and END are the bounds in the declaration, related
to this variable NAME."
(let (elts elt value clone start end xpand)
(when (and (eq 'variable (semantic-tag-class tag))
(consp (setq elts (semantic-tag-name tag))))
;; There are multiple names in the same variable declaration.
(while elts
;; For each name element, clone the initial tag and give it
;; the name of the element.
(setq elt (car elts)
elts (cdr elts)
clone (semantic-tag-clone tag (car elt))
value (car (cdr elt))
start (if elts (car (cddr elt)) (semantic-tag-start tag))
end (if xpand (cdr (cddr elt)) (semantic-tag-end tag))
xpand (cons clone xpand))
;; Set the definition of the cloned tag
(semantic-tag-put-attribute clone :default-value value)
;; Set the bounds of the cloned tag with those of the name
;; element.
(semantic-tag-set-bounds clone start end))
xpand)))