diff options
author | David Aspinall <da@inf.ed.ac.uk> | 2007-12-09 18:00:35 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 2007-12-09 18:00:35 +0000 |
commit | 4999ab33c45d7e5d11a7ef3a6a2e74e4a4aec57d (patch) | |
tree | 707250aa348652298e56f4683c178e0a483f2d1c /generic/pg-pgip.el | |
parent | 9b5ea46ba8aa5e9abd47cd6c5b3855de5f50068d (diff) |
Fix some compile warnings: bug in pg-pgip-interpret-choice; move defsubsts to pg-xml.el
Diffstat (limited to 'generic/pg-pgip.el')
-rw-r--r-- | generic/pg-pgip.el | 84 |
1 files changed, 15 insertions, 69 deletions
diff --git a/generic/pg-pgip.el b/generic/pg-pgip.el index 4a4dcccc..d2f1b68e 100644 --- a/generic/pg-pgip.el +++ b/generic/pg-pgip.el @@ -513,20 +513,21 @@ Also sets local proverid and srcid variables for buffer." (let (res) (while (and choices (not res)) (let ((type (car choices))) - ((eq (car-safe type) 'const) - (string-equal value (cadr type))) - (setq res (pg-pgip-interpret-const value 'const))) - ((and (eq type 'integer) - (string-match "[+-]?[0-9]+$" value)) - (setq res (pg-pgip-interpret-value value 'integer))) - ((and (eq type 'boolean) - (or (string-equal value "true") - (string-equal value "false") - (string-equal value "0") - (string-equal value "1"))) - (setq res (pg-pgip-interpret-value value 'boolean))) - ((eq type 'string) - (setq res (pg-pgip-interpret-value value 'string)))) + (cond + ((and (eq (car-safe type) 'const) + (string-equal value (cadr type))) + (setq res (pg-pgip-interpret-const value 'const))) + ((and (eq type 'integer) + (string-match "[+-]?[0-9]+$" value)) + (setq res (pg-pgip-interpret-value value 'integer))) + ((and (eq type 'boolean) + (or (string-equal value "true") + (string-equal value "false") + (string-equal value "0") + (string-equal value "1"))) + (setq res (pg-pgip-interpret-value value 'boolean))) + ((eq type 'string) + (setq res (pg-pgip-interpret-value value 'string))))) (setq choices (cdr choices))) (or res (pg-pgip-error @@ -535,61 +536,6 @@ Also sets local proverid and srcid variables for buffer." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -;; Auxiliary functions for parsing common bits of PGIP -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun pg-pgip-get-icon (node &optional optional defaultval) - "Return the <icon> child of NODE, or nil if none." - (pg-xml-get-child 'icon node)) - -(defsubst pg-pgip-get-name (node &optional optional defaultval) - (pg-xml-get-attr 'name node optional defaultval)) - -(defsubst pg-pgip-get-version (node &optional optional defaultval) - (pg-xml-get-attr 'version node optional defaultval)) - -(defsubst pg-pgip-get-descr (node &optional optional defaultval) - (pg-xml-get-attr 'descr node optional defaultval)) - -(defsubst pg-pgip-get-thmname (node &optional optional defaultval) - (pg-xml-get-attr 'thmname node optional defaultval)) - -(defsubst pg-pgip-get-thyname (node &optional optional defaultval) - (pg-xml-get-attr 'thmname node optional defaultval)) - -(defsubst pg-pgip-get-url (node &optional optional defaultval) - (pg-xml-get-attr 'url node optional defaultval)) - -(defsubst pg-pgip-get-srcid (node &optional optional defaultval) - (pg-xml-get-attr 'srcid node optional defaultval)) - -(defsubst pg-pgip-get-proverid (node &optional optional defaultval) - (pg-xml-get-attr 'proverid node optional defaultval)) - -(defsubst pg-pgip-get-symname (node &optional optional defaultval) - (pg-xml-get-attr 'name node optional defaultval)) - -(defsubst pg-pgip-get-prefcat (node &optional optional defaultval) - (pg-xml-get-attr 'prefcategory node optional defaultval)) - -(defsubst pg-pgip-get-default (node &optional optional defaultval) - (pg-xml-get-attr 'default node optional defaultval)) - -(defsubst pg-pgip-get-objtype (node &optional optional defaultval) - (pg-xml-get-attr 'objtype node optional defaultval)) - -(defsubst pg-pgip-get-value (node) - (pg-xml-get-text-content node)) - -(defalias 'pg-pgip-get-displaytext 'pg-pgip-get-pgmltext) - -(defun pg-pgip-get-pgmltext (node) - ;; TODO: fetch text or markup XML with text properties - (pg-xml-get-text-content node)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;; Sending PGIP commands to prover ;; |