Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't refactor let at module level #290

Merged
merged 1 commit into from
Sep 14, 2024
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
15 changes: 15 additions & 0 deletions default-recommendations/let-binding-suggestions-test.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,21 @@ test: "let forms inside for loop bodies"
------------------------------


test: "let forms at module level not refactorable to define"
------------------------------
(let ([x 1])
(* x 2))
------------------------------


test: "let forms at submodule level not refactorable to define"
------------------------------
(module+ test
(let ([x 1])
(* x 2)))
------------------------------


test: "named lets which don't refer to the name are refactorable to unnamed lets"
------------------------------
(let loop ([x 1]) x)
Expand Down
18 changes: 6 additions & 12 deletions default-recommendations/private/definition-context.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
(define-splicing-syntax-class header-form-allowing-internal-definitions
#:attributes ([original 1])
#:literals (block
#%module-begin
module
module*
module+
let
let*
let-values
Expand Down Expand Up @@ -100,14 +96,13 @@


(define-syntax-class header-id-with-no-header-forms
#:literals (block #%module-begin)
(pattern (~or block #%module-begin)))
#:literals (block)
(pattern block))


(define-syntax-class header-id-with-one-header-form
#:literals (module+
let*
let-values
#:literals (let*
let-values
let*-values
when
unless
Expand Down Expand Up @@ -138,7 +133,6 @@
for*/first
for*/last)
(pattern (~or :lambda-by-any-name
module+
let*
let-values
let*-values
Expand Down Expand Up @@ -173,8 +167,8 @@


(define-syntax-class header-id-with-two-header-forms
#:literals (module module* for/fold for*/fold)
(pattern (~or module module* for/fold for*/fold)))
#:literals (for/fold for*/fold)
(pattern (~or for/fold for*/fold)))


(define-splicing-syntax-class branching-form-allowing-internal-definitions-within-clauses
Expand Down
Loading