;; -*- racket-indent-sequence-depth: 100; racket-indent-curly-as-sequence: t; -*- ;;; NOTE: After changing this file you will need to M-x faceup-write-file ;;; to regenerate the .faceup test comparison file. ;;; ;;; NOTE: You may need to disable certain features -- for example ;;; global-paren-face-mode -- during the M-x faceup-write-file. #lang racket (require xml) (provide valid-bucket-name?) ;; Various def* forms are font-locked: (define (function foo) #t) (define ((curried-function x) y) (list x y)) (define a-var 10) (define/contract (f2 x) (any/c . -> . any) #t) (define-values (1st-var 2nd-var) (values 1 2)) (define-thing foo) ;bug 276 ;; let: font-lock identifiers (let ([foo 10] [bar 20]) foo) (let loop ([x 10]) (unless (zero? x) (loop (sub1 x)))) (let* ([foo 10] [bar 20]) foo) (let-values ([(a b) (values 1 2)]) (values a b)) (let*-values ([(a b) (values 1 2)]) (values a b)) (letrec-values ([(a b) (values 1 2)]) (values a b)) (let-syntax ([foo #'foo]) foo) (letrec-syntax ([foo #'foo]) foo) (let-syntaxes ([(foo) #'foo]) foo) (letrec-syntaxes ([(foo) #'foo]) foo) (letrec-syntaxes+values ([(foo) #'foo]) ([(a b) (values 1 2)]) foo) ;; for/fold is indented correctly: (for/fold ([str ""]) ([ss '("a" "b" "c")]) (string-append str ss)) ;; Auto-converts word `lambda` to `λ`: (lambda (x) #t) ;; Or use M-C-y to insert to insert `λ` char. ;; Smart indentation for quoted lists: '(1 2 3 4) ;; Smart indentation for vector literals: #(1 2 3 4) ;; Smart indentation for Rackjure dict literals: (module x rackjure {'a 0 'b 2}) ;; Silly test submodule example. ;; Try using C-c C-f to Fold (hide) it, and C-c C-u to Unfold it. (module+ test (require rackunit) (check-true #t)) ;; Single line comment #| Multi-line comment |# ;; Issue 362 #|aaa() |# #|(hello)|# #;(sexpr comment) ;; Nested sexpr comments (list 2 #;2) (list 1 #;4 #;(3)) (let (#;[x #;1] [y 2]) y) ;; Issue 388 1 ; #; 2 (define x #<* . boolean?) (cond [dns-compliant? (and (<= 3 (string-length s)) (<= (string-length s) 63) (not (regexp-match #px"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}" s)) (for/and ([s (regexp-split #rx"\\." s)]) (define (valid-first-or-last? c) (or (char-lower-case? (string-ref s 0)) (char-numeric? (string-ref s 0)))) (define (valid-mid? c) (or (valid-first-or-last? c) (equal? c #\-))) (define len (string-length s)) (and (< 0 len) (valid-first-or-last? (string-ref s 0)) (valid-first-or-last? (string-ref s (sub1 len))) (or (<= len 2) (for/and ([c (substring s 1 (sub1 len))]) (valid-mid? c))))))] [else (and (<= (string-length s) 255) (for/and ([c s]) (or (char-numeric? c) (char-lower-case? c) (char-upper-case? c) (equal? c #\.) (equal? c #\-) (equal? c #\_))))])) (displayln "I'm running!") ;; Issue 366 #"1" #"22" #"333"