Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,17 @@ test: "require tidying of only non-phase spec forms should do nothing"
----------------------------------------


test: "require tidying shouldn't trigger when require transformers are imported and used"
test: "require tidying shouldn't trigger when transformers are imported and used"
----------------------------------------
(require racket/require
(multi-in racket (list set dict))
racket/hash)
----------------------------------------


test: "require tidying shouldn't trigger when transformers are imported and used in nested specs"
----------------------------------------
(require racket/require
(prefix-in racket: (multi-in racket (list set dict)))
racket/hash)
----------------------------------------
38 changes: 15 additions & 23 deletions default-recommendations/require-and-provide-suggestions.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -91,35 +91,21 @@
except-in
prefix-in
rename-in
combine-in
relative-in
only-meta-in
only-space-in
for-syntax
for-template
for-label
for-meta)
(pattern mod:collection-module-path #:attr parsed (parsed-simple-import 0 'plain 'collection #'mod))
(pattern mod:file-module-path #:attr parsed (parsed-simple-import 0 'plain 'file #'mod))
(pattern ((~or only-in
except-in
prefix-in
rename-in
combine-in
relative-in
only-meta-in
only-space-in)
subspec ...)

(pattern :simple-module-import-spec)

(pattern (~or (only-in _:simple-module-import-spec _ ...)
(except-in _:simple-module-import-spec _ ...)
(prefix-in _ _:simple-module-import-spec)
(rename-in _:simple-module-import-spec _ ...))
#:cut
#:attr parsed (parsed-simple-import 0 'plain 'other-known this-syntax))

(pattern ((~and form
(~not only-in)
(~not except-in)
(~not prefix-in)
(~not rename-in)
(~not combine-in)
(~not relative-in)
(~not only-meta-in)
(~not only-space-in)
(~not for-syntax)
(~not for-template)
(~not for-label)
Expand All @@ -128,6 +114,12 @@
#:attr parsed (parsed-simple-import 0 'plain 'other-unknown this-syntax)))


(define-syntax-class simple-module-import-spec
#:attributes (parsed)
(pattern mod:collection-module-path #:attr parsed (parsed-simple-import 0 'plain 'collection #'mod))
(pattern mod:file-module-path #:attr parsed (parsed-simple-import 0 'plain 'file #'mod)))


(define-syntax-class collection-module-path
(pattern :id))

Expand Down
Loading