diff options
Diffstat (limited to 'lisp/cedet/srecode/dictionary.el')
-rw-r--r-- | lisp/cedet/srecode/dictionary.el | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el index 5b65284660f..6262383c397 100644 --- a/lisp/cedet/srecode/dictionary.el +++ b/lisp/cedet/srecode/dictionary.el @@ -117,8 +117,8 @@ Makes sure that :value is compiled." (cons (car fields) newfields)))) (setq fields (cdr (cdr fields)))) - (when (not state) - (error "Cannot create compound variable without :state")) + ;;(when (not state) + ;; (error "Cannot create compound variable outside of sectiondictionary")) (call-next-method this (nreverse newfields)) (when (not (slot-boundp this 'compiled)) @@ -220,7 +220,10 @@ associated with a buffer or parent." "Insert into DICT the variables found in table TPL. TPL is an object representing a compiled template file." (when tpl - (let ((tabs (oref tpl :tables))) + ;; Tables are sorted with highest priority first, useful for looking + ;; up templates, but this means we need to install the variables in + ;; reverse order so higher priority variables override lower ones. + (let ((tabs (reverse (oref tpl :tables)))) (require 'srecode/find) ; For srecode-template-table-in-project-p (while tabs (when (srecode-template-table-in-project-p (car tabs)) @@ -546,40 +549,6 @@ inserted with a new editable field.") ;;; Higher level dictionary functions ;; -(defun srecode-create-section-dictionary (sectiondicts STATE) - "Create a dictionary with section entries for a template. -The format for SECTIONDICTS is what is emitted from the template parsers. -STATE is the current compiler state." - (when sectiondicts - (let ((new (srecode-create-dictionary t))) - ;; Loop over each section. The section is a macro w/in the - ;; template. - (while sectiondicts - (let* ((sect (car (car sectiondicts))) - (entries (cdr (car sectiondicts))) - (subdict (srecode-dictionary-add-section-dictionary new sect)) - ) - ;; Loop over each entry. This is one variable in the - ;; section dictionary. - (while entries - (let ((tname (semantic-tag-name (car entries))) - (val (semantic-tag-variable-default (car entries)))) - (if (eq val t) - (srecode-dictionary-show-section subdict tname) - (cond - ((and (stringp (car val)) - (= (length val) 1)) - (setq val (car val))) - (t - (setq val (srecode-dictionary-compound-variable - tname :value val :state STATE)))) - (srecode-dictionary-set-value - subdict tname val)) - (setq entries (cdr entries)))) - ) - (setq sectiondicts (cdr sectiondicts))) - new))) - (defun srecode-create-dictionaries-from-tags (tags state) "Create a dictionary with entries according to TAGS. |