Skip to content

Commit

Permalink
Merge automated resyntax fixes
Browse files Browse the repository at this point in the history
Ref: #107
  • Loading branch information
benknoble committed Oct 26, 2024
2 parents a46ecaf + 0d9fa8a commit fe9d67b
Show file tree
Hide file tree
Showing 20 changed files with 107 additions and 118 deletions.
12 changes: 6 additions & 6 deletions aoe.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

(provide (rename-out [mb #%module-begin]) #%app #%datum #%top #%top-interaction)

(require syntax/parse/define
(for-syntax racket/syntax)
frosthaven-manager/aoe-images)
(require (for-syntax racket/syntax)
frosthaven-manager/aoe-images
syntax/parse/define)

(define-syntax-parser mb
[(_ spec:expr)
Expand Down Expand Up @@ -32,8 +32,8 @@
#`(module name module-path
(#%module-begin #,spec)))])]
[else (make-module)]))
(require syntax/parse
syntax/strip-context
frosthaven-manager/aoe-images)
(require frosthaven-manager/aoe-images
syntax/parse
syntax/strip-context)
(define-syntax-class aoe-spec
[pattern {~or {~datum s} {~datum x} {~datum o} {~datum m} {~datum g}}]))
6 changes: 3 additions & 3 deletions bestiary.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#%app #%datum #%top #%top-interaction
(rename-out [mb #%module-begin]))

(require syntax/parse/define
(require (for-syntax frosthaven-manager/syntax/monsters
racket/syntax)
frosthaven-manager/syntax/monsters
(for-syntax racket/syntax
frosthaven-manager/syntax/monsters))
syntax/parse/define)

;; e ::= '(import "path") | <monster-info> | listof <monster-ability>
(define-syntax-parser mb
Expand Down
13 changes: 6 additions & 7 deletions enum-helpers.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
(provide
define-serializable-enum-type)

(require
racket/serialize
(for-syntax racket/syntax)
syntax/parse/define
rebellion/type/enum
rebellion/collection/keyset
frosthaven-manager/curlique)
(require (for-syntax racket/syntax)
frosthaven-manager/curlique
racket/serialize
rebellion/collection/keyset
rebellion/type/enum
syntax/parse/define)

(module+ test (require rackunit))

Expand Down
15 changes: 7 additions & 8 deletions gui/common-menu.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
[launch-server-menu-item (-> state? (is-a?/c view<%>))]
[gc-menu-item (-> (is-a?/c view<%>))]))

(require racket/runtime-path
net/sendurl
racket/gui/easy
(prefix-in gui: racket/gui)
frosthaven-manager/gui/markdown
(require frosthaven-manager/gui/markdown
frosthaven-manager/gui/render
frosthaven-manager/gui/server
frosthaven-manager/manager)
frosthaven-manager/manager
net/sendurl
racket/gui/easy
racket/runtime-path
(prefix-in gui: racket/gui))

(module+ test (require rackunit))

Expand All @@ -39,8 +39,7 @@

(define (get-about-text)
(define about-text (file->string about.md))
(define about+version (string-join (list about-text "---" (string-append "Version: " version)) "\n"))
about+version)
(string-join (list about-text "---" (string-append "Version: " version)) "\n"))

(module+ test
(test-case "about information"
Expand Down
9 changes: 4 additions & 5 deletions gui/level-picker.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
(#:label (maybe-obs/c maybe-label/c))
(is-a?/c view<%>))]))

(require racket/gui/easy
racket/gui/easy/contract

frosthaven-manager/defns
frosthaven-manager/observable-operator)
(require frosthaven-manager/defns
frosthaven-manager/observable-operator
racket/gui/easy
racket/gui/easy/contract)

(define (level-picker #:choose on-choose #:selection selection #:label [label #f])
(choice #:label (@ label)
Expand Down
14 changes: 7 additions & 7 deletions gui/loot.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
(obs/c num-players/c)
(is-a?/c view<%>))]))

(require racket/gui/easy
frosthaven-manager/observable-operator
racket/gui/easy/contract
frosthaven-manager/defns
(require frosthaven-manager/defns
frosthaven-manager/files
frosthaven-manager/gui/mixins
frosthaven-manager/gui/counter
frosthaven-manager/gui/helpers
frosthaven-manager/gui/mixins
frosthaven-manager/gui/render
frosthaven-manager/gui/table
frosthaven-manager/gui/rich-text-display
frosthaven-manager/qi/list2hash)
frosthaven-manager/gui/table
frosthaven-manager/observable-operator
frosthaven-manager/qi/list2hash
racket/gui/easy
racket/gui/easy/contract)

(define (loot-picker @type->cards @type->deck
#:on-card [on-card void]
Expand Down
33 changes: 15 additions & 18 deletions gui/manager.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,31 @@

(provide manager)

(require racket/gui/easy
(only-in racket/gui
get-file
put-file
application-about-handler)
frosthaven-manager/observable-operator
frosthaven-manager/defns
frosthaven-manager/manager
(require frosthaven-manager/defns
frosthaven-manager/files
frosthaven-manager/gui/common-menu
frosthaven-manager/gui/elements
frosthaven-manager/gui/formula-editor
frosthaven-manager/gui/player-info
frosthaven-manager/gui/helpers
frosthaven-manager/gui/level-info
frosthaven-manager/gui/level-picker
frosthaven-manager/gui/loot
(only-in frosthaven-manager/elements elements)
frosthaven-manager/gui/elements
frosthaven-manager/gui/helpers
frosthaven-manager/monster-db
frosthaven-manager/gui/mixins
frosthaven-manager/gui/monsters
frosthaven-manager/gui/monster-modifier
frosthaven-manager/gui/monsters
frosthaven-manager/gui/number-players
frosthaven-manager/gui/player-info
frosthaven-manager/gui/render
frosthaven-manager/gui/rewards
frosthaven-manager/gui/round-prompts
frosthaven-manager/gui/rich-text-display
frosthaven-manager/gui/level-picker
frosthaven-manager/gui/number-players
frosthaven-manager/gui/round-number)
frosthaven-manager/gui/round-number
frosthaven-manager/gui/round-prompts
frosthaven-manager/manager
frosthaven-manager/monster-db
frosthaven-manager/observable-operator
racket/gui/easy
(only-in racket/gui get-file put-file application-about-handler)
(only-in frosthaven-manager/elements elements))

(define modifier
(case (system-type 'os)
Expand Down
4 changes: 2 additions & 2 deletions gui/mixins.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
define-close!
hide-caret/selection)

(require (only-in racket/gui/base top-level-window<%>)
syntax/parse/define)
(require syntax/parse/define
(only-in racket/gui/base top-level-window<%>))

;; Dialogs need to be closed, but rendering a dialog yields so there's
;; no way to retrieve a dialog's renderer from within itself. This
Expand Down
7 changes: 3 additions & 4 deletions gui/monster-modifier.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
#:on-remove (-> exact-nonnegative-integer? any)}
(is-a?/c view<%>))]))

(require racket/gui/easy
racket/gui/easy/contract
(require frosthaven-manager/defns
frosthaven-manager/observable-operator
frosthaven-manager/qi/utils

frosthaven-manager/defns)
racket/gui/easy
racket/gui/easy/contract)

(define (modify-monster-deck-menu-item @monster-ability-cards
#:on-add [add void]
Expand Down
9 changes: 4 additions & 5 deletions gui/number-players.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
(#:label (maybe-obs/c maybe-label/c))
(is-a?/c view<%>))]))

