Simplify API

Rely on caller to set current-input-port to read the TeX document.
This commit is contained in:
Lassi Kortela 2019-03-28 12:33:25 +02:00
parent 3ee2d6915b
commit 850728a59f
3 changed files with 4 additions and 5 deletions

View File

@ -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)))

View File

@ -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?))

View File

@ -1,5 +1,5 @@
(define-library (tex-parser)
(export parse-tex-from-port)
(export read-tex-document)
(import (scheme base)
(scheme char)
(scheme file)