Use a regular expression to indent for loops in framework
This commit is contained in:
parent
e7399f2bcc
commit
63b27a8eeb
|
@ -415,8 +415,6 @@
|
||||||
splicing-letrec-syntaxes splicing-letrec-syntaxes+values
|
splicing-letrec-syntaxes splicing-letrec-syntaxes+values
|
||||||
splicing-local splicing-syntax-parameterize
|
splicing-local splicing-syntax-parameterize
|
||||||
|
|
||||||
,@all-fors
|
|
||||||
|
|
||||||
do:
|
do:
|
||||||
|
|
||||||
kernel-syntax-case
|
kernel-syntax-case
|
||||||
|
@ -447,7 +445,7 @@
|
||||||
type-case))
|
type-case))
|
||||||
(preferences:set-default
|
(preferences:set-default
|
||||||
'framework:tabify
|
'framework:tabify
|
||||||
(list defaults-ht #rx"^begin" #rx"^def" #f #f)
|
(list defaults-ht #rx"^begin" #rx"^def" #rx"^for\\*?(/|$)" #f)
|
||||||
(list/c (hash/c symbol? (or/c 'for/fold 'define 'begin 'lambda) #:flat? #t)
|
(list/c (hash/c symbol? (or/c 'for/fold 'define 'begin 'lambda) #:flat? #t)
|
||||||
(or/c #f regexp?) (or/c #f regexp?) (or/c #f regexp?) (or/c #f regexp?)))
|
(or/c #f regexp?) (or/c #f regexp?) (or/c #f regexp?) (or/c #f regexp?)))
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,16 @@
|
||||||
(test-indentation "(lambdaa (x)\nb)" "(lambdaa (x)\n b)")
|
(test-indentation "(lambdaa (x)\nb)" "(lambdaa (x)\n b)")
|
||||||
(test-indentation "(define x\n (let/ec return\n (when 1\n (when 2\n\t\t 3))\n 2))"
|
(test-indentation "(define x\n (let/ec return\n (when 1\n (when 2\n\t\t 3))\n 2))"
|
||||||
"(define x\n (let/ec return\n (when 1\n (when 2\n 3))\n 2))")
|
"(define x\n (let/ec return\n (when 1\n (when 2\n 3))\n 2))")
|
||||||
|
(test-indentation "(for ([x 1])\nx)"
|
||||||
|
"(for ([x 1])\n x)")
|
||||||
|
(test-indentation "(for/list ([x 1])\nx)"
|
||||||
|
"(for/list ([x 1])\n x)")
|
||||||
|
(test-indentation "(for/anything ([x 1])\nx)"
|
||||||
|
"(for/anything ([x 1])\n x)")
|
||||||
|
(test-indentation "(for*/anything ([x 1])\nx)"
|
||||||
|
"(for*/anything ([x 1])\n x)")
|
||||||
|
(test-indentation "(for-anything ([x 1])\nx)"
|
||||||
|
"(for-anything ([x 1])\n x)")
|
||||||
(test-indentation "(for/fold ([x 1])\n([y 2])\n3\n4)"
|
(test-indentation "(for/fold ([x 1])\n([y 2])\n3\n4)"
|
||||||
"(for/fold ([x 1])\n ([y 2])\n 3\n 4)")
|
"(for/fold ([x 1])\n ([y 2])\n 3\n 4)")
|
||||||
(test-indentation "a\na\na\n" "a\na\na\n")
|
(test-indentation "a\na\na\n" "a\na\na\n")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user