(require racket/gui/easy
racket/gui/easy/contract

frosthaven-manager/defns
frosthaven-manager/observable-operator)
(require frosthaven-manager/defns
frosthaven-manager/observable-operator
racket/gui/easy
racket/gui/easy/contract)

(define (number-players-picker #:choose on-choose #:selection selection #:label [label "Number of Players"])
(choice #:label (@ label)
Expand Down
23 changes: 11 additions & 12 deletions gui/player-info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
#:kill-summon (-> natural-number/c any))
(is-a?/c view<%>))]))

(require racket/gui/easy
frosthaven-manager/observable-operator
racket/gui/easy/contract
frosthaven-manager/defns
(require frosthaven-manager/defns
frosthaven-manager/gui/counter
frosthaven-manager/gui/render
frosthaven-manager/gui/mixins
frosthaven-manager/gui/font
frosthaven-manager/gui/helpers
frosthaven-manager/gui/rich-text-display)
frosthaven-manager/gui/mixins
frosthaven-manager/gui/render
frosthaven-manager/gui/rich-text-display
frosthaven-manager/observable-operator
racket/gui/easy
racket/gui/easy/contract)

(define (player-view @player
#:on-condition [on-condition void]
Expand Down Expand Up @@ -233,11 +233,10 @@

(module+ main
(define (update-players players k f)
(map (λ (e)
(if (eq? (car e) k)
(cons k (f (cdr e)))
e))
players))
(for/list ([e (in-list players)])
(if (eq? (car e) k)
(cons k (f (cdr e)))
e)))
(define/obs @players
(list
(cons 0 (player "A" 15 10 3 (list regenerate invisible immobilize) 23
Expand Down
8 changes: 4 additions & 4 deletions gui/render.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
with-closing-custodian/eventspace
closing-custodian closing-eventspace close-custodian-mixin)

(require racket/gui
(for-syntax racket/base)
syntax/parse/define
racket/stxparam)
(require (for-syntax racket/base)
racket/gui
racket/stxparam
syntax/parse/define)

(define current-renderer (make-parameter #f))

Expand Down
8 changes: 4 additions & 4 deletions gui/rewards.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
(#:mixin (make-mixin-contract top-level-window<%>))
(is-a?/c view<%>))]))

(require (only-in racket/gui top-level-window<%>)
(require frosthaven-manager/defns
frosthaven-manager/manager/loot
frosthaven-manager/observable-operator
racket/gui/easy
racket/gui/easy/contract
frosthaven-manager/defns
frosthaven-manager/observable-operator
frosthaven-manager/manager/loot)
(only-in racket/gui top-level-window<%>))

(module+ test (require rackunit))

Expand Down
12 changes: 6 additions & 6 deletions gui/rich-text-display.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
'resize-corner 'deleted 'transparent)))
(is-a?/c view<%>))]))

