Skip to content

Commit

Permalink
Support let/ec and let/cc
Browse files Browse the repository at this point in the history
  • Loading branch information
sorawee committed Jan 1, 2025
1 parent 5d76153 commit 15ea025
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions conventions.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
20 changes: 10 additions & 10 deletions tests/test-cases/large2.rkt.out
Original file line number Diff line number Diff line change
Expand Up @@ -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?)
Expand Down Expand Up @@ -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"))
Expand Down
6 changes: 6 additions & 0 deletions tests/test-cases/let-cc-ec.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#lang racket

(let/ec
k
(define x 1)
x)
5 changes: 5 additions & 0 deletions tests/test-cases/let-cc-ec.rkt.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#lang racket

(let/ec k
(define x 1)
x)

0 comments on commit 15ea025

Please sign in to comment.