Random pickiness.
Spaces at EOFs, indentation, etc.
This commit is contained in:
parent
3250d97f71
commit
7d6e79023c
|
@ -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)
|
||||
|
||||
|
|
|
@ -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))
|
||||
(stepper-syntax-property stx 'stepper-skip-completely #t))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
end))
|
||||
(syntax-e end))
|
||||
ends))
|
||||
|
||||
|
||||
;; Get the list of terminals out of input-terms
|
||||
|
||||
(list-of-non-terms
|
||||
|
|
|
@ -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))
|
||||
(make-rgba 0 0 51 255))
|
||||
|
|
|
@ -294,4 +294,4 @@
|
|||
[(eq? a #f) #f]
|
||||
[(eq? b #t) a]
|
||||
[(eq? b #f) #f]
|
||||
[else (append a b)]))
|
||||
[else (append a b)]))
|
||||
|
|
|
@ -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))]))
|
||||
(raise-syntax-error 'struct/c "expected a struct identifier" stx (syntax struct-name))]))
|
||||
|
|
|
@ -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*
|
||||
|
|
|
@ -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))
|
||||
;; 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))
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
(require (for-syntax racket/base))
|
||||
(provide (for-syntax (all-from-out racket/base)))
|
||||
(provide let-syntax)
|
||||
(provide let-syntax)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
@;{should not cause a warning}
|
||||
@cite[a b]
|
||||
|
||||
@gen-bib[]
|
||||
@gen-bib[]
|
||||
|
|
|
@ -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)))
|
||||
(->optkey -Pattern -Input (N ?N -Bytes) #:match-select sel #f output)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user