                     (geiser-syntax--scan-locals bfs
                                                 sbfs
                                                 form
-                                                (> end boundary)
                                                 (1- nesting)
                                                 '()))))))))
 

	((null form) nil)
	(t (cons (car form) (geiser-syntax--linearize (cdr form))))))

(defun geiser-syntax--scan-locals (bfs sbfs form partial nesting locals)
  (if (or (null form) (not (listp form)))
      (geiser-syntax--normalize locals)
    (if (not (geiser-syntax--binding-form-p bfs sbfs (car form)))
	(geiser-syntax--scan-locals bfs sbfs
				    (car (last form))
                                    partial (1- nesting) locals)
      (let* ((head (car form))
	     (name (geiser-syntax--if-symbol (cadr form)))
	     (names (if name (geiser-syntax--if-list (caddr form))

	    (push (cadr f) locals)))
	(geiser-syntax--scan-locals bfs sbfs
				    (car (last (or rest names)))
                                    (1- nesting)
				    locals)))))

