Function: ebnf-map-list-to-optional

ebnf-map-list-to-optional is a byte-compiled function defined in ebnf-otz.el.gz.

Signature

(ebnf-map-list-to-optional NLIST)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/ebnf-otz.el.gz
(defun ebnf-map-list-to-optional (nlist)
  (and (= (length nlist) 2)
       (let ((first  (nth 0 nlist))
	     (second (nth 1 nlist)))
	 (cond
	  ;; empty second
	  ((eq (ebnf-node-kind first) 'ebnf-generate-empty)
	   (ebnf-make-optional second))
	  ;; first empty
	  ((eq (ebnf-node-kind second) 'ebnf-generate-empty)
	   (ebnf-make-optional first))
	  ;; first second
	  (t
	   nil)
	  ))))