chickadee » cock-utils » parse-files

parse-files #!rest filesprocedure

Parse files into docexprs.

files
Cock-documented files to be parsed
(define (parse-files . files)
  (parameterize
    ((docexprs (make-stack)))
    (for-each
      (lambda (file)
        (with-input-from-file
          file
          (lambda ()
            (let read-next ((expression (read)))
              (if (not (eof-object? expression))
                (begin
                  (if (current-docexpr)
                    (docexpr-expr-set! (stack-peek (docexprs)) expression))
                  (current-docexpr #f)
                  (read-next (read))))))))
      files)
    (docexprs)))