Skip to content
29 changes: 14 additions & 15 deletions drracket-core-lib/drracket/private/init.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,17 @@
;; little bit from errors that are raised in the dynamic
;; extent of an edit-sequence.
(when (eq? (current-thread) (eventspace-handler-thread system-eventspace))
(for ([f (in-list (get-top-level-windows))])
(when (is-a? f drracket:unit:frame<%>)
(let loop ([o f])
(cond
[(is-a? o editor-canvas%)
(define t (send o get-editor))
(when (or (is-a? t drracket:unit:definitions-text<%>)
(is-a? t drracket:rep:text<%>))
(let loop ()
(when (send t in-edit-sequence?)
(send t end-edit-sequence)
(loop))))]
[(is-a? o area-container<%>)
(for ([c (in-list (send o get-children))])
(loop c))])))))))
(for ([f (in-list (get-top-level-windows))]
#:when (is-a? f drracket:unit:frame<%>))
(let loop ([o f])
(cond
[(is-a? o editor-canvas%)
(define t (send o get-editor))
(when (or (is-a? t drracket:unit:definitions-text<%>) (is-a? t drracket:rep:text<%>))
(let loop ()
(when (send t in-edit-sequence?)
(send t end-edit-sequence)
(loop))))]
[(is-a? o area-container<%>)
(for ([c (in-list (send o get-children))])
(loop c))]))))))
12 changes: 6 additions & 6 deletions drracket-core-lib/drracket/private/language-object-contract.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
(let loop ([s #'arg])
(cond
[(syntax? s)
(let ([loc (vector (syntax-source s)
(syntax-line s)
(syntax-column s)
(syntax-position s)
(syntax-span s))])
(make-sloc (loop (syntax-e s)) loc))]
(vector (syntax-source s)
(syntax-line s)
(syntax-column s)
(syntax-position s)
(syntax-span s))
(make-sloc (loop (syntax-e s)) loc)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. Bitten by jackfirth/resyntax#449 again.

[(pair? s) (cons (loop (car s)) (loop (cdr s)))]
[else s]))])
#'ans)]))])
Expand Down
60 changes: 26 additions & 34 deletions drracket-core-lib/drracket/private/tool-contract-language.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,19 @@
body)))))])))))))]
[(_ (name type type-names strs ...) ...)
(begin
(for-each
(λ (str-stx)
(when (string? (syntax->datum str-stx))
(raise-syntax-error 'tool-contract-language.rkt "expected type name specification"
stx
str-stx)))
(syntax->list (syntax (type-names ...))))
(for-each
(λ (name)
(unless (identifier? name)
(raise-syntax-error 'tool-contract-language.rkt "expected identifier" stx name)))
(syntax->list (syntax (name ...))))
(for-each
(λ (str)
(unless (string? (syntax->datum str))
(raise-syntax-error 'tool-contract-language.rkt "expected docs string" stx str)))
(apply append (map syntax->list (syntax->list (syntax ((strs ...) ...)))))))]))
(for ([str-stx (in-list (syntax->list (syntax (type-names ...))))])
(when (string? (syntax->datum str-stx))
(raise-syntax-error 'tool-contract-language.rkt
"expected type name specification"
stx
str-stx)))
(for ([name (in-list (syntax->list (syntax (name ...))))])
(unless (identifier? name)
(raise-syntax-error 'tool-contract-language.rkt "expected identifier" stx name)))
(for ([str (in-list (apply append
(map syntax->list (syntax->list (syntax ((strs ...) ...))))))])
(unless (string? (syntax->datum str))
(raise-syntax-error 'tool-contract-language.rkt "expected docs string" stx str))))]))

(define-syntax (-#%module-begin2 stx)
(syntax-case stx ()
Expand Down Expand Up @@ -116,20 +112,16 @@
body)))]))))))]
[(_ (name type type-names strs ...) ...)
(begin
(for-each
(λ (str-stx)
(when (string? (syntax->datum str-stx))
(raise-syntax-error 'tool-contract-language.rkt "expected type name specification"
stx
str-stx)))
(syntax->list (syntax (type-names ...))))
(for-each
(λ (name)
(unless (identifier? name)
(raise-syntax-error 'tool-contract-language.rkt "expected identifier" stx name)))
(syntax->list (syntax (name ...))))
(for-each
(λ (str)
(unless (string? (syntax->datum str))
(raise-syntax-error 'tool-contract-language.rkt "expected docs string" stx str)))
(apply append (map syntax->list (syntax->list (syntax ((strs ...) ...)))))))]))
(for ([str-stx (in-list (syntax->list (syntax (type-names ...))))])
(when (string? (syntax->datum str-stx))
(raise-syntax-error 'tool-contract-language.rkt
"expected type name specification"
stx
str-stx)))
(for ([name (in-list (syntax->list (syntax (name ...))))])
(unless (identifier? name)
(raise-syntax-error 'tool-contract-language.rkt "expected identifier" stx name)))
(for ([str (in-list (apply append
(map syntax->list (syntax->list (syntax ((strs ...) ...))))))])
(unless (string? (syntax->datum str))
(raise-syntax-error 'tool-contract-language.rkt "expected docs string" stx str))))]))
28 changes: 14 additions & 14 deletions drracket-tool-text-lib/drracket/find-module-path-completions.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,20 @@
(and (regexp? (list-ref link-ent 2))
(regexp-match (list-ref link-ent 2) (version)))
#t))
`(,(list-ref link-ent 0)
,(simplify-path
(let* ([encoded-path (list-ref link-ent 1)]
[path (cond
[(string? encoded-path) encoded-path]
[(bytes? encoded-path) (bytes->path encoded-path)]
[else (apply build-path
(for/list ([elem (in-list encoded-path)])
(if (bytes? elem)
(bytes->path-element elem)
elem)))])])
(if (relative-path? path)
(build-path base path)
path)))))]
(list (list-ref link-ent 0)
(simplify-path (let* ([encoded-path (list-ref link-ent 1)]
[path (cond
[(string? encoded-path) encoded-path]
[(bytes? encoded-path) (bytes->path encoded-path)]
[else
(apply build-path
(for/list ([elem (in-list encoded-path)])
(if (bytes? elem)
(bytes->path-element elem)
elem)))])])
(if (relative-path? path)
(build-path base path)
path)))))]
[else '()])]
[else
(for/list ([clp (in-list library-collection-paths)])
Expand Down
Loading
Loading