Fix lots of indentation mistakes.

(Found by my ayatollah script...)

original commit: af6be85ff576e475753a46bd3f1690eb8bf88a28
This commit is contained in:
Eli Barzilay 2013-03-14 07:15:43 -04:00
parent b8c9e1f63f
commit 8c1e485526
15 changed files with 142 additions and 143 deletions

View File

@ -1,7 +1,7 @@
#lang typed-scheme
(require/typed
scheme/base
[values (All (T) ((Any -> Boolean) -> (Any -> Boolean : T)))])
scheme/base
[values (All (T) ((Any -> Boolean) -> (Any -> Boolean : T)))])
(: number->string? (Any -> Boolean : (Number -> String)))
(define (number->string? x)

View File

@ -4,13 +4,13 @@
(require/typed (make-main (([Listof Node] [Listof Edge] -> Graph)
(State Number Number MouseEvent -> State)
(State KeyEvent -> State)
(State -> Scene)
(Any -> Boolean)
(State -> Boolean)
(Stop -> Graph)
(Any -> Edge)
(Edge -> Graph)
->
(Boolean -> Graph))))
(State Number Number MouseEvent -> State)
(State KeyEvent -> State)
(State -> Scene)
(Any -> Boolean)
(State -> Boolean)
(Stop -> Graph)
(Any -> Edge)
(Edge -> Graph)
->
(Boolean -> Graph))))

View File

