From 7d6e79023cf9872e6f6af2f89961b742c6296f1d Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 21 Jun 2012 01:54:23 -0400 Subject: [PATCH] Random pickiness. Spaces at EOFs, indentation, etc. --- collects/ffi/unsafe.rkt | 3 +- collects/lang/run-teaching-program.rkt | 2 +- collects/mrlib/matrix-snip.rkt | 2 +- collects/mrlib/private/image-core-bitmap.rkt | 8 ++-- collects/mrlib/syntax-browser.rkt | 2 +- collects/mzlib/integer-set.rkt | 6 +-- collects/parser-tools/lex.rkt | 4 +- .../private-lex/unicode-chars.rkt | 10 ++--- .../private-yacc/input-file-parser.rkt | 2 +- .../tests/map-image-bsl-tests.rkt | 2 +- collects/racket/contract/private/opt-guts.rkt | 2 +- .../racket/contract/private/struct-dc.rkt | 2 +- collects/racket/private/string.rkt | 6 +-- collects/stepper/private/syntax-property.rkt | 42 +++++++++---------- collects/tests/htdp-lang/syntax.rkt | 2 +- collects/tests/racket/basic.rktl | 2 +- .../docs/autobib-disambiguation-corner.scrbl | 2 +- collects/typed-racket/base-env/base-env.rkt | 2 +- 18 files changed, 49 insertions(+), 52 deletions(-) diff --git a/collects/ffi/unsafe.rkt b/collects/ffi/unsafe.rkt index 06c6be29ba..cfdb3d85a5 100644 --- a/collects/ffi/unsafe.rkt +++ b/collects/ffi/unsafe.rkt @@ -1636,7 +1636,8 @@ (if (regexp? (caar rs)) (object-name (caar rs)) (caar rs))) regexp-replace regexp-replace*) - (caar rs) str (cadar rs)) (cdr rs))))) + (caar rs) str (cadar rs)) + (cdr rs))))) (define killer-thread #f) diff --git a/collects/lang/run-teaching-program.rkt b/collects/lang/run-teaching-program.rkt index 33298d9f24..7eb9069c2a 100644 --- a/collects/lang/run-teaching-program.rkt +++ b/collects/lang/run-teaching-program.rkt @@ -138,4 +138,4 @@ ;; stepper-skip : syntax -> syntax ;; tag the expression with stepper-skip-completely (define (stepper-skip stx) - (stepper-syntax-property stx 'stepper-skip-completely #t)) \ No newline at end of file + (stepper-syntax-property stx 'stepper-skip-completely #t)) diff --git a/collects/mrlib/matrix-snip.rkt b/collects/mrlib/matrix-snip.rkt index 8949e23afe..c383d56801 100644 --- a/collects/mrlib/matrix-snip.rkt +++ b/collects/mrlib/matrix-snip.rkt @@ -43,7 +43,7 @@ [(pair? M_0) M_0] [else (error 'visible% "expects matrix or rectangle, given: ~e" M_0)])]) - + (define/public (get-M) (if M M R)) ;; create a matrix from this instance diff --git a/collects/mrlib/private/image-core-bitmap.rkt b/collects/mrlib/private/image-core-bitmap.rkt index 6a56a7f096..2ac019aeac 100644 --- a/collects/mrlib/private/image-core-bitmap.rkt +++ b/collects/mrlib/private/image-core-bitmap.rkt @@ -24,20 +24,20 @@ instead of this scaling code, we use the dc<%>'s scaling code. (provide/contract [scale-bitmap (-> bytes? natural-number/c natural-number/c (and/c real? (not/c negative?)) bytes?)]) - - + + ; bmbytes: a bytes which represents an image -- ; its size is a multiple of 4, and each ; four consecutive bytes represent alpha,r,g,b. - + ; scale: given a bmbytes, ; return a new bmbytes scaled by k in each direction. ; ; TODO: this code is meant for scaling by (>= k 1); ; if (< k 1) then the result will ignore ~ (1-k) of the original's pixels. ; We should really do a proper averaging for that case. -; +; (define (scale-bitmap bmbytes w h k) (let* {[new-w (round/e (* w k))] [new-h (round/e (* h k))] diff --git a/collects/mrlib/syntax-browser.rkt b/collects/mrlib/syntax-browser.rkt index 3bff33b20f..d616610289 100644 --- a/collects/mrlib/syntax-browser.rkt +++ b/collects/mrlib/syntax-browser.rkt @@ -161,7 +161,7 @@ needed to really make this work: (send output-text last-position)) (hash-ref range-ht stx-object (λ () null)))))))) (pop!))]) - + ;; reset `path' and `next-push' for use in pp hooks. (set! path '()) (set! next-push 0) diff --git a/collects/mzlib/integer-set.rkt b/collects/mzlib/integer-set.rkt index 035cc6ae31..367b86c9c7 100644 --- a/collects/mzlib/integer-set.rkt +++ b/collects/mzlib/integer-set.rkt @@ -132,7 +132,7 @@ ((merge-helper '((2 . 2) (4 . 4) (6 . 7) (9 . 9) (11 . 11)) '((1 . 1) (3 . 3) (5 . 5) (8 . 8) (10 . 10) (12 . 12))) '((1 . 12)))) - + ;; merge : integer-set integer-set -> integer-set ;; Union of s1 and s2 (define (merge s1 s2) @@ -283,8 +283,8 @@ ((c '((1 . 5) (7 . 12)) 2 8) '((6 . 6))) ((c '((1 . 5) (7 . 12)) 6 6) '((6 . 6))) ((c '((1 . 5) (7 . 12)) 7 7) '())) - - + + ;; member?-helper : int (listof (cons int int)) -> bool (define (member?-helper i is) (and diff --git a/collects/parser-tools/lex.rkt b/collects/parser-tools/lex.rkt index d711808e34..cc4f393991 100644 --- a/collects/parser-tools/lex.rkt +++ b/collects/parser-tools/lex.rkt @@ -315,9 +315,9 @@ (let ((match (read-string longest-match-length lb))) ;(printf "(read-string ~e port) = ~e\n" longest-match-length match) (do-match lb first-pos longest-match-action match))) - + (define file-path (make-parameter #f)) - + (define (do-match ip first-pos action value) #;(printf "(action ~a ~a ~a ~a)\n" (position-offset first-pos) (position-offset (get-position ip)) value ip) diff --git a/collects/parser-tools/private-lex/unicode-chars.rkt b/collects/parser-tools/private-lex/unicode-chars.rkt index 3177bb5c64..457aaf52b4 100644 --- a/collects/parser-tools/private-lex/unicode-chars.rkt +++ b/collects/parser-tools/private-lex/unicode-chars.rkt @@ -37,8 +37,7 @@ (cons (cons range-start (sub1 i)) (loop i (add1 i) #f))) (else (loop i (add1 i) #t)))))))))) - - + (define (compute-ranges x?) (delay (get-chars-for (lambda (x) (x? (integer->char x))) mapped-chars))) @@ -54,10 +53,9 @@ (define blank-ranges (compute-ranges char-blank?)) ;; 9 #;(define hexadecimal-ranges (compute-ranges char-hexadecimal?)) (define iso-control-ranges (compute-ranges char-iso-control?)) ;; 2 - - - - + + + (test-block () ((get-chars-for odd? '()) '()) ((get-chars-for odd? '((1 4 #f) (8 13 #f))) '((1 . 1) (3 . 3) (9 . 9) (11 . 11) (13 . 13))) diff --git a/collects/parser-tools/private-yacc/input-file-parser.rkt b/collects/parser-tools/private-yacc/input-file-parser.rkt index 68accf4dff..521bddcc1e 100644 --- a/collects/parser-tools/private-yacc/input-file-parser.rkt +++ b/collects/parser-tools/private-yacc/input-file-parser.rkt @@ -122,7 +122,7 @@ end)) (syntax-e end)) ends)) - + ;; Get the list of terminals out of input-terms (list-of-non-terms diff --git a/collects/picturing-programs/tests/map-image-bsl-tests.rkt b/collects/picturing-programs/tests/map-image-bsl-tests.rkt index 13d8ab89a0..6eb46066f3 100644 --- a/collects/picturing-programs/tests/map-image-bsl-tests.rkt +++ b/collects/picturing-programs/tests/map-image-bsl-tests.rkt @@ -510,4 +510,4 @@ pic:bloch (make-rgba 0 0 255 255)) (check-expect (average-color (overlay (rectangle 5 10 "solid" "blue") (rectangle 25 10 "solid" "black"))) - (make-rgba 0 0 51 255)) \ No newline at end of file + (make-rgba 0 0 51 255)) diff --git a/collects/racket/contract/private/opt-guts.rkt b/collects/racket/contract/private/opt-guts.rkt index 5c51ddc165..ac67664b54 100644 --- a/collects/racket/contract/private/opt-guts.rkt +++ b/collects/racket/contract/private/opt-guts.rkt @@ -294,4 +294,4 @@ [(eq? a #f) #f] [(eq? b #t) a] [(eq? b #f) #f] - [else (append a b)])) \ No newline at end of file + [else (append a b)])) diff --git a/collects/racket/contract/private/struct-dc.rkt b/collects/racket/contract/private/struct-dc.rkt index 2c78297993..7c5446d7f6 100644 --- a/collects/racket/contract/private/struct-dc.rkt +++ b/collects/racket/contract/private/struct-dc.rkt @@ -1001,4 +1001,4 @@ (with-syntax ([(fields ...) (map selector-id->field selector-ids)]) #`(-struct/dc struct-name [fields args] ...))))] [(_ struct-name anything ...) - (raise-syntax-error 'struct/c "expected a struct identifier" stx (syntax struct-name))])) \ No newline at end of file + (raise-syntax-error 'struct/c "expected a struct identifier" stx (syntax struct-name))])) diff --git a/collects/racket/private/string.rkt b/collects/racket/private/string.rkt index 0d7c298a49..28650bcc83 100644 --- a/collects/racket/private/string.rkt +++ b/collects/racket/private/string.rkt @@ -432,13 +432,13 @@ (unless (or (string? string) (bytes? string)) (raise-argument-error 'regexp-replace* "(or/c string? bytes?)" - string)) + string)) (unless (or (string? replacement) (bytes? replacement) (procedure? replacement)) (raise-argument-error 'regexp-replace* - "(or/c string? bytes? procedure?)" - replacement)) + "(or/c string? bytes? procedure?)" + replacement)) (when (and needs-string? (bytes? replacement)) (raise-mismatch-error 'regexp-replace* diff --git a/collects/stepper/private/syntax-property.rkt b/collects/stepper/private/syntax-property.rkt index 4091367c6d..5977ccc837 100644 --- a/collects/stepper/private/syntax-property.rkt +++ b/collects/stepper/private/syntax-property.rkt @@ -72,25 +72,23 @@ )) - - ;; with-stepper-syntax-properties : like stepper-syntax-property, - ;; but in a "let"-like form - (define-syntax (with-stepper-syntax-properties stx) - (syntax-case stx () - [(_ ([property val] ...) body) - (foldl (lambda (property val b) - #`(stepper-syntax-property #,b #,property #,val)) - #'body - (syntax->list #`(property ...)) - (syntax->list #`(val ...)))])) - - - - ;; commonly used values for stepper-syntax-property: - (define skipto/cdr `(syntax-e cdr)) - (define skipto/cddr `(syntax-e cdr cdr)) - (define skipto/first `(syntax-e car)) - (define skipto/second `(syntax-e cdr car)) - (define skipto/third `(syntax-e cdr cdr car)) - (define skipto/fourth `(syntax-e cdr cdr cdr car)) - (define skipto/firstarg (append skipto/cdr skipto/second)) \ No newline at end of file +;; with-stepper-syntax-properties : like stepper-syntax-property, +;; but in a "let"-like form +(define-syntax (with-stepper-syntax-properties stx) + (syntax-case stx () + [(_ ([property val] ...) body) + (foldl (lambda (property val b) + #`(stepper-syntax-property #,b #,property #,val)) + #'body + (syntax->list #`(property ...)) + (syntax->list #`(val ...)))])) + + +;; commonly used values for stepper-syntax-property: +(define skipto/cdr `(syntax-e cdr)) +(define skipto/cddr `(syntax-e cdr cdr)) +(define skipto/first `(syntax-e car)) +(define skipto/second `(syntax-e cdr car)) +(define skipto/third `(syntax-e cdr cdr car)) +(define skipto/fourth `(syntax-e cdr cdr cdr car)) +(define skipto/firstarg (append skipto/cdr skipto/second)) diff --git a/collects/tests/htdp-lang/syntax.rkt b/collects/tests/htdp-lang/syntax.rkt index 896ecf244c..01177341e9 100644 --- a/collects/tests/htdp-lang/syntax.rkt +++ b/collects/tests/htdp-lang/syntax.rkt @@ -2,4 +2,4 @@ (require (for-syntax racket/base)) (provide (for-syntax (all-from-out racket/base))) -(provide let-syntax) \ No newline at end of file +(provide let-syntax) diff --git a/collects/tests/racket/basic.rktl b/collects/tests/racket/basic.rktl index 5d49e1a8bd..fa44d17eb6 100644 --- a/collects/tests/racket/basic.rktl +++ b/collects/tests/racket/basic.rktl @@ -1100,7 +1100,7 @@ (string-append (string-downcase one) "y" (string-upcase two)))) (test #"fox in socks, blue seal. trout in socks, blue fish!" - regexp-replace* + regexp-replace* #rx#"([a-z]+) ([a-z]+)" #"red fox, blue seal. red trout, blue trout!" (lambda (total color what) diff --git a/collects/tests/scribble/docs/autobib-disambiguation-corner.scrbl b/collects/tests/scribble/docs/autobib-disambiguation-corner.scrbl index 2defae0709..468bbbd7d6 100644 --- a/collects/tests/scribble/docs/autobib-disambiguation-corner.scrbl +++ b/collects/tests/scribble/docs/autobib-disambiguation-corner.scrbl @@ -16,4 +16,4 @@ @;{should not cause a warning} @cite[a b] -@gen-bib[] \ No newline at end of file +@gen-bib[] diff --git a/collects/typed-racket/base-env/base-env.rkt b/collects/typed-racket/base-env/base-env.rkt index 5c6f032fc3..31460e03af 100644 --- a/collects/typed-racket/base-env/base-env.rkt +++ b/collects/typed-racket/base-env/base-env.rkt @@ -2831,4 +2831,4 @@ (sel (-> (-lst (-opt ind-pair)) (-opt ind-pair))) (output (-opt (-pair ind-pair (-lst (-opt ind-pair))))) (-Input (Un -String -Input-Port -Bytes -Path))) - (->optkey -Pattern -Input (N ?N -Bytes) #:match-select sel #f output))) \ No newline at end of file + (->optkey -Pattern -Input (N ?N -Bytes) #:match-select sel #f output)))