Skip to content

Commit c6e7f0c

Browse files
Automated Resyntax fixes
This is an automated change generated by Resyntax. #### Pass 1 Applied 3 fixes to [`typed-racket-lib/typed-racket/base-env/annotate-classes.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/annotate-classes.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 172, `if-else-false-to-and`: This `if` expression can be refactored to an equivalent expression using `and`. * Line 331, `define-values-values-to-define`: This use of `define-values` is unnecessary. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/ann-inst.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/ann-inst.rkt) * Line 8, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-test/optimizer/reset-port.rkt`](../blob/HEAD/typed-racket-test/optimizer/reset-port.rkt) * Line 8, `read-line-any`: Specify a line mode of `'any` with `read-line` to avoid differences between Windows and other platforms. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 3 fixes to [`typed-racket-test/optimizer/transform.rkt`](../blob/HEAD/typed-racket-test/optimizer/transform.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 24, `read-line-any`: Specify a line mode of `'any` with `read-line` to avoid differences between Windows and other platforms. * Line 35, `if-begin-to-cond`: Using `cond` instead of `if` here makes `begin` unnecessary Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/prims-lambda.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/prims-lambda.rkt) * Line 9, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-env-indexing.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-env-indexing.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/unit-prims.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/unit-prims.rkt) * Line 136, `map-to-for`: This `map` operation can be replaced with a `for/list` loop. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-structs.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-structs.rkt) * Line 14, `provide-deduplication`: Providing the same identifier multiple times is unnecessary. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/class-prims.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/class-prims.rkt) * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-test/optimizer/known-bugs.rkt`](../blob/HEAD/typed-racket-test/optimizer/known-bugs.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 2 fixes to [`typed-racket-lib/typed-racket/base-env/base-contracted.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-contracted.rkt) * Line 6, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 34, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/class-clauses.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/class-clauses.rkt) * Line 8, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/optimizer/sequence.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/sequence.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt) * Line 9, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/for-clauses.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/for-clauses.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-special-env.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-special-env.rkt) * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/env-lang.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/env-lang.rkt) * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-types-extra.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-types-extra.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 2 fixes to [`typed-racket-test/optimizer/run.rkt`](../blob/HEAD/typed-racket-test/optimizer/run.rkt) * Line 2, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 14, `read-line-any`: Specify a line mode of `'any` with `read-line` to avoid differences between Windows and other platforms. ## Summary Fixed 26 issues in 20 files. * Fixed 18 occurrences of `tidy-require` * Fixed 3 occurrences of `read-line-any` * Fixed 1 occurrence of `if-begin-to-cond` * Fixed 1 occurrence of `if-else-false-to-and` * Fixed 1 occurrence of `define-values-values-to-define` * Fixed 1 occurrence of `map-to-for` * Fixed 1 occurrence of `provide-deduplication`
1 parent 387eb47 commit c6e7f0c

20 files changed

+125
-125
lines changed

typed-racket-lib/typed-racket/base-env/ann-inst.rkt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
;; This file is loaded by all Typed Racket programs, so it should not
66
;; have expensive runtime dependencies.
77