@ -3,20 +3,20 @@
#lang typed/scheme/base
(: gen-lambda-n-rest ((Any -> Any)
-> (Any -> (Any Any Any Any * -> Any))))
-> (Any -> (Any Any Any Any * -> Any))))
(define (gen-lambda-n-rest body)
(error 'fail))
(error 'fail))
(: gen-lambda (Integer Any -> (Any -> (Any * -> Any))))
(define (gen-lambda nb-vars body)
(case nb-vars
((3) (gen-lambda-3 body))
(else (gen-lambda-n nb-vars body))))
(case nb-vars
((3) (gen-lambda-3 body))
(else (gen-lambda-n nb-vars body))))
(: gen-lambda-3 (Any -> (Any -> (Any Any Any -> Any))))
(define (gen-lambda-3 body)
(error 'fail))
(error 'fail))
(: gen-lambda-n (Integer Any -> (Any -> (Any Any Any Any * -> Any))))
(define (gen-lambda-n nb-vars body)
(error 'fail))
(error 'fail))

View File

@ -74,7 +74,7 @@
(when (verbose?)
(log-warning (format "TR tests: waiting for ~a ~a" dir p)))
(force prm))))))
(make-test-suite dir tests)))
(make-test-suite dir tests)))
(define succ-tests (mk-tests "succeed"
(lambda (p thnk)

View File

@ -8,8 +8,8 @@
(syntax-case stx ()
((_ body ...)
#'(call/cc (lambda: ((k : (Any -> Nothing)))
(parameterize ((abort k))
body ...))))))
(parameterize ((abort k))
body ...))))))
(call-with-exception-handler
(lambda (v) (displayln v) ((abort) v))

View File

@ -14,11 +14,11 @@
(syntax-case stx ()
[(_ name path ...)
(with-syntax ([(match-clause ...) (map path->clause (syntax-e #'(path ...)))])
#`(define (name p )
(let* ([dirnames (map path->string (explode-path p))])
(match (reverse dirnames) ; goofy backwards matching because ... matches greedily
match-clause ...
[_ #f]))))]))
#`(define (name p )
(let* ([dirnames (map path->string (explode-path p))])
(match (reverse dirnames) ; goofy backwards matching because ... matches greedily
match-clause ...
[_ #f]))))]))
(define-excluder default-excluder
"compiled" ".git")

View File

@ -6,7 +6,7 @@
(display i)))
(for: : Void ((i : Integer (ann '(1 2 3) (Sequenceof Integer))) ; doesn't
(j : Char "abc"))
(j : Char "abc"))
(display (list i j)))

View File

@ -194,44 +194,44 @@
(flvector))
(test-flvector (for/flvector: #:length 4 ([x (in-range 2)]
#:when #t
[y (in-range 2)])
#:when #t
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 1.0 2.0))
(test-flvector (for/flvector: #:length 4 ([x (in-range 0)]
#:when #t
[y (in-range 2)])
#:when #t
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector 0.0 0.0 0.0 0.0))
(test-flvector (for/flvector: #:length 4 ([x (in-range 2)]
#:when #t
[y (in-range 1)])
#:when #t
[y (in-range 1)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 0.0 0.0))
(test-flvector (for/flvector: #:length 4 ([x (in-range 2)]
#:when #t
[y (in-range 3)])
#:when #t
[y (in-range 3)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 2.0 1.0))
(test-flvector (for/flvector: #:length 0 ([x (in-range 2)]
#:when #t
[y (in-range 3)])
#:when #t
[y (in-range 3)])
(real->double-flonum (+ x y)))
(flvector))
(test-flvector (for/flvector: ([x (in-range 2)]
#:when #t
[y (in-range 2)])
#:when #t
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 1.0 2.0))
(test-flvector (for/flvector: ([x (in-range 0)]
#:when #t
[y (in-range 2)])
#:when #t
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector))
@ -274,36 +274,36 @@
(flvector))
(test-flvector (for*/flvector: #:length 4 ([x (in-range 2)]
[y (in-range 2)])
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 1.0 2.0))
(test-flvector (for*/flvector: #:length 4 ([x (in-range 0)]
[y (in-range 2)])
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector 0.0 0.0 0.0 0.0))
(test-flvector (for*/flvector: #:length 4 ([x (in-range 2)]
[y (in-range 1)])
[y (in-range 1)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 0.0 0.0))
(test-flvector (for*/flvector: #:length 4 ([x (in-range 2)]
[y (in-range 3)])
[y (in-range 3)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 2.0 1.0))
(test-flvector (for*/flvector: #:length 0 ([x (in-range 2)]
[y (in-range 3)])
[y (in-range 3)])
(real->double-flonum (+ x y)))
(flvector))
(test-flvector (for*/flvector: ([x (in-range 2)]
[y (in-range 2)])
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector 0.0 1.0 1.0 2.0))
(test-flvector (for*/flvector: ([x (in-range 0)]
[y (in-range 2)])
[y (in-range 2)])
(real->double-flonum (+ x y)))
(flvector))

View File

@ -8,6 +8,6 @@
(: make-empty-env (case-lambda [-> Environment]
[Environment -> Environment]))
(define make-empty-env
(case-lambda: [() (make-Environment #f (make-hasheq))]
[((parent : Environment)) (make-Environment parent
(make-hasheq))]))
(case-lambda:
[() (make-Environment #f (make-hasheq))]
[((parent : Environment)) (make-Environment parent (make-hasheq))]))

View File

@ -510,7 +510,7 @@
(define: (mrg32k3a-random-large [state : State] [n : Nb]) : Nb ; n > m-max
(do: : Integer ((k : Integer 2 (+ k 1))
(mk : Integer (* mrg32k3a-m-max mrg32k3a-m-max) (* mk mrg32k3a-m-max)))
(mk : Integer (* mrg32k3a-m-max mrg32k3a-m-max) (* mk mrg32k3a-m-max)))
((>= mk n)
(let* ((mk-by-n (quotient mk n))
(a (* mk-by-n n)))
@ -530,7 +530,7 @@
(define: (mrg32k3a-random-real-mp [state : State] [unit : Real]) : Number
(do: : Real ((k : Integer 1 (+ k 1))
(u : Real (- (/ 1 unit) 1) (/ u mrg32k3a-m1)))
(u : Real (- (/ 1 unit) 1) (/ u mrg32k3a-m1)))
((<= u 1)
(/ (exact->inexact (+ (mrg32k3a-random-power state k) 1))
(exact->inexact (+ (expt mrg32k3a-m-max k) 1))))))
@ -545,7 +545,7 @@
(define: (make-random-source) : Random
(let: ((state : State (mrg32k3a-pack-state ; make a new copy
(list->vector (vector->list mrg32k3a-initial-state)))))
(list->vector (vector->list mrg32k3a-initial-state)))))
(:random-source-make
(lambda: ()
(mrg32k3a-state-ref state))

View File

@ -58,15 +58,15 @@
(thread-cell-set! tc 1)
(thread-wait (thread (lambda ()
(displayln (thread-cell-ref tc))
(thread-cell-set! tc 2)
(displayln (thread-cell-ref tc)))))
(displayln (thread-cell-ref tc))
(thread-cell-set! tc 2)
(displayln (thread-cell-ref tc)))))
(thread-cell-ref tc)
(define blocked-thread
(thread (lambda ()
(channel-get ((inst make-channel 'unused))))))
(channel-get ((inst make-channel 'unused))))))
(thread-suspend blocked-thread)

View File

@ -398,10 +398,10 @@
[map (-polydots (c a b)
(cl->*
(-> (-> a c) (-pair a (-lst a)) (-pair c (-lst c)))
((list
((list a) (b b) . ->... . c)
(-lst a))
((-lst b) b) . ->... .(-lst c))))]
((list
((list a) (b b) . ->... . c)
(-lst a))
((-lst b) b) . ->... .(-lst c))))]
[for-each (-polydots (c a b) ((list ((list a) (b b) . ->... . Univ) (-lst a))
((-lst b) b) . ->... . -Void))]
#;[fold-left (-polydots (c a b) ((list ((list c a) (b b) . ->... . c) c (-lst a))
@ -473,11 +473,10 @@
;thread-suspend-evt
;Section 10.1.4
[thread-send (-poly (a)
(cl->*
(-> -Thread Univ -Void)
(-> -Thread Univ (-val #f) (-opt -Void))
(-> -Thread Univ (-> a) (Un -Void a))))]
[thread-send
(-poly (a) (cl->* (-> -Thread Univ -Void)
(-> -Thread Univ (-val #f) (-opt -Void))
(-> -Thread Univ (-> a) (Un -Void a))))]
[thread-receive (-> Univ)]
[thread-try-receive (-> Univ)]
[thread-rewind-receive (-> (-lst Univ) -Void)]
@ -552,9 +551,10 @@
[char-whitespace? (-> -Char B)]
[char-blank? (-> -Char B)]
[char-iso-control? (-> -Char B)]
[char-general-category (-> -Char (apply Un (map -val
'(lu ll lt lm lo mn mc me nd nl no ps pe pi pf pd
pc po sc sm sk so zs zp zl cc cf cs co cn))))]
[char-general-category
(-> -Char (apply Un (map -val
'(lu ll lt lm lo mn mc me nd nl no ps pe pi pf pd
pc po sc sm sk so zs zp zl cc cf cs co cn))))]
[make-known-char-range-list (-> (-lst (-Tuple (list -PosInt -PosInt B))))]
[char-upcase (-> -Char -Char)]
@ -823,7 +823,8 @@
[build-path (cl->*
[build-path
(cl->*
((list -Pathlike*) -Pathlike* . ->* . -Path)
((list -SomeSystemPathlike*) -SomeSystemPathlike* . ->* . -SomeSystemPath))]
[build-path/convention-type
@ -1567,10 +1568,10 @@
-Index))]
[vector-filter (-poly (a b) (cl->*
((asym-pred a Univ (-FS (-filter b 0) -top))
(-vec a)
. -> .
(-vec b))
((a . -> . Univ) (-vec a) . -> . (-vec a))))]
(-vec a)
. -> .
(-vec b))
((a . -> . Univ) (-vec a) . -> . (-vec a))))]
[vector-filter-not
(-poly (a b) (cl->* ((a . -> . Univ) (-vec a) . -> . (-vec a))))]
@ -1580,7 +1581,7 @@
((-vec a) -Integer . -> . (-vec a))
((-vec a) -Integer -Integer . -> . (-vec a))))]
[vector-map (-polydots (c a b) ((list ((list a) (b b) . ->... . c) (-vec a))
((-vec b) b) . ->... .(-vec c)))]
((-vec b) b) . ->... .(-vec c)))]
[vector-map! (-polydots (a b) ((list ((list a) (b b) . ->... . a) (-vec a))
((-vec b) b) . ->... .(-vec a)))]
[vector-append (-poly (a) (->* (list) (-vec a) (-vec a)))]
@ -1623,9 +1624,9 @@
(arg-in (make-opt-in-port in))
(arg-err (make-opt-out-port err))
(result (-values (list -Subprocess
(make-opt-in-port (not out))
(make-opt-out-port (not in))
(make-opt-in-port (not err))))))
(make-opt-in-port (not out))
(make-opt-out-port (not in))
(make-opt-in-port (not err))))))
(if exact
(-> arg-out arg-in arg-err -Pathlike (-val 'exact) -String result)
(->* (list arg-out arg-in arg-err -Pathlike)
@ -1661,32 +1662,29 @@
[process (-> -String
(-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->*
(-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void)))))]
(cl->* (-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void)))))]
[process*
(cl->*
(->* (list -Pathlike) (Un -Path -String -Bytes)
(-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->*
(-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void)))))
(-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->* (-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void)))))
(-> -Pathlike (-val 'exact) -String
(-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->*
(-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void))))))]
(-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->* (-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void))))))]
[process/ports
(let* ((fun-type
@ -1720,12 +1718,12 @@
(err-vals '(#t #f stdout)))
(for*/list ((out bools) (in bools) (err err-vals))
(make-specific-case out in err)))))
(apply cl->*
(append
specific-cases
(list
(-> (-opt -Output-Port) (-opt -Input-Port) (Un -Output-Port (one-of/c #f 'stdout)) -String
(-lst* (-opt -Input-Port) (-opt -Output-Port) -Nat (-opt -Input-Port) fun-type))))))]
(apply cl->*
(append
specific-cases
(list
(-> (-opt -Output-Port) (-opt -Input-Port) (Un -Output-Port (one-of/c #f 'stdout)) -String
(-lst* (-opt -Input-Port) (-opt -Output-Port) -Nat (-opt -Input-Port) fun-type))))))]
[process*/ports
(let* ((fun-type
@ -1765,14 +1763,14 @@
(err-vals '(#t #f stdout)))
(for*/list ((out bools) (in bools) (err err-vals) (exact bools))
(make-specific-case out in err exact)))))
(apply cl->*
(append specific-cases
(list
(->* (list (-opt -Output-Port) (-opt -Input-Port) (Un -Output-Port (one-of/c #f 'stdout)) -Pathlike)
(apply cl->*
(append specific-cases
(list
(->* (list (-opt -Output-Port) (-opt -Input-Port) (Un -Output-Port (one-of/c #f 'stdout)) -Pathlike)
(Un -Path -String -Bytes)
(-lst* (-opt -Input-Port) (-opt -Output-Port) -Nat (-opt -Input-Port) fun-type))
(-> (-opt -Output-Port) (-opt -Input-Port) (Un -Output-Port (one-of/c #f 'stdout)) -Pathlike (-val 'exact) -String
(-lst* (-opt -Input-Port) (-opt -Output-Port) -Nat (-opt -Input-Port) fun-type))))))]
(-lst* (-opt -Input-Port) (-opt -Output-Port) -Nat (-opt -Input-Port) fun-type))
(-> (-opt -Output-Port) (-opt -Input-Port) (Un -Output-Port (one-of/c #f 'stdout)) -Pathlike (-val 'exact) -String
(-lst* (-opt -Input-Port) (-opt -Output-Port) -Nat (-opt -Input-Port) fun-type))))))]
@ -2327,8 +2325,8 @@
;12.1.10.1
[port->list
(-poly (a) (cl->*
(-> (-lst Univ))
(->opt (-> -Input-Port a) [-Input-Port] (-lst a))))]
(-> (-lst Univ))
(->opt (-> -Input-Port a) [-Input-Port] (-lst a))))]
[port->string (->opt [-Input-Port] -String)]
[port->bytes (->opt [-Input-Port] -Bytes)]
#|

View File

@ -20,19 +20,19 @@
((~and kw2 #%plain-app) (~and m map) f l))
#:with opt
(begin (reset-unboxed-gensym)
(with-syntax ([(f* lp v lst) (map unboxed-gensym '(f* loop v lst))]
[l ((optimize) #'l)]
[f ((optimize) #'f)])
(log-optimization "apply-map" "apply-map deforestation."
this-syntax)
(add-disappeared-use #'appl)
(add-disappeared-use #'kw2)
(add-disappeared-use #'m)
(syntax/loc/origin
this-syntax #'kw
(let ([f* f])
(let lp ([v op.identity] [lst l])
(if (null? lst)
v
(lp (op v (f* (unsafe-car lst)))
(unsafe-cdr lst))))))))))
(with-syntax ([(f* lp v lst) (map unboxed-gensym '(f* loop v lst))]
[l ((optimize) #'l)]
[f ((optimize) #'f)])
(log-optimization "apply-map" "apply-map deforestation."
this-syntax)
(add-disappeared-use #'appl)
(add-disappeared-use #'kw2)
(add-disappeared-use #'m)
(syntax/loc/origin
this-syntax #'kw
(let ([f* f])
(let lp ([v op.identity] [lst l])
(if (null? lst)
v
(lp (op v (f* (unsafe-car lst)))
(unsafe-cdr lst))))))))))

View File

@ -209,14 +209,14 @@
(with-syntax ([((extra ...) ...)
(for/list ([i (in-range (add1 (length l)))])
(take l i))])
#'(make-Function
(list
(make-arr* (list ty ... extra ...)
rng
#:kws (sort #:key (match-lambda [(Keyword: kw _ _) kw])
(list (make-Keyword 'k kty opt) ...)
keyword<?))
...))))]))
#'(make-Function
(list
(make-arr* (list ty ... extra ...)
rng
#:kws (sort #:key (match-lambda [(Keyword: kw _ _) kw])
(list (make-Keyword 'k kty opt) ...)
keyword<?))
...))))]))
(define (make-arr-dots dom rng dty dbound)
(make-arr* dom rng #:drest (cons dty dbound)))

View File

@ -49,10 +49,11 @@
(syntax-parse stx
[(require/contract nm:renameable hidden:id cnt lib)
#`(begin (require (only-in lib [nm.orig-nm nm.orig-nm-r]))
(define-syntax nm.nm (make-rename-transformer
(syntax-property (syntax-property (quote-syntax hidden)
'not-free-identifier=? #t)
'not-provide-all-defined #t)))
(define-syntax nm.nm
(make-rename-transformer
(syntax-property (syntax-property (quote-syntax hidden)
'not-free-identifier=? #t)
'not-provide-all-defined #t)))
(define-ignored hidden
(contract cnt
(get-alternate nm.orig-nm-r)