Permalink
Browse files

Be able to handle #>...<# reader extensions on the analized files.

darcs-hash:20051119014538-71b0c-d81d02b25701084997941a4b800abee89eb385a4.gz
  • Loading branch information...
pupeno committed Nov 19, 2005
1 parent 35d2057 commit 9168ef33bed66e5cc6a744615a1f1fe46784916c
Showing with 22 additions and 0 deletions.
  1. +22 −0 chicken-il.scm
View
@@ -10,6 +10,28 @@
(define rest cdr)
(define (get-includes filename)
+ (set-read-syntax! #\#
+ (lambda (port)
+ (let ((first-char (read-char port)))
+;; (display (format "Found a reader macro starting with: ~s.~n" first-char))
+ (cond
+ ((char=? first-char #\>)
+ (let loop ((c (read-char port)))
+;; (display (format "Retriving char: ~s.~n" c))
+ (if (and (char=? c #\<)
+ (char=? (peek-char port) #\#))
+ (begin
+ (read-char port)
+ '(nevermind))
+ (loop (read-char port)))))
+ (else
+ (display "Non-supported reader macro extension found:")
+ (newline)(newline)
+ (display first-char)
+ (display (read-string 50 port))
+ (display " ...")
+ (newline)
+ (exit 1))))))
(call-with-input-file filename
(lambda (file-port)
(let process-form ((form (read file-port))) ; Read a form from form-port

0 comments on commit 9168ef3

Please sign in to comment.