From ed478254e2020f277bb7f65f18c2bb60bd251fa9 Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Mon, 21 Apr 2008 13:31:50 +0000 Subject: [PATCH] Combinator parser change to add new signature form htdp/testing change so that generate-report does something svn: r9382 --- collects/combinator-parser/combinator-unit.ss | 2 +- .../private-combinator/parser-sigs.ss | 10 ++++++++++ collects/htdp/testing.ss | 2 +- collects/profj/comb-parsers/parser-units.scm | 7 ++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/collects/combinator-parser/combinator-unit.ss b/collects/combinator-parser/combinator-unit.ss index 37027260e5..2226050bc6 100644 --- a/collects/combinator-parser/combinator-unit.ss +++ b/collects/combinator-parser/combinator-unit.ss @@ -6,6 +6,6 @@ (provide combinator-parser-tools@ combinator-parser^ err^ error-format-parameters^ language-format-parameters^ language-dictionary^ - terminals) + terminals recurs) ) diff --git a/collects/combinator-parser/private-combinator/parser-sigs.ss b/collects/combinator-parser/private-combinator/parser-sigs.ss index f33bb4bb8c..612f8f9f03 100644 --- a/collects/combinator-parser/private-combinator/parser-sigs.ss +++ b/collects/combinator-parser/private-combinator/parser-sigs.ss @@ -18,6 +18,16 @@ (format "token-~a" (syntax-e e))))) (syntax->list #'(elt ...)))))])) + (define-signature-form (recurs stx) + (syntax-case stx () + [(_ id ...) + (andmap identifier? (syntax->list #'(id ...))) + (syntax->list #`(id ... + #,@(map (lambda (e) #`(define-syntaxes + (#,(datum->syntax e (string->symbol (format "~a@" (syntax-e e))))) + (values (syntax-id-rules () [_ #'(eta #,e)])))) + (syntax->list #'(id ...)))))])) + (define-signature language-dictionary^ (misspelled misscap missclass)) (define-signature combinator-parser-forms^ diff --git a/collects/htdp/testing.ss b/collects/htdp/testing.ss index 9be82e7e68..0be8f0e45d 100644 --- a/collects/htdp/testing.ss +++ b/collects/htdp/testing.ss @@ -2,7 +2,7 @@ (require test-engine/scheme-tests) -(define (generate-report) (void)) +(define (generate-report) (test)#;(void)) (provide (all-from-out test-engine/scheme-tests) generate-report) diff --git a/collects/profj/comb-parsers/parser-units.scm b/collects/profj/comb-parsers/parser-units.scm index 0c6a12cd29..0b5151dae6 100644 --- a/collects/profj/comb-parsers/parser-units.scm +++ b/collects/profj/comb-parsers/parser-units.scm @@ -2,11 +2,12 @@ (require parser-tools/lex scheme/unit - (lib "combinator-unit.ss" "combinator-parser") + combinator-parser/combinator-unit + #;(lib "combinator-unit.ss" "combinator-parser") "java-signatures.scm" mzlib/string) - (define-signature language-forms^ (program statement expression field interact)) ;value-type method-type)) + (define-signature language-forms^ (program statement (recurs expression) field interact)) ;value-type method-type)) (define-signature token-proc^ (old-tokens->new)) @@ -329,7 +330,7 @@ (define new-class (choose ((sequence (new name O_PAREN C_PAREN) id) - (sequence (new name O_PAREN (comma-sep (eta expression) "arguments") C_PAREN) id)) + (sequence (new name O_PAREN (comma-sep expression@ "arguments") C_PAREN) id)) "class instantiation")) (define (new-array type-name)