diff --git a/collects/honu/core/main.rkt b/collects/honu/core/main.rkt index 9cd31bc045..d0c3ea5a0f 100644 --- a/collects/honu/core/main.rkt +++ b/collects/honu/core/main.rkt @@ -10,6 +10,11 @@ (rename-out [#%dynamic-honu-module-begin #%module-begin] [honu-function function] [honu-var var] + [honu-+ +] + [honu-- -] + [honu-* *] + [honu-/ /] + [honu-^ ^] [literal:honu-= =] [literal:semicolon |;|] [literal:#%braces #%braces] diff --git a/collects/honu/core/private/honu2.rkt b/collects/honu/core/private/honu2.rkt index 1781d61c29..501b6c1d54 100644 --- a/collects/honu/core/private/honu2.rkt +++ b/collects/honu/core/private/honu2.rkt @@ -46,3 +46,5 @@ #'(- left right)))) (define-binary-operator honu-* 2 *) +(define-binary-operator honu-/ 2 /) +(define-binary-operator honu-^ 2 expt) diff --git a/collects/honu/core/private/parse2.rkt b/collects/honu/core/private/parse2.rkt index 9f705e752d..f0265822da 100644 --- a/collects/honu/core/private/parse2.rkt +++ b/collects/honu/core/private/parse2.rkt @@ -157,8 +157,12 @@ (do-parse #'(rest ...) 0 (lambda (x) x) - (left (with-syntax ([current current]) - #'(current args ...)))) + (left (with-syntax ([current current] + [(parsed-args ...) + (if (null? (syntax->list #'(args ...))) + '() + (list (parse #'(args ...))))]) + #'(current parsed-args ...)))) #; (error 'parse "function call")] [else (error 'what "dont know ~a" #'head)])] diff --git a/collects/tests/honu/test.honu b/collects/tests/honu/test.honu index 38a640901e..d7b729319d 100644 --- a/collects/tests/honu/test.honu +++ b/collects/tests/honu/test.honu @@ -22,7 +22,8 @@ function test1(){ test("x = 3", x, 3); test("y = 2", y, 2); */ - print(x) + print(x + 2); + print(x ^ 2) } test1()