(require (except-in racket/gui newline)
(require frosthaven-manager/gui/mixins
pict/snip
racket/gui/easy
racket/gui/easy/contract
racket/gui/easy/observable
pict/snip
(prefix-in pict: pict)
frosthaven-manager/gui/mixins)
(except-in racket/gui newline)
(prefix-in pict: pict))

(module model racket
(provide
Expand All @@ -46,9 +46,9 @@
newline?))
any/c)]))

(require racket/snip
(require pict
racket/draw
pict)
racket/snip)

(define newline
(let ([s (make-object string-snip% "\n")])
Expand Down
8 changes: 4 additions & 4 deletions gui/round-number.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
(#:new-round-number (-> (-> natural-number/c natural-number/c) any))
(is-a?/c window-view<%>))]))

(require racket/gui/easy
racket/gui/easy/contract
frosthaven-manager/observable-operator
(require frosthaven-manager/gui/counter
frosthaven-manager/gui/mixins
frosthaven-manager/gui/counter)
frosthaven-manager/observable-operator
racket/gui/easy
racket/gui/easy/contract)

(define (round-number-modifier @round #:new-round-number [send-new-round void])
(define-close! close! closing-mixin)
Expand Down
6 changes: 3 additions & 3 deletions gui/round-prompts.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
(is-a?/c view<%>))]
[do-round-prompt (-> time/c natural-number/c any)]))

(require racket/gui/easy
racket/gui/easy/contract
(require frosthaven-manager/gui/mixins
frosthaven-manager/manager/round-prompts
frosthaven-manager/observable-operator
frosthaven-manager/qi/utils
frosthaven-manager/gui/mixins)
racket/gui/easy
racket/gui/easy/contract)

(define (prompts-input-view @prompts #:on-add [on-add void] #:on-remove [on-remove void])
(define @keyed-prompts
Expand Down
10 changes: 5 additions & 5 deletions gui/server.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
(contract-out
[launch-server (-> state? renderer?)]))

(require (except-in racket/gui #%app)
racket/gui/easy
net/sendurl
frosthaven-manager/observable-operator
frosthaven-manager/gui/render
(require frosthaven-manager/gui/render
frosthaven-manager/manager
frosthaven-manager/observable-operator
net/sendurl
racket/gui/easy
(except-in racket/gui #%app)
(prefix-in server: frosthaven-manager/server))

(define (launch-server s)
Expand Down
4 changes: 2 additions & 2 deletions gui/table.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

(module+ test
(require frosthaven-manager/defns
frosthaven-manager/monster-db
frosthaven-manager/manager/loot)
frosthaven-manager/manager/loot
frosthaven-manager/monster-db)

(test-case "make-preview-rows for monster abilities"
(define-values {_info abilities} (get-dbs default-monster-db))
Expand Down
Loading

0 comments on commit fe9d67b

Please sign in to comment.