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)
|
(define (main arguments)
|
||||||
(for-each (lambda (tex-file)
|
(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))
|
(newline))
|
||||||
(cdr arguments)))
|
(cdr arguments)))
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,5 @@
|
||||||
;;(fprintf (current-error-port) "Read thing: ~a~%" thing)
|
;;(fprintf (current-error-port) "Read thing: ~a~%" thing)
|
||||||
(loop (append things (list thing)))))))))
|
(loop (append things (list thing)))))))))
|
||||||
|
|
||||||
(define (parse-tex-from-port char-input-port)
|
(define (read-tex-document)
|
||||||
(parameterize ((current-input-port char-input-port))
|
(read-tex-until eof-object?))
|
||||||
(read-tex-until eof-object?)))
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
(define-library (tex-parser)
|
(define-library (tex-parser)
|
||||||
(export parse-tex-from-port)
|
(export read-tex-document)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme char)
|
(scheme char)
|
||||||
(scheme file)
|
(scheme file)
|
||||||
|
|
Loading…
Reference in New Issue