diff --git a/collects/honu/core/private/operator.rkt b/collects/honu/core/private/operator.rkt index c568d7a09d..2aedd60045 100644 --- a/collects/honu/core/private/operator.rkt +++ b/collects/honu/core/private/operator.rkt @@ -42,8 +42,8 @@ (define-honu-operator/syntax honu-flow 0.001 'left (lambda (left right) - (with-syntax ([left (honu->racket left)] - [right (honu->racket right)]) + (with-syntax ([left left] + [right right]) (racket-syntax (right left))))) (begin-for-syntax diff --git a/collects/honu/core/private/parse2.rkt b/collects/honu/core/private/parse2.rkt index 06be51843c..c918690f1c 100644 --- a/collects/honu/core/private/parse2.rkt +++ b/collects/honu/core/private/parse2.rkt @@ -220,6 +220,9 @@ (racket-syntax (define (function parsed-arguments ...) body.result)))]) +(define (definition? code) + #f) + ;; E = macro ;; | E operator E ;; | [...] @@ -299,6 +302,7 @@ re-parse re-parse)))) #; (debug "Reparsed output ~a\n" (pretty-format (syntax->datum re-parse))) + (define terminate (definition? re-parse)) (if terminate? (values (left re-parse) #'rest) @@ -375,13 +379,14 @@ (let-values ([(parsed unparsed) (do-parse #'(rest ...) new-precedence (lambda (stuff) + (define right (parse-all stuff)) (define output (if current (if binary-transformer - (binary-transformer current stuff) + (binary-transformer current right) (error 'binary "cannot be used as a binary operator in ~a" #'head)) (if unary-transformer - (unary-transformer stuff) + (unary-transformer right) (error 'unary "cannot be used as a unary operator in ~a" #'head)))) #; (debug "Binary transformer ~a\n" binary-transformer) diff --git a/collects/honu/core/private/struct.rkt b/collects/honu/core/private/struct.rkt index 2baf774f15..3c336e2284 100644 --- a/collects/honu/core/private/struct.rkt +++ b/collects/honu/core/private/struct.rkt @@ -5,6 +5,7 @@ (for-syntax racket/base "parse2.rkt" "literals.rkt" + "compile.rkt" syntax/parse unstable/syntax)) @@ -37,7 +38,7 @@ (make-accessors #'name (syntax->list #'(fields.name ...)))] [(fields.name/mutator ...) (make-mutators #'name (syntax->list #'(fields.name ...)))]) - #'(%racket (struct name (fields.name ...) + (racket-syntax (struct name (fields.name ...) #:transparent #:mutable #:property honu-struct-mutable diff --git a/collects/tests/honu/flow.honu b/collects/tests/honu/flow.honu index 1dfe5e77bb..1e1e26ba6a 100644 --- a/collects/tests/honu/flow.honu +++ b/collects/tests/honu/flow.honu @@ -1,14 +1,14 @@ #lang honu -foo(x){ +function foo(x){ x + 1 } -bar(x){ +function bar(x){ x * 2 } -buz(z){ +function buz(z){ z - 4 } diff --git a/collects/tests/honu/linq.rkt b/collects/tests/honu/linq.rkt index ce04b1a5f1..3cc84fc271 100644 --- a/collects/tests/honu/linq.rkt +++ b/collects/tests/honu/linq.rkt @@ -8,6 +8,7 @@ (for-syntax racket/base honu/core/private/literals honu/core/private/parse2 + honu/core/private/compile syntax/parse)) (define-literal+set linq-literals @@ -36,9 +37,9 @@ #'(sort store.result string