[honu] configure honu runtime to use the honu syntax reader. this allows honu to be used at the repl
This commit is contained in:
parent
e3cff12b06
commit
ffc5387ac3
|
@ -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])))
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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 ()
|
||||
|
|
|
@ -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 ...))]))
|
||||
|
|
7
collects/honu/core/runtime.rkt
Normal file
7
collects/honu/core/runtime.rkt
Normal file
|
@ -0,0 +1,7 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "read.rkt")
|
||||
|
||||
(provide configure)
|
||||
(define (configure . args)
|
||||
(current-read-interaction honu-read-syntax))
|
|
@ -1,4 +1,4 @@
|
|||
#lang racket/base
|
||||
#lang honu/private
|
||||
|
||||
(require (prefix-in racket: (combine-in racket/base racket/list)))
|
||||
|
||||
|
|
12
collects/honu/private/lang/reader.rkt
Normal file
12
collects/honu/private/lang/reader.rkt
Normal 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)
|
4
collects/honu/private/main.rkt
Normal file
4
collects/honu/private/main.rkt
Normal file
|
@ -0,0 +1,4 @@
|
|||
#lang racket/base
|
||||
|
||||
(require racket/base)
|
||||
(provide (all-from-out racket/base))
|
Loading…
Reference in New Issue
Block a user