From 4b7386dedf2bc8e5752da1aa58adb6008dc9201d Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 16 Aug 2017 11:04:52 +0000 Subject: [PATCH] Higher-level handler for parse2 --- read.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/read.scm b/read.scm index 6e82996e..e39b582a 100644 --- a/read.scm +++ b/read.scm @@ -702,7 +702,7 @@ " return_closcall1(data, k, equalp( opaque_ptr(opq), obj ));") (write - (parse2 (open-input-file "test.scm"))) + (call-parse2 (open-input-file "test.scm"))) ;(read-token (open-input-file "test.scm"))) ;TODO: getting there, but still not parsed correctly: @@ -735,6 +735,12 @@ ))) +(define (call-parse2 fp) + (let ((result (parse2 fp))) + (if (Cyc-opaque? result) + (error "unexpected closing parenthesis") + result))) + (define (parse2 fp) (let ((token (read-token fp))) ;; TODO: this will be a C call ;(write `(token ,token))