diff --git a/collects/honu/core/main.rkt b/collects/honu/core/main.rkt index da33167812..f6f3825583 100644 --- a/collects/honu/core/main.rkt +++ b/collects/honu/core/main.rkt @@ -13,6 +13,7 @@ (rename-out [#%dynamic-honu-module-begin #%module-begin] [honu-top-interaction #%top-interaction] [honu-function function] + [honu-require require] [honu-macro macro] [honu-syntax syntax] [honu-var var] diff --git a/collects/honu/core/private/honu-typed-scheme.rkt b/collects/honu/core/private/honu-typed-scheme.rkt index 118244f34b..7264034702 100644 --- a/collects/honu/core/private/honu-typed-scheme.rkt +++ b/collects/honu/core/private/honu-typed-scheme.rkt @@ -409,6 +409,7 @@ Then, in the pattern above for 'if', 'then' would be bound to the following synt #'(provide x.x ...)) #'rest)]))) +#; (honu:define-honu-syntax honu-require (lambda (body ctx) (define-syntax-class for-syntax-form diff --git a/collects/honu/core/private/honu2.rkt b/collects/honu/core/private/honu2.rkt index 3a80e69957..5e822489f0 100644 --- a/collects/honu/core/private/honu2.rkt +++ b/collects/honu/core/private/honu2.rkt @@ -166,3 +166,13 @@ (syntax-case stx () [(_ rest ...) #'(#%top-interaction . (honu-unparsed-begin rest ...))])) + +(provide honu-require) +(define-honu-syntax honu-require + (lambda (code context) + (syntax-parse code + [(_ module . rest) + (values + #'(require module) + #'rest + #f)]))) diff --git a/collects/honu/core/private/parse2.rkt b/collects/honu/core/private/parse2.rkt index e0ca3c8d98..4d93b5c8ea 100644 --- a/collects/honu/core/private/parse2.rkt +++ b/collects/honu/core/private/parse2.rkt @@ -264,13 +264,20 @@ ;; expression or function application [(#%parens args ...) (if current - (let () - (debug "function call ~a\n" left) - (define call (with-syntax ([current current] - [(parsed-args ...) - (parse-comma-expression #'(args ...)) ]) - #'(current parsed-args ...))) - (do-parse #'(rest ...) precedence left call)) + (if (> precedence 9000) + (let () + (define call (with-syntax ([current (left current)] + [(parsed-args ...) + (parse-comma-expression #'(args ...)) ]) + #'(current parsed-args ...))) + (do-parse #'(rest ...) 9000 (lambda (x) x) call)) + (let () + (debug "function call ~a\n" left) + (define call (with-syntax ([current current] + [(parsed-args ...) + (parse-comma-expression #'(args ...)) ]) + #'(current parsed-args ...))) + (do-parse #'(rest ...) precedence left call))) (let () (debug "inner expression ~a\n" #'(args ...)) (define-values (inner-expression unparsed) (parse #'(args ...))) diff --git a/collects/honu/core/read.rkt b/collects/honu/core/read.rkt index c0caa43a23..b169814433 100644 --- a/collects/honu/core/read.rkt +++ b/collects/honu/core/read.rkt @@ -70,11 +70,7 @@ [":" (token-identifier ':)] ["'" (token-identifier 'quote)] ["`" (token-identifier 'quasiquote)] - ;; ["=" (token-identifier '=)] [operator (token-identifier (string->symbol lexeme))] - ;; ["*" (token-identifier '*)] - ;; ["/" (token-identifier '/)] - ;; ["+" (token-identifier '+)] [";" (token-identifier '|;|)] ;; strip the quotes from the resulting string ;; TODO: find a more optimal way