[honu] add module for debugging honu programs. first feature passes the input through honu-read

This commit is contained in:
Jon Rafkind 2012-07-26 13:59:33 -06:00
parent e4401fd450
commit 40ead42f0f

22
collects/honu/debug.rkt Normal file
View File

@ -0,0 +1,22 @@
#lang racket/base
(require "core/read.rkt"
racket/pretty
racket/cmdline)
;; Helpful debug things for Honu
;; * read a Honu program and view its structure as an s-expression (before enforestation)
(define (read-file file)
(printf "Read file ~a\n" file)
(pretty-print (with-input-from-file file
(lambda () (honu-read)))))
(define (do-parse-command-line)
(command-line
#:program "debug"
#:args files
files))
(for ([file (do-parse-command-line)])
(read-file file))