diff --git a/collects/honu/core/private/parse2.rkt b/collects/honu/core/private/parse2.rkt index 4ac102cc19..e0ca3c8d98 100644 --- a/collects/honu/core/private/parse2.rkt +++ b/collects/honu/core/private/parse2.rkt @@ -120,6 +120,13 @@ (loop (cons parsed used) unparsed)))))) +(define parsed-property (gensym 'honu-parsed)) +(define (parsed-syntax syntax) + (syntax-property syntax parsed-property #t)) + +(define (parsed-syntax? syntax) + (syntax-property syntax parsed-property)) + (define (stopper? what) (define-literal-set check (honu-comma semicolon colon)) (define is (and (identifier? what) @@ -178,6 +185,8 @@ #'rest) (do-parse #'rest precedence left #'parsed)))))] + [(parsed-syntax? #'head) + (do-parse #'(rest ...) precedence left #'head)] [(honu-operator? #'head) (define new-precedence (transformer:honu-operator-ref (syntax-local-value #'head) 0)) (define association (transformer:honu-operator-ref (syntax-local-value #'head) 1)) @@ -283,7 +292,10 @@ (error 'parse "function call")] [else (error 'what "dont know how to parse ~a" #'head)])])])])) - (do-parse input 0 (lambda (x) x) #f)) + (define-values (parsed unparsed) + (do-parse input 0 (lambda (x) x) #f)) + (values (parsed-syntax parsed) + unparsed)) (define (empty-syntax? what) (syntax-parse what diff --git a/collects/honu/core/private/util.rkt b/collects/honu/core/private/util.rkt index d6e45b9e05..c26b441106 100644 --- a/collects/honu/core/private/util.rkt +++ b/collects/honu/core/private/util.rkt @@ -2,7 +2,6 @@ (provide (except-out (all-defined-out) test-delimiter)) (require "debug.rkt" - tests/eli-tester racket/match (for-syntax racket/base) syntax/stx diff --git a/collects/tests/honu/macros.rkt b/collects/tests/honu/macros.rkt index f21c32b7e5..cc9255503a 100644 --- a/collects/tests/honu/macros.rkt +++ b/collects/tests/honu/macros.rkt @@ -3,3 +3,6 @@ macro testx () {x:expression} {syntax(x_result + 1)} testx 5 * 2; + +for z = 1 to testx 5 * 2 do + printf("z is ~a\n", z)