From 15ea0255a512977d84e92ce524863716c2a9468f Mon Sep 17 00:00:00 2001 From: Sorawee Porncharoenwase Date: Wed, 1 Jan 2025 13:56:26 -0800 Subject: [PATCH] Support let/ec and let/cc --- conventions.rkt | 1 + tests/test-cases/large2.rkt.out | 20 ++++++++++---------- tests/test-cases/let-cc-ec.rkt | 6 ++++++ tests/test-cases/let-cc-ec.rkt.out | 5 +++++ 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 tests/test-cases/let-cc-ec.rkt create mode 100644 tests/test-cases/let-cc-ec.rkt.out diff --git a/conventions.rkt b/conventions.rkt index e259feb..3bee2e0 100644 --- a/conventions.rkt +++ b/conventions.rkt @@ -515,6 +515,7 @@ [("test-begin") (format-uniform-body/helper 0 #:require-body? #f)] [("begin0") (format-uniform-body/helper 1)] [("module+") (format-uniform-body/helper 1)] + [("let/ec" "let/cc") (format-uniform-body/helper 1)] [("test-case" "test-suite") (format-uniform-body/helper 1)] [("define-syntax-class" "define-match-expander") (format-uniform-body/helper 1)] [("class" "interface") (format-uniform-body/helper 1 #:require-body? #f)] diff --git a/tests/test-cases/large2.rkt.out b/tests/test-cases/large2.rkt.out index f17b07f..f27243d 100644 --- a/tests/test-cases/large2.rkt.out +++ b/tests/test-cases/large2.rkt.out @@ -2739,20 +2739,20 @@ [do-save? (define continue? (let/ec k - (for ([tab (in-list save-candidates)]) - (unless (send (send tab get-defs) save-file/gui-error) - (k #f))) - #t)) + (for ([tab (in-list save-candidates)]) + (unless (send (send tab get-defs) save-file/gui-error) + (k #f))) + #t)) (update-tabs-labels) continue?] [else #t])])])) (define/private (save-all-unsaved-files) (let/ec k - (for ([tab (in-list (get-unsaved-candidate-tabs #f))]) - (parameterize ([editor:silent-cancel-on-save-file-out-of-date? #t]) - (unless (send (send tab get-defs) save-file #f 'same #f) - (k (void)))))) + (for ([tab (in-list (get-unsaved-candidate-tabs #f))]) + (parameterize ([editor:silent-cancel-on-save-file-out-of-date? #t]) + (unless (send (send tab get-defs) save-file #f 'same #f) + (k (void)))))) (update-tabs-labels)) (define/private (get-unsaved-candidate-tabs skip-me?) @@ -5314,8 +5314,8 @@ (check-equal? (string-length (compute-label-string (string->path (make-string 200 #\x)))) 200) (for ([i (in-range 100 300)]) (let/ec k - (parameterize ([error-escape-handler k]) - (check-true (string? (compute-label-string (string->path (make-string i #\x)))))))) + (parameterize ([error-escape-handler k]) + (check-true (string? (compute-label-string (string->path (make-string i #\x)))))))) (check-true (is-lang-line? "#lang x")) (check-true (is-lang-line? "#lang racket")) diff --git a/tests/test-cases/let-cc-ec.rkt b/tests/test-cases/let-cc-ec.rkt new file mode 100644 index 0000000..1088d87 --- /dev/null +++ b/tests/test-cases/let-cc-ec.rkt @@ -0,0 +1,6 @@ +#lang racket + +(let/ec + k + (define x 1) + x) diff --git a/tests/test-cases/let-cc-ec.rkt.out b/tests/test-cases/let-cc-ec.rkt.out new file mode 100644 index 0000000..ec0afa2 --- /dev/null +++ b/tests/test-cases/let-cc-ec.rkt.out @@ -0,0 +1,5 @@ +#lang racket + +(let/ec k + (define x 1) + x)