[honu] add module for debugging honu programs. first feature passes the input through honu-read
This commit is contained in:
parent
e4401fd450
commit
40ead42f0f
22
collects/honu/debug.rkt
Normal file
22
collects/honu/debug.rkt
Normal 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))
|
Loading…
Reference in New Issue
Block a user