Skip to content

Commit

Permalink
Handle non-existing files.
Browse files Browse the repository at this point in the history
darcs-hash:20051128044913-71b0c-815a22650755ef540c3e597ddd6d950a59293415.gz
  • Loading branch information
pupeno committed Nov 28, 2005
1 parent 707fad7 commit 3f07256
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions chicken-il.scm
Expand Up @@ -14,7 +14,7 @@
(lambda (p)
(let loop ((c (read-char p)))
(cond ((eof-object? c)
(error "unexpected end of file"))
(error 'get-includes "unexpected end of file"))
((and (char=? c #\<)
(char=? #\# (peek-char p)))
(read-char p)
Expand All @@ -37,9 +37,11 @@
;; Get the list of files passed as arguments to this program.
(define file (first (rest (argv))))

;; Get a list of the extensions needed by those files.
(define includes (get-includes file))

;; Print the list of includes with no parenthesis and separated by spaces.
(display (string-join includes " "))
(newline)
;; Check if the file exists. It is not an error because it is ok to include a file that doesn't exists and gets generated latter (is it ?). This is the case of chicken-syntax-case.
(when (file-exists? file)
;; Get a list of the extensions needed by those files.
(define includes (get-includes file))

;; Print the list of includes with no parenthesis and separated by spaces.
(display (string-join includes " "))
(newline))

0 comments on commit 3f07256

Please sign in to comment.