Skip to content

Commit

Permalink
Automated Resyntax fixes (#564)
Browse files Browse the repository at this point in the history
This is an automated change generated by Resyntax.

#### Pass 1

Applied 3 fixes to [`private/contract-projection.rkt`](../blob/HEAD/private/contract-projection.rkt)

  * Line 8, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 12, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 13, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.

Applied 4 fixes to [`media/text/plain.rkt`](../blob/HEAD/media/text/plain.rkt)

  * Line 7, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 10, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 14, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 20, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.

Applied 1 fix to [`type/struct.rkt`](../blob/HEAD/type/struct.rkt)

  * Line 59, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.

Applied 1 fix to [`streaming/transducer/composition.rkt`](../blob/HEAD/streaming/transducer/composition.rkt)

  * Line 10, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.

Applied 4 fixes to [`private/printer-markup.rkt`](../blob/HEAD/private/printer-markup.rkt)

  * Line 9, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 17, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 24, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 35, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.

Applied 1 fix to [`type/object/private/definition-macro.rkt`](../blob/HEAD/type/object/private/definition-macro.rkt)

  * Line 25, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.

Applied 5 fixes to [`private/static-name.rkt`](../blob/HEAD/private/static-name.rkt)

  * Line 61, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
  * Line 65, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
  * Line 69, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
  * Line 75, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
  * Line 101, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.

Applied 1 fix to [`private/vector-merge-adjacent.rkt`](../blob/HEAD/private/vector-merge-adjacent.rkt)

  * Line 13, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.

## Summary

Fixed 20 issues in 8 files.

  * Fixed 9 occurrences of `predicate/c-migration`
  * Fixed 7 occurrences of `define-simple-macro-to-define-syntax-parse-rule`
  * Fixed 4 occurrences of `tidy-require`

Co-authored-by: resyntax-ci[bot] <181813515+resyntax-ci[bot]@users.noreply.github.com>
  • Loading branch information
resyntax-ci[bot] authored Sep 24, 2024
1 parent bfe02a4 commit 5019b61
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 27 deletions.
8 changes: 4 additions & 4 deletions media/text/plain.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

(provide
(contract-out
[charset? predicate/c]
[charset? (-> any/c boolean?)]
[us-ascii charset?]
[utf-8 charset?]
[text? predicate/c]
[text? (-> any/c boolean?)]
[text (-> (or/c charset? #f) immutable-bytes? text?)]
[text-charset (-> text? (or/c charset? #f))]
[text-bytes (-> text? immutable-bytes?)]
[text-media? predicate/c]
[text-media? (-> any/c boolean?)]
[text->media (-> text? text-media?)]
[media->text (-> text-media? text?)]
[text/plain (-> #:charset (or/c charset? #f) media-type?)]
[text/plain? (-> media-type? boolean?)]))

(require racket/bool
rebellion/binary/immutable-bytes
rebellion/media
rebellion/collection/record
rebellion/media
rebellion/type/tuple)

(module+ test
Expand Down
6 changes: 3 additions & 3 deletions private/contract-projection.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
(provide
(contract-out
[projection/c contract?]
[contract-get-projection (-> predicate/c blame? projection/c)]
[contract-get-projection (-> (-> any/c boolean?) blame? projection/c)]
[projection-and (-> projection/c ... projection/c)]
[projection-convert
(-> projection/c (-> any/c any/c) (-> any/c any/c) projection/c)]
[projection-filter (-> projection/c predicate/c projection/c)]
[assert-satisfies (-> any/c predicate/c blame? #:missing-party any/c void?)]))
[projection-filter (-> projection/c (-> any/c boolean?) projection/c)]
[assert-satisfies (-> any/c (-> any/c boolean?) blame? #:missing-party any/c void?)]))

(require racket/contract/combinator)

Expand Down
12 changes: 6 additions & 6 deletions private/printer-markup.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

(provide
(contract-out
[sequence-markup? predicate/c]
[sequence-markup? (-> any/c boolean?)]
[sequence-markup
(->* ((sequence/c any/c))
(#:indentation exact-nonnegative-integer?
#:prefix any/c
#:suffix any/c
#:inline-separator any/c)
sequence-markup?)]
[inline-sequence-markup? predicate/c]
[inline-sequence-markup? (-> any/c boolean?)]
[inline-sequence-markup
(->* ((sequence/c any/c))
(#:prefix any/c
#:suffix any/c
#:separator any/c)
inline-sequence-markup?)]
[mode-sensitive-markup? predicate/c]
[mode-sensitive-markup? (-> any/c boolean?)]
[mode-sensitive-markup
(-> #:written-form any/c
#:displayed-form any/c
Expand All @@ -32,10 +32,10 @@
(-> symbol? (-> any/c (sequence/c any/c)) custom-write-function/c)]))


(require racket/pretty
(require guard
racket/pretty
racket/sequence
rebellion/custom-write
guard)
rebellion/custom-write)


;@----------------------------------------------------------------------------------------------------
Expand Down
11 changes: 5 additions & 6 deletions private/static-name.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@
(raise-syntax-error #f "named identifier not bound" context-stx id-stx))
(syntax-parse-state-cons! 'literals id-stx)))

(define-simple-macro (name/derived id:id #:context context)
(define-syntax-parse-rule (name/derived id:id #:context context)
#:do [(check-name-has-binding! #'id #'context)]
(quote id))

(define-simple-macro (name id:id)
(define-syntax-parse-rule (name id:id)
#:with context this-syntax
(#%expression (name/derived id #:context context)))

(define-simple-macro (name-string/derived id:id #:context context)
(define-syntax-parse-rule (name-string/derived id:id #:context context)
#:do [(check-name-has-binding! #'id #'context)]
#:with literal-string (string->immutable-string
(symbol->string (syntax-e #'id)))
(quote literal-string))

(define-simple-macro (name-string id:id)
(define-syntax-parse-rule (name-string id:id)
#:with context this-syntax
(#%expression (name-string/derived id #:context context)))

Expand All @@ -98,8 +98,7 @@
(pattern (header:function-header-with-recursive-name . args:formals)
#:with function-name #'header.function-name)))

(define-simple-macro
(define/name
(define-syntax-parse-rule (define/name
(~or id:id header:function-header-with-recursive-name)
body ...)
(~? (splicing-let ([variable-name (quote id)])
Expand Down
4 changes: 2 additions & 2 deletions private/vector-merge-adjacent.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
(-> vector? (-> any/c any/c boolean?) (-> any/c any/c any/c) (and/c vector? immutable?))]))


(require rebellion/collection/vector/builder
guard)
(require guard
rebellion/collection/vector/builder)


(module+ test
Expand Down
4 changes: 2 additions & 2 deletions streaming/transducer/composition.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
[transducer-pipe (-> transducer? ... transducer?)]
[transducer-compose (-> transducer? ... transducer?)]))

(require racket/bool
(require guard
racket/bool
racket/list
racket/match
rebellion/base/impossible-function
rebellion/base/variant
guard
rebellion/private/static-name
rebellion/streaming/transducer/base
rebellion/type/record)
Expand Down
3 changes: 1 addition & 2 deletions type/object/private/definition-macro.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

;@------------------------------------------------------------------------------

(define-simple-macro
(define-object-type id:id (private-field:id ...)
(define-syntax-parse-rule (define-object-type id:id (private-field:id ...)
(~alt
(~optional (~and #:omit-root-binding omit-root-binding-kw))

Expand Down
3 changes: 1 addition & 2 deletions type/struct.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
(define (format-one-identifier id template-string)
(format-id id template-string (syntax-e id) #:source id #:props id)))

(define-simple-macro
(define-and-provide-struct-descriptor-field-accessors
(define-syntax-parse-rule (define-and-provide-struct-descriptor-field-accessors
[field:id contract:expr] ...)
#:do [(define (format-fields template-string)
(map (λ (field-id) (format-one-identifier field-id template-string))
Expand Down

0 comments on commit 5019b61

Please sign in to comment.