]> gitweb.factorcode.org Git - factor.git/commitdiff
misc: sort vim keywords and fix GENERIC#.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 20 May 2014 16:33:34 +0000 (09:33 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 20 May 2014 16:33:34 +0000 (09:33 -0700)
misc/factor.vim.fgen
misc/vim/syntax/factor.vim

index 116e939b0740e467c3b7012bab48ce602f0907d1..852d32343af4d052a0745c19eecb42fb02c77cbb 100644 (file)
@@ -1,9 +1,9 @@
 <%
-USING: kernel io prettyprint vocabs sequences multiline ;
+USING: io kernel multiline prettyprint sequences sorting vocabs ;
 IN: factor.vim.fgen
 
 : print-keywords ( vocab -- )
-    words [
+    words [ name>> ] sort-with [
         "syn keyword factorKeyword " write
         [ bl ] [ pprint ] interleave nl
     ] when* ;
@@ -50,7 +50,7 @@ syn region factorGenericN matchgroup=factorGenericNDelims start=/\<GENERIC#\s\+\
 syn region factorPrivateDefn matchgroup=factorPrivateDefnDelims start=/\<\(SYNTAX\|\(MACRO\|MEMO\|TYPED\)\?:\?\):\s\+\S\+\>/ end=/\<;\>/ contains=@factorDefnContents contained
 syn region factorPrivateMethod matchgroup=factorPrivateMethodDelims start=/\<M::\?\s\+\S\+\s\+\S\+\>/ end=/\<;\>/ contains=@factorDefnContents contained
 syn region factorPGeneric matchgroup=factorPGenericDelims start=/\<\(GENERIC\|MATH\):\s\+\S\+\>/ end=/$/ contains=factorStackEffect contained
-syn region factorPGenericN matchgroup=factorPGenericNDelims start=/\<GENERIC#\s\+\S\+\s\+\d\+\>/ end=/$/ contains=factorStackEffect
+syn region factorPGenericN matchgroup=factorPGenericNDelims start=/\<GENERIC#\s\+\S\+\s\+\d\+\>/ end=/$/ contains=factorStackEffect contained
 
 syn region None matchgroup=factorPrivate start=/\<<PRIVATE\>/ end=/\<PRIVATE>\>/ contains=@factorDefnContents,factorPrivateDefn,factorPrivateMethod,factorPGeneric,factorPGenericN
 
index 010d62bfa5b2a2093de4c15c53a97ce24b2d9154..1ec922bbc53ae386cb3e2e7ec5f445e57f0bc306 100644 (file)
@@ -40,7 +40,7 @@ syn region factorGenericN matchgroup=factorGenericNDelims start=/\<GENERIC#\s\+\
 syn region factorPrivateDefn matchgroup=factorPrivateDefnDelims start=/\<\(SYNTAX\|\(MACRO\|MEMO\|TYPED\)\?:\?\):\s\+\S\+\>/ end=/\<;\>/ contains=@factorDefnContents contained
 syn region factorPrivateMethod matchgroup=factorPrivateMethodDelims start=/\<M::\?\s\+\S\+\s\+\S\+\>/ end=/\<;\>/ contains=@factorDefnContents contained
 syn region factorPGeneric matchgroup=factorPGenericDelims start=/\<\(GENERIC\|MATH\):\s\+\S\+\>/ end=/$/ contains=factorStackEffect contained
-syn region factorPGenericN matchgroup=factorPGenericNDelims start=/\<GENERIC#\s\+\S\+\s\+\d\+\>/ end=/$/ contains=factorStackEffect
+syn region factorPGenericN matchgroup=factorPGenericNDelims start=/\<GENERIC#\s\+\S\+\s\+\d\+\>/ end=/$/ contains=factorStackEffect contained
 
 syn region None matchgroup=factorPrivate start=/\<<PRIVATE\>/ end=/\<PRIVATE>\>/ contains=@factorDefnContents,factorPrivateDefn,factorPrivateMethod,factorPGeneric,factorPGenericN
 
@@ -53,17 +53,17 @@ syn match factorCallQuotation /\<call(\s\+\(\S*\s\+\)*--\(\s\+\S*\)*\s\+)\>/ con
 syn match factorExecute /\<execute(\s\+\(\S*\s\+\)*--\(\s\+\S*\)*\s\+)\>/ contained contains=factorStackEffect
 syn keyword factorCallNextMethod call-next-method
 
-syn keyword factorKeyword or 4drop 2bi 2tri while wrapper nip bi* wrapper? callstack>array 4dip die dupd both? callstack callstack? 3dup hashcode same? tri@ pick curry build ?execute 3bi prepose ?if clone >boolean eq? tri* ? = swapd 2over 2keep 3keep clear 2dup when not tuple? dup 2bi* 2tri* call 4keep tri-curry object bi@ do unless* if* loop bi-curry* drop when* assert= retainstack assert? -rot execute 2bi@ 2tri@ with boa either? 3drop bi curry? datastack until 3dip over 3curry tri-curry* tri-curry@ swap and 2nip throw bi-curry (clone) hashcode* compose 2dip if 3tri unless compose? tuple 2curry keep 4dup equal? assert tri 2drop most <wrapper> boolean? identity-hashcode identity-tuple? null new dip bi-curry@ rot identity-tuple xor boolean
-syn keyword factorKeyword ?at assoc? assoc-clone-like assoc= delete-at* assoc-partition extract-keys new-assoc value? assoc-size map>assoc push-at assoc-differ assoc-like key? assoc-intersect assoc-refine assoc-union! assoc-union assoc-combine at* assoc-filter! assoc-empty? at+ assoc-subset? set-at assoc-hashcode sift-values assoc-all? change-at assoc-each assoc-diff sift-keys zip values value-at rename-at inc-at enum? at cache assoc>map assoc-diff! <enum> assoc assoc-map enum value-at* assoc-map-as >alist assoc-filter-as clear-assoc assoc-stack maybe-set-at assoc-filter 2cache delete-at assoc-find substitute keys assoc-any? unzip
-syn keyword factorKeyword case execute-effect no-cond no-case? 3cleave>quot 2cleave cond>quot wrong-values? 4cleave no-cond? cleave>quot no-case shallow-spread>quot case>quot 3cleave wrong-values to-fixed-point alist>quot case-find cond cleave call-effect 2cleave>quot recursive-hashcode linear-case-quot spread deep-spread>quot 4cleave>quot
-syn keyword factorKeyword number= if-zero next-power-of-2 each-integer ?1+ fp-special? imaginary-part unless-zero float>bits number? fp-infinity? bignum? fp-snan? denominator fp-bitwise= * + power-of-2? - u>= / >= bitand log2-expects-positive neg? < log2 > out-of-fixnum-range integer? number bits>double 2/ zero? (find-integer) out-of-fixnum-range? bits>float float? shift ratio? even? ratio fp-sign bitnot >fixnum complex? /i integer>fixnum /f when-zero sgn >bignum next-float u< u> mod recip rational find-last-integer >float (all-integers?) 2^ times integer fixnum? neg fixnum sq bignum (each-integer) bit? fp-qnan? find-integer complex <fp-nan> real double>bits bitor rem fp-nan-payload all-integers? real-part log2-expects-positive? prev-float align unordered? float fp-nan? abs bitxor integer>fixnum-strict u<= odd? <= /mod >integer real? rational? numerator
-syn keyword factorKeyword member-eq? append assert-sequence= find-last-from selector-for clone-like 3sequence assert-sequence? map-as trim-head-slice last-index-from reversed index-from cut* pad-tail remove-eq! concat-as but-last snip trim-tail nths nth sequence slice? <slice> partition remove-nth tail-slice empty? tail* if-empty member? virtual-sequence? find-from set-length drop-prefix unclip-last-slice iota unclip bounds-error? map-sum accumulate-as map start midpoint@ ?first rest-slice prepend-as prepend fourth sift accumulate! new-sequence ?last follow map! like first4 1sequence reverse slice unless-empty collector padding virtual@ repetition? set-last index 4sequence max-length set-second immutable-sequence first2 first3 supremum reduce-index replicate-as unclip-slice suffix! insert-nth trim-tail-slice tail 3append short count suffix concat flip find-index filter immutable? reverse! sum 2sequence map-integers delete-all start* indices snip-slice check-slice sequence? head map-find filter! append-as halves selector sequence= collapse-slice interleave 2map reduce filter-as binary-reduce ?second slice-error? product bounds-check? bounds-check harvest immutable virtual-exemplar find produce remove pad-head last replicate set-fourth cartesian-product remove-eq shorten cartesian-map cartesian-each reversed? find-index-from map-find-last 3map-as shorter? 3map find-last head-slice pop* 2map-as tail-slice* but-last-slice 2map-reduce iota? accumulate each append! cut-slice new-resizable each-index head-slice* sequence-hashcode pop set-nth ?nth second join when-empty immutable-sequence? <reversed> all? 3append-as virtual-sequence subseq? remove-nth! push-either new-like length last-index collector-for 2selector push-if 2all? lengthen assert-sequence copy map-reduce move third first 3each tail? set-first prefix bounds-error any? <repetition> trim-slice exchange surround 2reduce cut change-nth min-length set-third produce-as push-all head? delete-slice rest sum-lengths 2each head* infimum remove! glue slice-error subseq trim replace-slice trim-head push map-index unclip-last mismatch repetition
-syn keyword factorKeyword global +@ set-namestack change-global with-variable on toggle set dec initialize namestack get get-global change init-namespaces with-scope off set-global namespace with-variables inc counter is-global make-assoc with-global
-syn keyword factorKeyword <array> 2array 3array pair >array 1array 4array pair? array resize-array array?
-syn keyword factorKeyword +character+ bad-seek-type? each-morsel readln stream-seek read print with-output-stream with-output>error each-stream-block-slice contents input-stream? stream-read-partial-unsafe write1 stream-write1 (stream-contents-by-length-or-block) stream-copy stream-element-type with-input-stream with-error-stream* stream-print stream-contents stream-read with-output+error-stream* stream-tell tell-output bl seek-output with-input-output+error-streams* bad-seek-type nl stream-nl stream-length write flush with-error>output +byte+ with-input-output+error-streams stream-read-into with-output+error-stream stream-flush read1 seek-absolute? stream-read1 read-into read-partial-into each-block-size lines stream-readln stream-read-until invalid-read-buffer seek-end each-block-slice with-output-stream* stream-lines stream-read-unsafe seek-absolute output-stream? each-line (stream-contents-by-element) stream-seekable? invalid-read-buffer? (stream-contents-by-block) with-streams seek-input seek-relative? stream-read-partial-into input-stream stream-write with-error-stream read-partial stream-copy* seek-end? seek-relative with-input-stream* error-stream read-until stream-contents* tell-input each-block with-streams* output-stream (stream-contents-by-length) stream-read-partial each-stream-block each-stream-line
-syn keyword factorKeyword resize-string >string <string> 1string string string?
-syn keyword factorKeyword vector? <vector> ?push vector >vector 1vector
-syn keyword factorKeyword with-return restarts return-continuation with-datastack recover in-callback? rethrow-restarts throw-continue <restart> ifcc original-error error-in-thread cleanup restart? ignore-errors compute-restarts attempt-all-error error-thread continue <continuation> attempt-all-error? condition? <condition> throw-restarts error restart thread-error-hook continue-with current-continuation continuation callcc1 rethrow error-continuation condition callcc0 callback-error-hook continuation? attempt-all return
+syn keyword factorKeyword (clone) -rot 2bi 2bi* 2bi@ 2curry 2dip 2drop 2dup 2keep 2nip 2over 2tri 2tri* 2tri@ 3bi 3curry 3dip 3drop 3dup 3keep 3tri 4dip 4drop 4dup 4keep <wrapper> = >boolean ? ?execute ?if and assert assert= assert? bi bi* bi-curry bi-curry* bi-curry@ bi@ boa boolean boolean? both? build call callstack callstack>array callstack? clear clone compose compose? curry curry? datastack die dip do drop dup dupd either? eq? equal? execute hashcode hashcode* identity-hashcode identity-tuple identity-tuple? if if* keep loop most new nip not null object or over pick prepose retainstack rot same? swap swapd throw tri tri* tri-curry tri-curry* tri-curry@ tri@ tuple tuple? unless unless* until when when* while with wrapper wrapper? xor
+syn keyword factorKeyword 2cache <enum> >alist ?at ?of assoc assoc-all? assoc-any? assoc-clone-like assoc-combine assoc-diff assoc-diff! assoc-differ assoc-each assoc-empty? assoc-filter assoc-filter! assoc-filter-as assoc-find assoc-hashcode assoc-intersect assoc-like assoc-map assoc-map-as assoc-partition assoc-refine assoc-size assoc-stack assoc-subset? assoc-union assoc-union! assoc= assoc>map assoc? at at* at+ cache change-at clear-assoc delete-at delete-at* enum enum? extract-keys inc-at key? keys map>assoc maybe-set-at new-assoc of push-at rename-at set-at sift-keys sift-values substitute unzip value-at value-at* value? values zip
+syn keyword factorKeyword 2cleave 2cleave>quot 3cleave 3cleave>quot 4cleave 4cleave>quot alist>quot call-effect case case-find case>quot cleave cleave>quot cond cond>quot deep-spread>quot execute-effect linear-case-quot no-case no-case? no-cond no-cond? recursive-hashcode shallow-spread>quot spread to-fixed-point wrong-values wrong-values?
+syn keyword factorKeyword (all-integers?) (each-integer) (find-integer) * + - / /f /i /mod 2/ 2^ < <= <fp-nan> > >= >bignum >fixnum >float >integer ?1+ abs align all-integers? bignum bignum? bit? bitand bitnot bitor bits>double bits>float bitxor complex complex? denominator double>bits each-integer even? find-integer find-last-integer fixnum fixnum? float float>bits float? fp-bitwise= fp-infinity? fp-nan-payload fp-nan? fp-qnan? fp-sign fp-snan? fp-special? if-zero imaginary-part integer integer>fixnum integer>fixnum-strict integer? log2 log2-expects-positive log2-expects-positive? mod neg neg? next-float next-power-of-2 number number= number? numerator odd? out-of-fixnum-range out-of-fixnum-range? power-of-2? prev-float ratio ratio? rational rational? real real-part real? recip rem sgn shift sq times u< u<= u> u>= unless-zero unordered? when-zero zero?
+syn keyword factorKeyword 1sequence 2all? 2each 2map 2map-as 2map-reduce 2reduce 2selector 2sequence 3append 3append-as 3each 3map 3map-as 3sequence 4sequence <repetition> <reversed> <slice> ?first ?last ?nth ?second ?set-nth accumulate accumulate! accumulate-as all? any? append append! append-as assert-sequence assert-sequence= assert-sequence? binary-reduce bounds-check bounds-check? bounds-error bounds-error? but-last but-last-slice cartesian-each cartesian-map cartesian-product change-nth check-slice check-slice-error clone-like collapse-slice collector collector-for concat concat-as copy count cut cut* cut-slice delete-all delete-slice drop-prefix each each-from each-index empty? exchange filter filter! filter-as find find-from find-index find-index-from find-last find-last-from first first2 first3 first4 flip follow fourth glue halves harvest head head* head-slice head-slice* head? if-empty immutable immutable-sequence immutable-sequence? immutable? index index-from indices infimum infimum-by insert-nth interleave iota iota-tuple iota-tuple? join join-as last last-index last-index-from length lengthen like longer longer? longest map map! map-as map-find map-find-last map-index map-integers map-reduce map-sum max-length member-eq? member? midpoint@ min-length mismatch move new-like new-resizable new-sequence non-negative-integer-expected non-negative-integer-expected? nth nths pad-head pad-tail padding partition pop pop* prefix prepend prepend-as produce produce-as product push push-all push-either push-if reduce reduce-index remove remove! remove-eq remove-eq! remove-nth remove-nth! repetition repetition? replace-slice replicate replicate-as rest rest-slice reverse reverse! reversed reversed? second selector selector-for sequence sequence-hashcode sequence= sequence? set-first set-fourth set-last set-length set-nth set-second set-third short shorten shorter shorter? shortest sift slice slice-error slice-error? slice? snip snip-slice start start* subseq subseq? suffix suffix! sum sum-lengths supremum supremum-by surround tail tail* tail-slice tail-slice* tail? third trim trim-head trim-head-slice trim-slice trim-tail trim-tail-slice unclip unclip-last unclip-last-slice unclip-slice unless-empty virtual-exemplar virtual-sequence virtual-sequence? virtual@ when-empty
+syn keyword factorKeyword +@ change change-global counter dec get get-global global inc init-namespaces initialize is-global namespace namestack off on set set-global set-namestack toggle with-global with-scope with-variable with-variables
+syn keyword factorKeyword 1array 2array 3array 4array <array> >array array array? pair pair? resize-array
+syn keyword factorKeyword (each-stream-block) (each-stream-block-slice) (stream-contents-by-block) (stream-contents-by-element) (stream-contents-by-length) (stream-contents-by-length-or-block) +byte+ +character+ bad-seek-type bad-seek-type? bl contents each-block each-block-size each-block-slice each-line each-morsel each-stream-block each-stream-block-slice each-stream-line error-stream flush input-stream input-stream? invalid-read-buffer invalid-read-buffer? lines nl output-stream output-stream? print read read-into read-partial read-partial-into read-until read1 readln seek-absolute seek-absolute? seek-end seek-end? seek-input seek-output seek-relative seek-relative? stream-bl stream-contents stream-contents* stream-copy stream-copy* stream-element-type stream-flush stream-length stream-lines stream-nl stream-print stream-read stream-read-into stream-read-partial stream-read-partial-into stream-read-partial-unsafe stream-read-unsafe stream-read-until stream-read1 stream-readln stream-seek stream-seekable? stream-tell stream-write stream-write1 tell-input tell-output with-error-stream with-error-stream* with-error>output with-input-output+error-streams with-input-output+error-streams* with-input-stream with-input-stream* with-output+error-stream with-output+error-stream* with-output-stream with-output-stream* with-output>error with-streams with-streams* write write1
+syn keyword factorKeyword 1string <string> >string resize-string string string?
+syn keyword factorKeyword 1vector <vector> >vector ?push vector vector?
+syn keyword factorKeyword <condition> <continuation> <restart> attempt-all attempt-all-error attempt-all-error? callback-error-hook callcc0 callcc1 cleanup compute-restarts condition condition? continuation continuation? continue continue-restart continue-with current-continuation error error-continuation error-in-thread error-thread ifcc ignore-errors in-callback? original-error recover restart restart? restarts rethrow rethrow-restarts return return-continuation thread-error-hook throw-continue throw-restarts with-datastack with-return
 
 
 syn cluster factorReal          contains=factorInt,factorFloat,factorPosRatio,factorNegRatio,factorBinary,factorHex,factorOctal