[honu] configure honu runtime to use the honu syntax reader. this allows honu to be used at the repl

This commit is contained in:
Jon Rafkind 2011-09-06 13:22:52 -06:00
parent e3cff12b06
commit ffc5387ac3
8 changed files with 43 additions and 2 deletions

View File

@ -4,8 +4,16 @@
(provide honu-info)
(define (honu-info key default default-filter)
(printf "get info for ~a\n" key)
(case key
[(color-lexer) (dynamic-require 'honu/core/read
'color-lexer)]
[else
(default-filter key default)]))
(provide honu-language-info)
(define (honu-language-info data)
(lambda (key default)
(case key
[(configure-runtime) '(#(honu/core/runtime configure #f))]
[else default])))

View File

@ -11,6 +11,7 @@
print printf true false
(for-syntax (rename-out [honu-expression expression]))
(rename-out [#%dynamic-honu-module-begin #%module-begin]
[honu-top-interaction #%top-interaction]
[honu-function function]
[honu-macro macro]
[honu-syntax syntax]

View File

@ -460,7 +460,9 @@ Then, in the pattern above for 'if', 'then' would be bound to the following synt
(debug "expanded ~a\n" (syntax->datum parsed))
(with-syntax ([parsed parsed]
[(unparsed ...) unparsed])
#'(begin parsed (honu-unparsed-begin unparsed ...)))]))
(if (null? (syntax->datum #'(unparsed ...)))
#'parsed
#'(begin parsed (honu-unparsed-begin unparsed ...))))]))
(define-syntax (#%dynamic-honu-module-begin stx)
(syntax-case stx ()

View File

@ -3,6 +3,7 @@
(require "macro2.rkt"
"operator.rkt"
"struct.rkt"
"honu-typed-scheme.rkt"
(only-in "literals.rkt"
honu-then
semicolon)
@ -159,3 +160,9 @@
(define-binary-operator honu-map 0.09 'left map)
(define-unary-operator honu-not 0.7 'left not)
(provide honu-top-interaction)
(define-syntax (honu-top-interaction stx)
(syntax-case stx ()
[(_ rest ...)
#'(printf "~a\n" (honu-unparsed-begin rest ...))]))

View File

@ -0,0 +1,7 @@
#lang racket/base
(require "read.rkt")
(provide configure)
(define (configure . args)
(current-read-interaction honu-read-syntax))

View File

@ -1,4 +1,4 @@
#lang racket/base
#lang honu/private
(require (prefix-in racket: (combine-in racket/base racket/list)))

View File

@ -0,0 +1,12 @@
#lang s-exp syntax/module-reader
honu/private/main
;;#:read honu-read
;;#:read-syntax honu-read-syntax
;;#:whole-body-readers? #t
#:language-info #(honu/core/language honu-language-info #f)
; #:language-info #(honu/core/runtime configure 'dont-care)
(require honu/core/read
honu/core/language)

View File

@ -0,0 +1,4 @@
#lang racket/base
(require racket/base)
(provide (all-from-out racket/base))