Simplify API
Rely on caller to set current-input-port to read the TeX document.
This commit is contained in:
parent
3ee2d6915b
commit
850728a59f
|
@ -8,7 +8,7 @@
|
|||
|
||||
(define (main arguments)
|
||||
(for-each (lambda (tex-file)
|
||||
(display (call-with-input-file tex-file parse-tex-from-port))
|
||||
(display (with-input-from-file tex-file read-tex-document))
|
||||
(newline))
|
||||
(cdr arguments)))
|
||||
|
||||
|
|
|
@ -36,6 +36,5 @@
|
|||
;;(fprintf (current-error-port) "Read thing: ~a~%" thing)
|
||||
(loop (append things (list thing)))))))))
|
||||
|
||||
(define (parse-tex-from-port char-input-port)
|
||||
(parameterize ((current-input-port char-input-port))
|
||||
(read-tex-until eof-object?)))
|
||||
(define (read-tex-document)
|
||||
(read-tex-until eof-object?))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
(define-library (tex-parser)
|
||||
(export parse-tex-from-port)
|
||||
(export read-tex-document)
|
||||
(import (scheme base)
|
||||
(scheme char)
|
||||
(scheme file)
|
||||
|
|
Loading…
Reference in New Issue