8-
(require (for-syntax syntax/parse/pre "../private/syntax-properties.rkt"
9-
racket/base)
8+
(require (for-syntax racket/base
9+
syntax/parse/pre
10+
"../private/syntax-properties.rkt")
1011
"colon.rkt")
1112

1213
(provide (for-syntax add-ann) ann inst row-inst)

typed-racket-lib/typed-racket/base-env/annotate-classes.rkt

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#lang racket/base
22

3-
(require syntax/parse/pre
4-
racket/private/immediate-default
3+
(require (for-label "colon.rkt")
54
racket/list
6-
racket/set
75
racket/match
6+
racket/private/immediate-default
7+
racket/set
8+
syntax/parse/pre
89
"../private/parse-classes.rkt"
9-
"../private/syntax-properties.rkt"
10-
(for-label "colon.rkt"))
10+
"../private/syntax-properties.rkt")
1111
(provide (all-defined-out))
1212

1313
;; Data definitions
@@ -169,7 +169,7 @@
169169
#:with ty #'t))
170170
(define-splicing-syntax-class optional-standalone-annotation
171171
(pattern (~optional a:standalone-annotation)
172-
#:attr ty (if (attribute a) #'a.ty #f)))
172+
#:attr ty (and (attribute a) #'a.ty)))
173173

174174
(define-syntax-class type-variables
175175
#:attributes ((vars 1))
@@ -330,23 +330,16 @@
330330
(define-values (all-mand-tys all-opt-tys)
331331
(cond
332332
[kw-property
333-
(define-values (mand-kw-set opt-kw-set)
334-
(values
335-
(list->set (lambda-kws-mand kw-property))
336-
(list->set (lambda-kws-opt kw-property))))
337-
333+
(define mand-kw-set (list->set (lambda-kws-mand kw-property)))
334+
(define opt-kw-set (list->set (lambda-kws-opt kw-property)))
338335
(define-values (mand-tys^ opt-kw^)
339-
(partition (part-pred opt-kw-set)
340-
(attribute mand.type-form)))
341-
336+
(partition (part-pred opt-kw-set) (attribute mand.type-form)))
337+
342338
(define-values (opt-tys^ mand-kw^)
343-
(partition (part-pred mand-kw-set)
344-
(attribute opt.type-form)))
345-
346-
(values (append mand-tys^ mand-kw^)
347-
(append opt-tys^ opt-kw^))]
348-
[else
349-
(values (attribute mand.type-form) (attribute opt.type-form))]))]
339+
(partition (part-pred mand-kw-set) (attribute opt.type-form)))
340+
341+
(values (append mand-tys^ mand-kw^) (append opt-tys^ opt-kw^))]
342+
[else (values (attribute mand.type-form) (attribute opt.type-form))]))]
350343
#:attr kw-property kw-property
351344
#:attr mand-tys
352345
(flatten all-mand-tys)

typed-racket-lib/typed-racket/base-env/base-contracted.rkt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
;; This file provides Typed Racket bindings for values that need
44
;; contract protection, even in typed code.
55

6-
(require "../utils/utils.rkt"
7-
"../utils/any-wrap.rkt"
6+
(require (for-syntax racket/base
7+
"../env/env-req.rkt")
88
(prefix-in c: racket/contract)
9-
(rename-in
10-
racket/base
11-
[default-continuation-prompt-tag -default-continuation-prompt-tag])
12-
(for-syntax racket/base
13-
"../env/env-req.rkt"))
9+
(rename-in racket/base [default-continuation-prompt-tag -default-continuation-prompt-tag])
10+
"../utils/any-wrap.rkt"
11+
"../utils/utils.rkt")
1412

1513
(provide default-continuation-prompt-tag)
1614

