Function: srecode-dictionary-lookup-name

srecode-dictionary-lookup-name is a byte-compiled function defined in dictionary.el.gz.

Signature

(srecode-dictionary-lookup-name ARG &rest ARGS)

Implementations

(srecode-dictionary-lookup-name (DICT srecode-dictionary) NAME &optional NON-RECURSIVE) in `srecode/dictionary.el'.

Return information about DICT's value for NAME. DICT is a dictionary, and NAME is a string that is treated as the name of an entry in the dictionary. If such an entry exists, its value is returned. Otherwise, nil is returned. Normally, the lookup is recursive in the sense that the parent of DICT is searched for NAME if it is not found in DICT. This recursive lookup can be disabled by the optional argument NON-RECURSIVE.

This function derives values for some special NAMEs, such as `FIRST' and `LAST'.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/dictionary.el.gz
(cl-defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary)
					   name &optional non-recursive)
  "Return information about DICT's value for NAME.
DICT is a dictionary, and NAME is a string that is treated as the
name of an entry in the dictionary.  If such an entry exists, its
value is returned.  Otherwise, nil is returned.  Normally, the
lookup is recursive in the sense that the parent of DICT is
searched for NAME if it is not found in DICT.  This recursive
lookup can be disabled by the optional argument NON-RECURSIVE.

This function derives values for some special NAMEs, such as
`FIRST' and `LAST'."
  (if (not (slot-boundp dict 'namehash))
      nil
    ;; Get the value of this name from the dictionary or its parent
    ;; unless the lookup should be non-recursive.
    (with-slots (namehash parent) dict
      (or (gethash name namehash)
	  (and (not non-recursive)
	       (not (member name '("FIRST" "LAST" "NOTFIRST" "NOTLAST")))
	       parent
	       (srecode-dictionary-lookup-name parent name)))))
  )