@@ -32,8 +30,8 @@
3230
(module* #%type-decl #f
3331
(#%plain-module-begin
3432
(require typed-racket/env/global-env
35-
typed-racket/types/abbrev
36-
typed-racket/rep/type-rep)
33+
typed-racket/rep/type-rep
34+
typed-racket/types/abbrev)
3735
(register-type
3836
(quote-syntax default-continuation-prompt-tag)
3937
;; TODO: we actually want the type

typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
#lang racket/base
22

3-
(require
4-
(for-template racket/base racket/list racket/unsafe/ops racket/flonum racket/extflonum racket/fixnum)
5-
(for-syntax racket/base syntax/parse)
6-
racket/stxparam
7-
"../utils/tc-utils.rkt"
8-
(rename-in "../types/abbrev.rkt" [-Boolean B] [-Symbol Sym])
9-
(rename-in "../types/numeric-tower.rkt" [-Number N])
10-
(only-in "base-structs.rkt" -Arity-At-Least))
3+
(require (for-syntax racket/base
4+
syntax/parse)
5+
(for-template racket/base
6+
racket/extflonum
7+
racket/fixnum
8+
racket/flonum
9+
racket/list
10+
racket/unsafe/ops)
11+
racket/stxparam
12+
(rename-in "../types/abbrev.rkt" [-Boolean B] [-Symbol Sym])
13+
(rename-in "../types/numeric-tower.rkt" [-Number N])
14+
(only-in "base-structs.rkt" -Arity-At-Least)
15+
"../utils/tc-utils.rkt")
1116

1217
(provide indexing)
1318

typed-racket-lib/typed-racket/base-env/base-env-indexing.rkt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#lang racket/base
22

3-
(require
4-
"../utils/utils.rkt"
5-
"../types/numeric-tower.rkt"
6-
"../env/init-envs.rkt"
7-
"base-env-indexing-abs.rkt")
3+
(require "../env/init-envs.rkt"
4+
"../types/numeric-tower.rkt"
5+
"../utils/utils.rkt"
6+
"base-env-indexing-abs.rkt")
87

98
(define e (indexing -Integer))
109
(define (initialize-indexing) (initialize-type-env e))

typed-racket-lib/typed-racket/base-env/base-special-env.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
;; this file cheats to define types for unexported variables
44
;; that are expanded into by Racket macros
5-
(require "../env/init-envs.rkt"
5+
(require (for-syntax racket/base)
6+
"../env/init-envs.rkt"
67
"../types/abbrev.rkt"
7-
"../types/numeric-tower.rkt"
8-
(for-syntax racket/base))
8+
"../types/numeric-tower.rkt")
99
(provide make-template-identifier)
1010

1111
(define (make-template-identifier what where)

typed-racket-lib/typed-racket/base-env/base-structs.rkt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111

1212
(require (for-template racket/base (prefix-in k: '#%kernel)))
1313

14-
(provide initialize-structs -Date -Srcloc -Date -Arity-At-Least -Exn)
14+
(provide initialize-structs
15+
-Date
16+
-Srcloc
17+
-Arity-At-Least
18+
-Exn)
1519

1620
(define-syntax define-hierarchy
1721
(syntax-rules (define-hierarchy)

typed-racket-lib/typed-racket/base-env/base-types-extra.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#lang racket/base
22

3-
(require (for-syntax "type-name-error.rkt"
4-
racket/base))
3+
(require (for-syntax racket/base
4+
"type-name-error.rkt"))
55

66
(define-syntax (define-other-types stx)
77
(syntax-case stx ()

typed-racket-lib/typed-racket/base-env/class-clauses.rkt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
;; other parts of TR to use the bindings of init, public, etc. without
66
;; requiring prims.rkt
77

8-
(require (prefix-in untyped: racket/class)
9-
"colon.rkt"
10-
(for-syntax racket/base
8+
(require (for-syntax racket/base
119
syntax/parse
1210
syntax/stx
13-
"../private/syntax-properties.rkt"))
11+
"../private/syntax-properties.rkt")
12+
(prefix-in untyped: racket/class)
13+
"colon.rkt")
1414

1515
(provide (for-syntax class-clause
1616
clause

typed-racket-lib/typed-racket/base-env/class-prims.rkt

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22

33
;; This module provides TR primitives for classes and objects
44

5-
(require (prefix-in untyped: racket/class)
6-
"class-clauses.rkt"
7-
"colon.rkt"
5+
(require (for-syntax racket/base
6+
racket/class
7+
racket/list
8+
racket/match
9+
racket/syntax
10+
syntax/kerncase
11+
syntax/parse
12+
syntax/stx
13+
"../private/syntax-properties.rkt"
14+
"../typecheck/internal-forms.rkt"
15+
"../utils/disarm.rkt"
16+
"../utils/tc-utils.rkt"
17+
"annotate-classes.rkt")
18+
(prefix-in untyped: racket/class)
19+
(only-in "prims.rkt" (define tr:define))
820
"../private/class-literals.rkt"
921
"../utils/typed-method-property.rkt"
10-
(only-in "prims.rkt" [define tr:define])
11-
(for-syntax
12-
racket/base
13-
racket/class
14-
racket/list
15-
racket/match
16-
racket/syntax
17-
syntax/kerncase
18-
syntax/parse
19-
syntax/stx
20-
"../typecheck/internal-forms.rkt"
21-
"annotate-classes.rkt"
22-
"../private/syntax-properties.rkt"
23-
"../utils/disarm.rkt"
24-
"../utils/tc-utils.rkt"))
22+
"class-clauses.rkt"
23+
"colon.rkt")
2524

2625
(provide ;; Typed class macro that coordinates with TR
2726
class

0 commit comments

Comments
 (0)