diff --git a/basis/compiler/tests/redefine4.factor b/basis/compiler/tests/redefine4.factor new file mode 100644 index 0000000000..2c667eaceb --- /dev/null +++ b/basis/compiler/tests/redefine4.factor @@ -0,0 +1,12 @@ +IN: compiler.tests +USING: io.streams.string kernel tools.test eval ; + +: declaration-test-1 ( -- a ) 3 ; flushable + +: declaration-test ( -- ) declaration-test-1 drop ; + +[ "" ] [ [ declaration-test ] with-string-writer ] unit-test + +[ ] [ "IN: compiler.tests USE: io : declaration-test-1 ( -- a ) \"X\" print f ;" eval ] unit-test + +[ "X" ] [ [ declaration-test ] with-string-writer ] unit-test diff --git a/basis/compiler/tree/propagation/propagation-tests.factor b/basis/compiler/tree/propagation/propagation-tests.factor index 149a9e1a88..da68503c1e 100644 --- a/basis/compiler/tree/propagation/propagation-tests.factor +++ b/basis/compiler/tree/propagation/propagation-tests.factor @@ -565,6 +565,12 @@ M: integer infinite-loop infinite-loop ; [ ] [ [ too-deep ] final-info drop ] unit-test +[ ] [ [ reversed boa slice boa nth-unsafe * ] final-info drop ] unit-test + +MIXIN: empty-mixin + +[ ] [ [ { empty-mixin } declare empty-mixin? ] final-info drop ] unit-test + ! [ V{ string } ] [ ! [ dup string? t xor [ "A" throw ] [ ] if ] final-classes ! ] unit-test diff --git a/basis/float-arrays/float-arrays.factor b/basis/float-arrays/float-arrays.factor index ea41dc5436..61ebe744f8 100755 --- a/basis/float-arrays/float-arrays.factor +++ b/basis/float-arrays/float-arrays.factor @@ -68,9 +68,10 @@ M: float-array >pprint-sequence ; USING: hints math.vectors arrays ; HINTS: vneg { float-array } { array } ; -HINTS: v*n { float-array object } { array object } ; -HINTS: v/n { float-array object } { array object } ; -HINTS: n/v { object float-array } { object array } ; +HINTS: v*n { float-array float } { array object } ; +HINTS: n*v { float float-array } { array object } ; +HINTS: v/n { float-array float } { array object } ; +HINTS: n/v { float float-array } { object array } ; HINTS: v+ { float-array float-array } { array array } ; HINTS: v- { float-array float-array } { array array } ; HINTS: v* { float-array float-array } { array array } ; diff --git a/basis/io/windows/files/files.factor b/basis/io/windows/files/files.factor index e25be71872..1377f82ced 100755 --- a/basis/io/windows/files/files.factor +++ b/basis/io/windows/files/files.factor @@ -123,7 +123,7 @@ SYMBOLS: +read-only+ +hidden+ +system+ +not-content-indexed+ +encrypted+ ; : win32-file-attribute ( n attr symbol -- n ) - >r dupd mask? [ r> , ] [ r> drop ] if ; + >r dupd mask? r> swap [ , ] [ drop ] if ; : win32-file-attributes ( n -- seq ) [ diff --git a/basis/io/windows/launcher/launcher.factor b/basis/io/windows/launcher/launcher.factor index 1cfb91d716..9442fa9a72 100755 --- a/basis/io/windows/launcher/launcher.factor +++ b/basis/io/windows/launcher/launcher.factor @@ -33,11 +33,9 @@ TUPLE: CreateProcess-args CreateProcess-args >tuple< CreateProcess win32-error=0/f ; : count-trailing-backslashes ( str n -- str n ) - >r "\\" ?tail [ - r> 1+ count-trailing-backslashes - ] [ - r> - ] if ; + >r "\\" ?tail r> swap [ + 1+ count-trailing-backslashes + ] when ; : fix-trailing-backslashes ( str -- str' ) 0 count-trailing-backslashes diff --git a/basis/ui/gadgets/canvas/canvas.factor b/basis/ui/gadgets/canvas/canvas.factor index cfc7c4cfd6..ba5aeaf95b 100644 --- a/basis/ui/gadgets/canvas/canvas.factor +++ b/basis/ui/gadgets/canvas/canvas.factor @@ -7,9 +7,8 @@ IN: ui.gadgets.canvas TUPLE: canvas < gadget dlist ; -: ( -- canvas ) - canvas new-gadget - black solid-interior ; +: new-canvas ( class -- canvas ) + new-gadget black solid-interior ; inline : delete-canvas-dlist ( canvas -- ) dup find-gl-context diff --git a/basis/ui/gadgets/handler/handler.factor b/basis/ui/gadgets/handler/handler.factor index bff03c7d9f..1ad5063013 100644 --- a/basis/ui/gadgets/handler/handler.factor +++ b/basis/ui/gadgets/handler/handler.factor @@ -7,5 +7,5 @@ TUPLE: handler < wrapper table ; : ( child -- handler ) handler new-wrapper ; -M: handler handle-gesture* ( gadget gesture delegate -- ? ) - table>> at dup [ call f ] [ 2drop t ] if ; \ No newline at end of file +M: handler handle-gesture ( gesture gadget -- ? ) + over table>> at dup [ call f ] [ 2drop t ] if ; \ No newline at end of file diff --git a/basis/units/units.factor b/basis/units/units.factor index 251a4e9b47..fb93691f0a 100755 --- a/basis/units/units.factor +++ b/basis/units/units.factor @@ -33,7 +33,7 @@ M: dimensions-not-equal summary drop "Dimensions do not match" ; \ [ >dimensioned< ] define-inverse : dimensions ( dimensioned -- top bot ) - { dimensioned-top dimensioned-bot } get-slots ; + [ top>> ] [ bot>> ] bi ; : check-dimensions ( d d -- ) [ dimensions 2array ] bi@ = diff --git a/extra/benchmark/raytracer/raytracer.factor b/extra/benchmark/raytracer/raytracer.factor index 7d7ec244fb..d22f339ed4 100755 --- a/extra/benchmark/raytracer/raytracer.factor +++ b/extra/benchmark/raytracer/raytracer.factor @@ -1,9 +1,9 @@ ! Factor port of the raytracer benchmark from ! http://www.ffconsultancy.com/free/ray_tracer/languages.html -USING: float-arrays compiler generic io io.files kernel math -math.functions math.vectors math.parser namespaces sequences -sequences.private words io.encodings.binary ; +USING: arrays accessors float-arrays io io.files +io.encodings.binary kernel math math.functions math.vectors +math.parser namespaces sequences sequences.private words ; IN: benchmark.raytracer ! parameters @@ -23,32 +23,33 @@ IN: benchmark.raytracer : delta 1.4901161193847656E-8 ; inline -TUPLE: ray orig dir ; +TUPLE: ray { orig float-array read-only } { dir float-array read-only } ; C: ray -TUPLE: hit normal lambda ; +TUPLE: hit { normal float-array read-only } { lambda float read-only } ; C: hit GENERIC: intersect-scene ( hit ray scene -- hit ) -TUPLE: sphere center radius ; +TUPLE: sphere { center float-array read-only } { radius float read-only } ; C: sphere : sphere-v ( sphere ray -- v ) - swap sphere-center swap ray-orig v- ; inline + swap center>> swap orig>> v- ; inline -: sphere-b ( ray v -- b ) swap ray-dir v. ; inline +: sphere-b ( ray v -- b ) swap dir>> v. ; inline : sphere-disc ( sphere v b -- d ) - sq swap norm-sq - swap sphere-radius sq + ; inline + sq swap norm-sq - swap radius>> sq + ; inline : -+ ( x y -- x-y x+y ) [ - ] 2keep + ; inline : sphere-b/d ( b d -- t ) - -+ dup 0.0 < [ 2drop 1.0/0.0 ] [ >r [ 0.0 > ] keep r> ? ] if ; inline + -+ dup 0.0 < + [ 2drop 1.0/0.0 ] [ [ [ 0.0 > ] keep ] dip ? ] if ; inline : ray-sphere ( sphere ray -- t ) 2dup sphere-v tuck sphere-b [ sphere-disc ] keep @@ -56,29 +57,31 @@ C: sphere inline : sphere-n ( ray sphere l -- n ) - pick ray-dir n*v swap sphere-center v- swap ray-orig v+ ; + pick dir>> n*v swap center>> v- swap orig>> v+ ; inline : if-ray-sphere ( hit ray sphere quot -- hit ) #! quot: hit ray sphere l -- hit - >r pick hit-lambda >r 2dup swap ray-sphere dup r> >= - [ 3drop ] r> if ; inline + [ + pick lambda>> [ 2dup swap ray-sphere dup ] dip >= + [ 3drop ] + ] dip if ; inline M: sphere intersect-scene ( hit ray sphere -- hit ) [ [ sphere-n normalize ] keep nip ] if-ray-sphere ; -TUPLE: group objs ; +TUPLE: group < sphere { objs array read-only } ; : ( objs bound -- group ) - { set-group-objs set-delegate } group construct ; + [ center>> ] [ radius>> ] bi rot group boa ; inline : make-group ( bound quot -- ) - swap >r { } make r> ; inline + swap [ { } make ] dip ; inline M: group intersect-scene ( hit ray group -- hit ) [ drop - group-objs [ >r tuck r> intersect-scene swap ] each + objs>> [ [ tuck ] dip intersect-scene swap ] each drop ] if-ray-sphere ; @@ -88,30 +91,30 @@ M: group intersect-scene ( hit ray group -- hit ) initial-hit -rot intersect-scene ; inline : ray-o ( ray hit -- o ) - over ray-dir over hit-lambda v*n - swap hit-normal delta v*n v+ - swap ray-orig v+ ; inline + over dir>> over lambda>> v*n + swap normal>> delta v*n v+ + swap orig>> v+ ; inline : sray-intersect ( ray scene hit -- ray ) - swap >r ray-o light vneg r> initial-intersect ; inline + swap [ ray-o light vneg ] dip initial-intersect ; inline -: ray-g ( hit -- g ) hit-normal light v. ; inline +: ray-g ( hit -- g ) normal>> light v. ; inline : cast-ray ( ray scene -- g ) - 2dup initial-intersect dup hit-lambda 1.0/0.0 = [ + 2dup initial-intersect dup lambda>> 1.0/0.0 = [ 3drop 0.0 ] [ - dup ray-g >r sray-intersect hit-lambda 1.0/0.0 = - [ r> neg ] [ r> drop 0.0 ] if + [ sray-intersect lambda>> 1.0/0.0 = ] keep swap + [ ray-g neg ] [ drop 0.0 ] if ] if ; inline : create-center ( c r d -- c2 ) - >r 3.0 12.0 sqrt / * r> n*v v+ ; inline + [ 3.0 12.0 sqrt / * ] dip n*v v+ ; inline DEFER: create ( level c r -- scene ) : create-step ( level c r d -- scene ) - over >r create-center r> 2.0 / >r >r 1 - r> r> create ; + over [ create-center ] dip 2.0 / [ 1 - ] 2dip create ; : create-offsets ( quot -- ) { @@ -126,7 +129,7 @@ DEFER: create ( level c r -- scene ) : create-group ( level c r -- scene ) 2dup create-bound [ 2dup , - [ >r 3dup r> create-step , ] create-offsets 3drop + [ [ 3dup ] dip create-step , ] create-offsets 3drop ] make-group ; : create ( level c r -- scene ) @@ -140,7 +143,7 @@ DEFER: create ( level c r -- scene ) : ray-grid ( point ss-grid -- ray-grid ) [ - [ v+ normalize { 0.0 0.0 -4.0 } swap ] with map + [ v+ normalize F{ 0.0 0.0 -4.0 } swap ] with map ] with map ; : ray-pixel ( scene point -- n ) @@ -164,7 +167,7 @@ DEFER: create ( level c r -- scene ) pixel-grid [ [ ray-pixel ] with map ] with map ; : run ( -- string ) - levels { 0.0 -1.0 0.0 } 1.0 create ray-trace [ + levels F{ 0.0 -1.0 0.0 } 1.0 create ray-trace [ size size pgm-header [ [ oversampling sq / pgm-pixel ] each ] each ] B{ } make ; diff --git a/extra/classes/tuple/lib/lib.factor b/extra/classes/tuple/lib/lib.factor index fbc3afe76c..509843b9cd 100755 --- a/extra/classes/tuple/lib/lib.factor +++ b/extra/classes/tuple/lib/lib.factor @@ -1,10 +1,11 @@ ! Copyright (C) 2007 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel macros sequences slots words classes.tuple ; +USING: kernel macros sequences slots words classes.tuple +quotations combinators ; IN: classes.tuple.lib : reader-slots ( seq -- quot ) - [ slot-spec-reader ] map [ get-slots ] curry ; + [ slot-spec-reader 1quotation ] map [ cleave ] curry ; MACRO: >tuple< ( class -- ) all-slots rest-slice reader-slots ; diff --git a/extra/generic/lib/lib.factor b/extra/generic/lib/lib.factor deleted file mode 100644 index 975a47e93c..0000000000 --- a/extra/generic/lib/lib.factor +++ /dev/null @@ -1,6 +0,0 @@ - -USING: kernel generic sequences ; - -IN: generic.lib - -: chain ( seq -- object ) unclip swap [ tuck set-delegate ] each ; \ No newline at end of file diff --git a/extra/gesture-logger/gesture-logger.factor b/extra/gesture-logger/gesture-logger.factor index 7b1fac8fcd..b990de03fc 100644 --- a/extra/gesture-logger/gesture-logger.factor +++ b/extra/gesture-logger/gesture-logger.factor @@ -13,7 +13,7 @@ TUPLE: gesture-logger < gadget stream ; { 100 100 } >>dim black solid-interior ; -M: gesture-logger handle-gesture* +M: gesture-logger handle-gesture over T{ button-down } = [ dup request-focus ] when stream>> [ . ] with-output-stream* t ; diff --git a/extra/inverse/inverse.factor b/extra/inverse/inverse.factor index 5c77568106..edcf0c7d26 100755 --- a/extra/inverse/inverse.factor +++ b/extra/inverse/inverse.factor @@ -226,17 +226,6 @@ DEFER: _ \ new 1 [ ?wrapped empty-inverse ] define-pop-inverse -: writer>reader ( word -- word' ) - [ "writing" word-prop "slots" word-prop ] keep - [ swap slot-spec-writer = ] curry find nip slot-spec-reader ; - -: construct-inverse ( class setters -- quot ) - >r deconstruct-pred r> - [ writer>reader ] map [ get-slots ] curry - compose ; - -\ construct 2 [ >r ?wrapped r> construct-inverse ] define-pop-inverse - ! More useful inverse-based combinators : recover-fail ( try fail -- ) diff --git a/extra/key-caps/key-caps.factor b/extra/key-caps/key-caps.factor index 15ef21d64e..e14a46a967 100755 --- a/extra/key-caps/key-caps.factor +++ b/extra/key-caps/key-caps.factor @@ -168,7 +168,7 @@ M: key-caps-gadget graft* M: key-caps-gadget ungraft* alarm>> [ cancel-alarm ] when* ; -M: key-caps-gadget handle-gesture* +M: key-caps-gadget handle-gesture drop [ key-down? ] [ key-up? ] bi or not ; : key-caps ( -- ) diff --git a/extra/lcd/lcd.factor b/extra/lcd/lcd.factor index b0d5060b4a..d1646a4089 100755 --- a/extra/lcd/lcd.factor +++ b/extra/lcd/lcd.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: sequences kernel math io calendar calendar.format -calendar.model arrays models models.filter namespaces ui.gadgets -ui.gadgets.labels ui.gadgets.theme ui ; +USING: accessors sequences kernel math io calendar grouping +calendar.format calendar.model arrays models models.filter +namespaces ui.gadgets ui.gadgets.labels ui.gadgets.theme ui ; IN: lcd : lcd-digit ( row digit -- str ) @@ -11,7 +11,7 @@ IN: lcd " | | | _| _| |_| |_ |_ | |_| |_| * " " |_| | |_ _| | _| |_| | |_| | * " " " - } nth >r 4 * dup 4 + r> subseq ; + } nth 4 nth ; : lcd-row ( num row -- string ) [ swap lcd-digit ] curry { } map-as concat ; @@ -20,9 +20,8 @@ IN: lcd 4 [ lcd-row ] with map "\n" join ; : hh:mm:ss ( timestamp -- string ) - { - timestamp-hour timestamp-minute timestamp-second - } get-slots >fixnum 3array [ pad-00 ] map ":" join ; + [ hour>> ] [ minute>> ] [ second>> >fixnum ] tri + 3array [ pad-00 ] map ":" join ; : ( timestamp -- gadget ) [ hh:mm:ss lcd ] diff --git a/extra/math/blas/matrices/matrices.factor b/extra/math/blas/matrices/matrices.factor index c07dfca76d..c8e55c4ec0 100755 --- a/extra/math/blas/matrices/matrices.factor +++ b/extra/math/blas/matrices/matrices.factor @@ -194,9 +194,9 @@ METHOD: n*M.M+n*M-in-place { number double-complex-blas-matrix double-complex-bl syntax:M: blas-matrix-base clone [ [ - { data>> ld>> cols>> element-type } get-slots - heap-size * * memory>byte-array - ] [ { ld>> rows>> cols>> transpose>> } get-slots ] bi + { [ data>> ] [ ld>> ] [ cols>> ] [ element-type heap-size ] } cleave + * * memory>byte-array + ] [ { [ ld>> ] [ rows>> ] [ cols>> ] [ transpose>> ] } cleave ] bi ] keep (blas-matrix-like) ; ! XXX try rounding stride to next 128 bit bound for better vectorizin' @@ -296,7 +296,7 @@ syntax:M: blas-matrix-rowcol-sequence nth-unsafe recip swap n*M ; inline : Mtranspose ( matrix -- matrix^T ) - [ { data>> ld>> rows>> cols>> transpose>> } get-slots not ] keep (blas-matrix-like) ; + [ { [ data>> ] [ ld>> ] [ rows>> ] [ cols>> ] [ transpose>> not ] } cleave ] keep (blas-matrix-like) ; syntax:M: blas-matrix-base equal? { diff --git a/extra/maze/maze.factor b/extra/maze/maze.factor index 389dabc0f6..07f7b74265 100644 --- a/extra/maze/maze.factor +++ b/extra/maze/maze.factor @@ -49,10 +49,9 @@ SYMBOL: visited { 0 0 } dup vertex (draw-maze) glEnd ; -TUPLE: maze ; +TUPLE: maze < canvas ; -: ( -- gadget ) - { set-delegate } maze construct ; +: ( -- gadget ) maze new-canvas ; : n ( gadget -- n ) rect-dim first2 min line-width /i ; diff --git a/extra/processing/gadget/gadget.factor b/extra/processing/gadget/gadget.factor index 4621bab855..c1a4c77703 100644 --- a/extra/processing/gadget/gadget.factor +++ b/extra/processing/gadget/gadget.factor @@ -26,8 +26,8 @@ SYMBOL: key-value ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -M: processing-gadget handle-gesture* ( gadget gesture delegate -- ? ) - rot drop swap ! delegate gesture +M: processing-gadget handle-gesture ( gesture gadget -- ? ) + swap { { [ dup key-down? ] diff --git a/extra/reports/noise/noise.factor b/extra/reports/noise/noise.factor index ff88abad61..4a36121046 100755 --- a/extra/reports/noise/noise.factor +++ b/extra/reports/noise/noise.factor @@ -1,3 +1,5 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. USING: accessors assocs math kernel shuffle generalizations words quotations arrays combinators sequences math.vectors io.styles prettyprint vocabs sorting io generic locals.private @@ -92,11 +94,11 @@ M: word noise badness 1 2array ; M: wrapper noise wrapped>> noise ; -M: let noise let-body noise ; +M: let noise body>> noise ; -M: wlet noise wlet-body noise ; +M: wlet noise body>> noise ; -M: lambda noise lambda-body noise ; +M: lambda noise body>> noise ; M: object noise drop { 0 0 } ; diff --git a/extra/reports/optimizer/optimizer.factor b/extra/reports/optimizer/optimizer.factor deleted file mode 100755 index b51fa5c8ee..0000000000 --- a/extra/reports/optimizer/optimizer.factor +++ /dev/null @@ -1,44 +0,0 @@ -! Copyright (C) 2008 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors assocs words sequences arrays compiler -tools.time io.styles io prettyprint vocabs kernel sorting -generator optimizer math math.order math.statistics combinators -optimizer.debugger ; -IN: report.optimizer - -: table. ( alist -- ) - 20 short tail* - standard-table-style - [ - [ [ [ pprint-cell ] each ] with-row ] each - ] tabular-output ; - -: results ( results quot title -- ) - print - [ second ] prepose - [ [ compare ] curry sort table. ] - [ - map - [ "Mean: " write mean >float . ] - [ "Median: " write median >float . ] - [ "Standard deviation: " write std >float . ] - tri - ] 2bi ; inline - -: optimization-passes ( word -- n ) - word-dataflow nip 1 count-optimization-passes nip ; - -: optimizer-measurements ( -- alist ) - all-words [ compiled>> ] filter - [ dup [ optimization-passes ] benchmark 2array ] { } map>assoc ; - -: optimizer-measurements. ( alist -- ) - { - [ [ first ] "Optimizer passes:" results ] - [ [ second ] "Compile times:" results ] - } cleave ; - -: optimizer-report ( -- ) - optimizer-measurements optimizer-measurements. ; - -MAIN: optimizer-report diff --git a/extra/turtle/authors.txt b/extra/turtle/authors.txt deleted file mode 100644 index 6cfd5da273..0000000000 --- a/extra/turtle/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Eduardo Cavazos diff --git a/unfinished/regexp2/parser/parser.factor b/unfinished/regexp2/parser/parser.factor index 6eda3310d0..39ca01e319 100644 --- a/unfinished/regexp2/parser/parser.factor +++ b/unfinished/regexp2/parser/parser.factor @@ -13,7 +13,15 @@ MIXIN: node TUPLE: concatenation seq ; INSTANCE: concatenation node TUPLE: alternation seq ; INSTANCE: alternation node TUPLE: kleene-star term ; INSTANCE: kleene-star node -TUPLE: question term ; INSTANCE: question node + +! !!!!!!!! +TUPLE: possessive-question term ; INSTANCE: possessive-question node +TUPLE: possessive-kleene-star term ; INSTANCE: possessive-kleene-star node + +! !!!!!!!! +TUPLE: reluctant-question term ; INSTANCE: reluctant-question node +TUPLE: reluctant-kleene-star term ; INSTANCE: reluctant-kleene-star node + TUPLE: negation term ; INSTANCE: negation node TUPLE: constant char ; INSTANCE: constant node TUPLE: range from to ; INSTANCE: range node @@ -21,7 +29,7 @@ TUPLE: lookahead term ; INSTANCE: lookahead node TUPLE: lookbehind term ; INSTANCE: lookbehind node TUPLE: capture-group term ; INSTANCE: capture-group node TUPLE: non-capture-group term ; INSTANCE: non-capture-group node -TUPLE: independent-group term ; INSTANCE: independent-group node +TUPLE: independent-group term ; INSTANCE: independent-group node ! atomic group TUPLE: character-class-range from to ; INSTANCE: character-class-range node SINGLETON: epsilon INSTANCE: epsilon node SINGLETON: any-char INSTANCE: any-char node @@ -51,6 +59,11 @@ left-parenthesis pipe caret dash ; : get-unicode-case ( -- ? ) unicode-case get-option ; : get-reversed-regexp ( -- ? ) reversed-regexp get-option ; +: ( obj -- kleene ) possessive-kleene-star boa ; +: ( obj -- kleene ) reluctant-kleene-star boa ; +: ( obj -- kleene ) possessive-question boa ; +: ( obj -- kleene ) reluctant-question boa ; + : ( obj -- negation ) negation boa ; : ( seq -- concatenation ) >vector get-reversed-regexp [ reverse ] when @@ -101,7 +114,6 @@ ERROR: unmatched-parentheses ; : make-negative-lookbehind ( string -- ) lookbehind boa push-stack ; -DEFER: nested-parse-regexp : make-non-capturing-group ( string -- ) non-capture-group boa push-stack ; @@ -112,6 +124,7 @@ ERROR: bad-option ch ; { CHAR: i [ case-insensitive ] } { CHAR: d [ unix-lines ] } { CHAR: m [ multiline ] } + { CHAR: n [ multiline ] } { CHAR: r [ reversed-regexp ] } { CHAR: s [ dotall ] } { CHAR: u [ unicode-case ] } @@ -135,6 +148,7 @@ DEFER: (parse-regexp) ERROR: bad-special-group string ; +DEFER: nested-parse-regexp : (parse-special-group) ( -- ) read1 { { [ dup CHAR: : = ] @@ -146,9 +160,9 @@ ERROR: bad-special-group string ; { [ dup CHAR: > = ] [ drop nested-parse-regexp pop-stack make-independent-group ] } { [ dup CHAR: < = peek1 CHAR: = = and ] - [ drop read1 drop nested-parse-regexp pop-stack make-positive-lookbehind ] } + [ drop drop1 nested-parse-regexp pop-stack make-positive-lookbehind ] } { [ dup CHAR: < = peek1 CHAR: ! = and ] - [ drop read1 drop nested-parse-regexp pop-stack make-negative-lookbehind ] } + [ drop drop1 nested-parse-regexp pop-stack make-negative-lookbehind ] } [ ":)" read-until [ swap prefix ] dip @@ -162,16 +176,27 @@ ERROR: bad-special-group string ; : handle-left-parenthesis ( -- ) peek1 CHAR: ? = - [ read1 drop (parse-special-group) ] + [ drop1 (parse-special-group) ] [ nested-parse-regexp ] if ; : handle-dot ( -- ) any-char push-stack ; : handle-pipe ( -- ) pipe push-stack ; -: handle-star ( -- ) stack pop push-stack ; +: (handle-star) ( obj -- kleene-star ) + peek1 { + { CHAR: + [ drop1 ] } + { CHAR: ? [ drop1 ] } + [ drop ] + } case ; +: handle-star ( -- ) stack pop (handle-star) push-stack ; : handle-question ( -- ) - stack pop epsilon 2array push-stack ; + stack pop peek1 { + { CHAR: + [ drop1 ] } + { CHAR: ? [ drop1 ] } + [ drop epsilon 2array ] + } case push-stack ; : handle-plus ( -- ) - stack pop dup 2array push-stack ; + stack pop dup (handle-star) + 2array push-stack ; ERROR: unmatched-brace ; : parse-repetition ( -- start finish ? ) @@ -247,7 +272,7 @@ ERROR: expected-posix-class ; ERROR: bad-escaped-literals seq ; : parse-escaped-literals ( -- obj ) "\\E" read-until [ bad-escaped-literals ] unless - read1 drop + drop1 [ epsilon ] [ [ ] V{ } map-as first|concatenation diff --git a/unfinished/regexp2/regexp2-tests.factor b/unfinished/regexp2/regexp2-tests.factor index 54626ea165..2bb194f012 100644 --- a/unfinished/regexp2/regexp2-tests.factor +++ b/unfinished/regexp2/regexp2-tests.factor @@ -180,58 +180,18 @@ IN: regexp2-tests [ t ] [ "aaaab" "a+ab" matches? ] unit-test [ f ] [ "aaaxb" "a+ab" matches? ] unit-test [ t ] [ "aaacb" "a+cb" matches? ] unit-test -[ f ] [ "aaaab" "a++ab" matches? ] unit-test -[ t ] [ "aaacb" "a++cb" matches? ] unit-test [ 3 ] [ "aaacb" "a*" match-head ] unit-test -[ 1 ] [ "aaacb" "a+?" match-head ] unit-test [ 2 ] [ "aaacb" "aa?" match-head ] unit-test -[ 1 ] [ "aaacb" "aa??" match-head ] unit-test -[ 3 ] [ "aacb" "aa?c" match-head ] unit-test -[ 3 ] [ "aacb" "aa??c" match-head ] unit-test -! [ t ] [ "aaa" "AAA" t matches? ] unit-test -! [ f ] [ "aax" "AAA" t matches? ] unit-test -! [ t ] [ "aaa" "A*" t matches? ] unit-test -! [ f ] [ "aaba" "A*" t matches? ] unit-test -! [ t ] [ "b" "[AB]" t matches? ] unit-test -! [ f ] [ "c" "[AB]" t matches? ] unit-test -! [ t ] [ "c" "[A-Z]" t matches? ] unit-test -! [ f ] [ "3" "[A-Z]" t matches? ] unit-test - -[ ] [ - "(0[lL]?|[1-9]\\d{0,9}(\\d{0,9}[lL])?|0[xX]\\p{XDigit}{1,8}(\\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))" - drop -] unit-test - -[ "{Lower}" ] [ invalid-range? ] must-fail-with - -[ t ] [ "fxxbar" "(?!foo).{3}bar" matches? ] unit-test -[ f ] [ "foobar" "(?!foo).{3}bar" matches? ] unit-test - -! [ 3 ] [ "foobar" "foo(?=bar)" match-head ] unit-test -! [ f ] [ "foobxr" "foo(?=bar)" match-head ] unit-test - -! [ f ] [ "foobxr" "foo\\z" match-head ] unit-test -! [ 3 ] [ "foo" "foo\\z" match-head ] unit-test - -! [ 3 ] [ "foo bar" "foo\\b" match-head ] unit-test -! [ f ] [ "fooxbar" "foo\\b" matches? ] unit-test -! [ t ] [ "foo" "foo\\b" matches? ] unit-test -! [ t ] [ "foo bar" "foo\\b bar" matches? ] unit-test -! [ f ] [ "fooxbar" "foo\\bxbar" matches? ] unit-test -! [ f ] [ "foo" "foo\\bbar" matches? ] unit-test - -! [ f ] [ "foo bar" "foo\\B" matches? ] unit-test -! [ 3 ] [ "fooxbar" "foo\\B" match-head ] unit-test -! [ t ] [ "foo" "foo\\B" matches? ] unit-test -! [ f ] [ "foo bar" "foo\\B bar" matches? ] unit-test -! [ t ] [ "fooxbar" "foo\\Bxbar" matches? ] unit-test -! [ f ] [ "foo" "foo\\Bbar" matches? ] unit-test - -[ t ] [ "s@f" "[a-z.-]@[a-z]" matches? ] unit-test -[ f ] [ "a" "[a-z.-]@[a-z]" matches? ] unit-test -[ t ] [ ".o" "\\.[a-z]" matches? ] unit-test +[ t ] [ "aaa" "AAA" matches? ] unit-test +[ f ] [ "aax" "AAA" matches? ] unit-test +[ t ] [ "aaa" "A*" matches? ] unit-test +[ f ] [ "aaba" "A*" matches? ] unit-test +[ t ] [ "b" "[AB]" matches? ] unit-test +[ f ] [ "c" "[AB]" matches? ] unit-test +[ t ] [ "c" "[A-Z]" matches? ] unit-test +[ f ] [ "3" "[A-Z]" matches? ] unit-test [ t ] [ "a" "(?i)a" matches? ] unit-test [ t ] [ "a" "(?i)a" matches? ] unit-test @@ -253,6 +213,50 @@ IN: regexp2-tests [ t ] [ "abc" "a[bB][cC]" matches? ] unit-test [ t ] [ "adcbe" "a(?r)(bcd)(?-r)e" matches? ] unit-test +[ t ] [ "s@f" "[a-z.-]@[a-z]" matches? ] unit-test +[ f ] [ "a" "[a-z.-]@[a-z]" matches? ] unit-test +[ t ] [ ".o" "\\.[a-z]" matches? ] unit-test + +[ ] [ + "(0[lL]?|[1-9]\\d{0,9}(\\d{0,9}[lL])?|0[xX]\\p{XDigit}{1,8}(\\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))" + drop +] unit-test + + + + +[ "{Lower}" ] [ invalid-range? ] must-fail-with + +[ 1 ] [ "aaacb" "a+?" match-head ] unit-test +[ 1 ] [ "aaacb" "aa??" match-head ] unit-test +[ f ] [ "aaaab" "a++ab" matches? ] unit-test +[ t ] [ "aaacb" "a++cb" matches? ] unit-test +[ 3 ] [ "aacb" "aa?c" match-head ] unit-test +[ 3 ] [ "aacb" "aa??c" match-head ] unit-test + +[ t ] [ "fxxbar" "(?!foo).{3}bar" matches? ] unit-test +[ f ] [ "foobar" "(?!foo).{3}bar" matches? ] unit-test + +[ 3 ] [ "foobar" "foo(?=bar)" match-head ] unit-test +[ f ] [ "foobxr" "foo(?=bar)" match-head ] unit-test + +! [ f ] [ "foobxr" "foo\\z" match-head ] unit-test +! [ 3 ] [ "foo" "foo\\z" match-head ] unit-test + +! [ 3 ] [ "foo bar" "foo\\b" match-head ] unit-test +! [ f ] [ "fooxbar" "foo\\b" matches? ] unit-test +! [ t ] [ "foo" "foo\\b" matches? ] unit-test +! [ t ] [ "foo bar" "foo\\b bar" matches? ] unit-test +! [ f ] [ "fooxbar" "foo\\bxbar" matches? ] unit-test +! [ f ] [ "foo" "foo\\bbar" matches? ] unit-test + +! [ f ] [ "foo bar" "foo\\B" matches? ] unit-test +! [ 3 ] [ "fooxbar" "foo\\B" match-head ] unit-test +! [ t ] [ "foo" "foo\\B" matches? ] unit-test +! [ f ] [ "foo bar" "foo\\B bar" matches? ] unit-test +! [ t ] [ "fooxbar" "foo\\Bxbar" matches? ] unit-test +! [ f ] [ "foo" "foo\\Bbar" matches? ] unit-test + ! Bug in parsing word ! [ t ] [ "a" R' a' matches? ] unit-test diff --git a/unfinished/regexp2/utils/utils.factor b/unfinished/regexp2/utils/utils.factor index 0167e73005..a7606e0af3 100644 --- a/unfinished/regexp2/utils/utils.factor +++ b/unfinished/regexp2/utils/utils.factor @@ -19,6 +19,7 @@ IN: regexp2.utils : push1 ( obj -- ) input-stream get stream>> push ; : peek1 ( -- obj ) input-stream get stream>> [ f ] [ peek ] if-empty ; : pop3 ( seq -- obj1 obj2 obj3 ) [ pop ] [ pop ] [ pop ] tri spin ; +: drop1 ( -- ) read1 drop ; : stack ( -- obj ) current-regexp get stack>> ; : change-whole-stack ( quot -- ) diff --git a/extra/balloon-bomber/authors.txt b/unmaintained/balloon-bomber/authors.txt similarity index 100% rename from extra/balloon-bomber/authors.txt rename to unmaintained/balloon-bomber/authors.txt diff --git a/extra/balloon-bomber/balloon-bomber-docs.factor b/unmaintained/balloon-bomber/balloon-bomber-docs.factor similarity index 100% rename from extra/balloon-bomber/balloon-bomber-docs.factor rename to unmaintained/balloon-bomber/balloon-bomber-docs.factor diff --git a/extra/balloon-bomber/balloon-bomber.factor b/unmaintained/balloon-bomber/balloon-bomber.factor similarity index 100% rename from extra/balloon-bomber/balloon-bomber.factor rename to unmaintained/balloon-bomber/balloon-bomber.factor diff --git a/extra/balloon-bomber/summary.txt b/unmaintained/balloon-bomber/summary.txt similarity index 100% rename from extra/balloon-bomber/summary.txt rename to unmaintained/balloon-bomber/summary.txt diff --git a/extra/balloon-bomber/tags.txt b/unmaintained/balloon-bomber/tags.txt similarity index 100% rename from extra/balloon-bomber/tags.txt rename to unmaintained/balloon-bomber/tags.txt diff --git a/extra/bunny/authors.txt b/unmaintained/bunny/authors.txt similarity index 100% rename from extra/bunny/authors.txt rename to unmaintained/bunny/authors.txt diff --git a/extra/bunny/bun_zipper.ply b/unmaintained/bunny/bun_zipper.ply similarity index 100% rename from extra/bunny/bun_zipper.ply rename to unmaintained/bunny/bun_zipper.ply diff --git a/extra/bunny/bunny.factor b/unmaintained/bunny/bunny.factor similarity index 100% rename from extra/bunny/bunny.factor rename to unmaintained/bunny/bunny.factor diff --git a/extra/bunny/cel-shaded/cel-shaded.factor b/unmaintained/bunny/cel-shaded/cel-shaded.factor similarity index 100% rename from extra/bunny/cel-shaded/cel-shaded.factor rename to unmaintained/bunny/cel-shaded/cel-shaded.factor diff --git a/extra/bunny/deploy.factor b/unmaintained/bunny/deploy.factor similarity index 100% rename from extra/bunny/deploy.factor rename to unmaintained/bunny/deploy.factor diff --git a/extra/bunny/fixed-pipeline/fixed-pipeline.factor b/unmaintained/bunny/fixed-pipeline/fixed-pipeline.factor similarity index 100% rename from extra/bunny/fixed-pipeline/fixed-pipeline.factor rename to unmaintained/bunny/fixed-pipeline/fixed-pipeline.factor diff --git a/extra/bunny/model/model.factor b/unmaintained/bunny/model/model.factor similarity index 97% rename from extra/bunny/model/model.factor rename to unmaintained/bunny/model/model.factor index f64030ff70..376cd3feae 100755 --- a/extra/bunny/model/model.factor +++ b/unmaintained/bunny/model/model.factor @@ -82,7 +82,7 @@ M: bunny-dlist bunny-geom bunny-dlist-list glCallList ; M: bunny-buffers bunny-geom - dup { array>> element-array>> } get-slots [ + dup [ array>> ] [ element-array>> ] bi [ { GL_VERTEX_ARRAY GL_NORMAL_ARRAY } [ GL_FLOAT 0 0 buffer-offset glNormalPointer [ @@ -99,7 +99,7 @@ M: bunny-dlist dispose list>> delete-dlist ; M: bunny-buffers dispose - { array>> element-array>> } get-slots + [ array>> ] [ element-array>> ] bi delete-gl-buffer delete-gl-buffer ; : ( model -- geom ) diff --git a/extra/bunny/outlined/outlined.factor b/unmaintained/bunny/outlined/outlined.factor similarity index 100% rename from extra/bunny/outlined/outlined.factor rename to unmaintained/bunny/outlined/outlined.factor diff --git a/extra/bunny/summary.txt b/unmaintained/bunny/summary.txt similarity index 100% rename from extra/bunny/summary.txt rename to unmaintained/bunny/summary.txt diff --git a/extra/bunny/tags.txt b/unmaintained/bunny/tags.txt similarity index 100% rename from extra/bunny/tags.txt rename to unmaintained/bunny/tags.txt diff --git a/unmaintained/cabal/authors.txt b/unmaintained/cabal/authors.txt deleted file mode 100644 index 6cfd5da273..0000000000 --- a/unmaintained/cabal/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Eduardo Cavazos diff --git a/unmaintained/cabal/cabal.factor b/unmaintained/cabal/cabal.factor deleted file mode 100755 index 0ad8465498..0000000000 --- a/unmaintained/cabal/cabal.factor +++ /dev/null @@ -1,94 +0,0 @@ - -USING: kernel - io - io.streams.duplex - io.sockets - io.server - combinators continuations - namespaces generic threads sequences arrays vars ; - -IN: cabal - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -TUPLE: user name ; - -: ( client -- user ) -user construct-empty -tuck set-delegate -dup [ "name: " write flush readln ] with-stream* over set-user-name ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -VAR: users - -: init-users ( -- ) V{ } clone >users ; - -: show-users ( -- ) users> [ user-name print ] each flush ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -VAR: conversation - -: init-conversation ( -- ) V{ } clone >conversation ; - -: show-conversation ( -- ) conversation> [ print ] each flush ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -VARS: input user ; - -: ((send-input)) ( other -- ) [ input> print flush ] with-stream* ; - -: (send-input) ( other -- ) -[ ((send-input)) ] catch [ print dup dispose users> delete ] when ; - -: send-input ( other -- ) -dup duplex-stream-closed? [ users> delete ] [ (send-input) ] if ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: tag-input ( -- ) user> user-name ": " input> 3append >input ; - -: log-input ( -- ) input> conversation> push ; - -! : send-message ( -- ) tag-input users> >array [ send-input ] each ; - -: send-message ( -- ) tag-input log-input users> >array [ send-input ] each ; - -: handle-user-loop ( -- ) -readln >input -{ { [ input> f eq? ] [ user> users> delete ] } - { [ input> "/log" = ] [ show-conversation handle-user-loop ] } - { [ input> "/users" = ] [ show-users handle-user-loop ] } - { [ t ] [ send-message handle-user-loop ] } } -cond ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! : handle-client ( client -- ) dup users> push -! dup [ >user [ handle-user-loop ] with-stream* ] with-scope ; - -: handle-client ( client -- ) - dup users> push -dup [ >user [ handle-user-loop ] with-stream ] with-scope ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: accept-client-loop ( server -- ) -[ accept [ handle-client ] curry in-thread ] keep -accept-client-loop ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! : start-cabal ( -- ) -! init-users -! init-conversation -! 8000 accept-client-loop ; - -: start-cabal ( -- ) -init-users -init-conversation -8000 internet-server [ inet4? ] find nip accept-client-loop ; - -MAIN: start-cabal \ No newline at end of file diff --git a/unmaintained/cabal/summary.txt b/unmaintained/cabal/summary.txt deleted file mode 100644 index 881f8367a1..0000000000 --- a/unmaintained/cabal/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Minimalist chat server diff --git a/unmaintained/cabal/ui/authors.txt b/unmaintained/cabal/ui/authors.txt deleted file mode 100644 index c7091ca9e6..0000000000 --- a/unmaintained/cabal/ui/authors.txt +++ /dev/null @@ -1,2 +0,0 @@ -Matthew Willis -Eduardo Cavazos diff --git a/unmaintained/cabal/ui/summary.txt b/unmaintained/cabal/ui/summary.txt deleted file mode 100644 index 12c0170a5d..0000000000 --- a/unmaintained/cabal/ui/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Connects to a cabal server diff --git a/unmaintained/cabal/ui/ui.factor b/unmaintained/cabal/ui/ui.factor deleted file mode 100644 index 70999c32eb..0000000000 --- a/unmaintained/cabal/ui/ui.factor +++ /dev/null @@ -1,52 +0,0 @@ -USING: kernel - io - io.streams.duplex - io.sockets - namespaces sequences math math.parser threads quotations splitting - ui - ui.gadgets - ui.gadgets.panes - ui.gadgets.scrollers - ui.gadgets.tracks - ui.tools.interactor ; - -IN: cabal.ui - -TUPLE: cabal-gadget input output ; - -: ( -- gadget ) - gadget get cabal-gadget-output ; - -: ( -- gadget ) -cabal-gadget construct-empty -dup -[ over dupd set-cabal-gadget-output 5/6 track, - over dupd set-cabal-gadget-input 1/6 track, - drop ] -curry -{ 0 1 } -build-track ; - -M: cabal-gadget pref-dim* drop { 550 650 } ; - -: cabal-stream ( cabal -- stream ) - dup cabal-gadget-input swap cabal-gadget-output - ; - -: incoming-loop ( stream -- ) dup stream-readln print incoming-loop ; - -: outgoing-loop ( stream -- ) -readln over stream-print dup stream-flush outgoing-loop ; - -: cabal-thread ( -- ) - "cabal://" write readln - ":" split1 string>number - [ outgoing-loop ] in-thread incoming-loop ; - -: cabal-client ( -- ) - dup "Cabal Client" open-window - cabal-stream [ [ cabal-thread ] with-stream ] in-thread drop ; - -: cabal-client* ( -- ) [ cabal-client ] with-ui ; - -MAIN: cabal-client* \ No newline at end of file diff --git a/extra/cairo-demo/authors.txt b/unmaintained/cairo-demo/authors.txt similarity index 100% rename from extra/cairo-demo/authors.txt rename to unmaintained/cairo-demo/authors.txt diff --git a/extra/cairo-demo/cairo-demo.factor b/unmaintained/cairo-demo/cairo-demo.factor similarity index 100% rename from extra/cairo-demo/cairo-demo.factor rename to unmaintained/cairo-demo/cairo-demo.factor diff --git a/extra/cairo/authors.txt b/unmaintained/cairo/authors.txt similarity index 100% rename from extra/cairo/authors.txt rename to unmaintained/cairo/authors.txt diff --git a/extra/cairo/cairo.factor b/unmaintained/cairo/cairo.factor similarity index 100% rename from extra/cairo/cairo.factor rename to unmaintained/cairo/cairo.factor diff --git a/extra/cairo/ffi/ffi.factor b/unmaintained/cairo/ffi/ffi.factor similarity index 100% rename from extra/cairo/ffi/ffi.factor rename to unmaintained/cairo/ffi/ffi.factor diff --git a/extra/cairo/gadgets/gadgets.factor b/unmaintained/cairo/gadgets/gadgets.factor similarity index 100% rename from extra/cairo/gadgets/gadgets.factor rename to unmaintained/cairo/gadgets/gadgets.factor diff --git a/extra/cairo/samples/samples.factor b/unmaintained/cairo/samples/samples.factor similarity index 100% rename from extra/cairo/samples/samples.factor rename to unmaintained/cairo/samples/samples.factor diff --git a/extra/cairo/summary.txt b/unmaintained/cairo/summary.txt similarity index 100% rename from extra/cairo/summary.txt rename to unmaintained/cairo/summary.txt diff --git a/extra/cairo/tags.txt b/unmaintained/cairo/tags.txt similarity index 100% rename from extra/cairo/tags.txt rename to unmaintained/cairo/tags.txt diff --git a/basis/opengl/camera/authors.txt b/unmaintained/camera/authors.txt similarity index 100% rename from basis/opengl/camera/authors.txt rename to unmaintained/camera/authors.txt diff --git a/basis/opengl/camera/camera.factor b/unmaintained/camera/camera.factor similarity index 100% rename from basis/opengl/camera/camera.factor rename to unmaintained/camera/camera.factor diff --git a/extra/digraphs/authors.txt b/unmaintained/digraphs/authors.txt similarity index 100% rename from extra/digraphs/authors.txt rename to unmaintained/digraphs/authors.txt diff --git a/extra/digraphs/digraphs-tests.factor b/unmaintained/digraphs/digraphs-tests.factor similarity index 100% rename from extra/digraphs/digraphs-tests.factor rename to unmaintained/digraphs/digraphs-tests.factor diff --git a/extra/digraphs/digraphs.factor b/unmaintained/digraphs/digraphs.factor similarity index 100% rename from extra/digraphs/digraphs.factor rename to unmaintained/digraphs/digraphs.factor diff --git a/extra/digraphs/summary.txt b/unmaintained/digraphs/summary.txt similarity index 100% rename from extra/digraphs/summary.txt rename to unmaintained/digraphs/summary.txt diff --git a/extra/digraphs/tags.txt b/unmaintained/digraphs/tags.txt similarity index 100% rename from extra/digraphs/tags.txt rename to unmaintained/digraphs/tags.txt diff --git a/unmaintained/enchilada/authors.txt b/unmaintained/enchilada/authors.txt deleted file mode 100644 index bfc196ff8f..0000000000 --- a/unmaintained/enchilada/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Robbert van Dalen diff --git a/unmaintained/enchilada/enchilada-tests.factor b/unmaintained/enchilada/enchilada-tests.factor deleted file mode 100644 index af24e36fe1..0000000000 --- a/unmaintained/enchilada/enchilada-tests.factor +++ /dev/null @@ -1,6 +0,0 @@ -! Copyright (C) 2007 Robbert van Dalen. -! See http://factorcode.org/license.txt for BSD license. - -USING: kernel sequences enchilada strings ; -IN: temporary - diff --git a/unmaintained/enchilada/enchilada.factor b/unmaintained/enchilada/enchilada.factor deleted file mode 100644 index 9568fa8805..0000000000 --- a/unmaintained/enchilada/enchilada.factor +++ /dev/null @@ -1,12 +0,0 @@ -! Copyright (C) 2007 Robbert van Dalen. -! See http://factorcode.org/license.txt for BSD license. - -IN: enchilada -USING: generic kernel enchilada.engine enchilada.parser enchilada.printer prettyprint ; - - -: (e-eval) ( e-expression -- ) - dup e-reducible? [ dup e-print . e-reduce (e-eval) ] [ e-print . ] if ; - -: e-eval ( string -- ) - e-parse (e-eval) ; diff --git a/unmaintained/enchilada/engine/engine.factor b/unmaintained/enchilada/engine/engine.factor deleted file mode 100644 index 8c44d16b1b..0000000000 --- a/unmaintained/enchilada/engine/engine.factor +++ /dev/null @@ -1,322 +0,0 @@ -! Copyright (C) 2007 Robbert van Dalen. -! See http://factorcode.org/license.txt for BSD license. - -IN: enchilada.engine -USING: generic kernel math sequences isequences.interface isequences.base isequences.ops ; - -! Provides Enchilada's rewriting expression engine. -! - -GENERIC: !! ( list -- list ) -GENERIC: \\ ( list -- list ) - -GENERIC: e-reducible? ( e -- ? ) -GENERIC: e-dyadic? ( o -- ? ) -GENERIC: e-operator? ( o -- ? ) -GENERIC: e-list? ( o -- ? ) -GENERIC: e-symbol? ( o -- ? ) - -GENERIC: e-m-operate ( v op -- e ) -GENERIC: e-d-operate ( v1 v2 op -- e ) - -GENERIC: e-reduce ( e -- e ) -GENERIC: free-symbols ( s -- symbols ) - -TUPLE: ireplace from to seq ; - -: unpack-ireplace ( ireplace -- from to seq ) - dup ireplace-from swap dup ireplace-to swap ireplace-seq ; inline - -GENERIC: e-replace ( from to sequence -- s ) - -: (ireplace1) ( from to seq -- ireplace ) - dup is-atom? - [ pick over i-cmp 0 = [ drop nip ] [ nip nip ] if ] - [ ] if ; - -: ( from to seq -- ireplace ) - dup i-length dup 0 = - [ 3drop drop 0 ] - [ 1 = [ (ireplace1) ] [ ] if ] - if ; - -: ireplace-i-at ( s i -- v ) - swap dup ireplace-seq rot i-at dup >r swap dup ireplace-from rot i-cmp 0 = - [ r> drop ireplace-to ] - [ dup ireplace-from swap ireplace-to r> e-replace ] - if ; - -M: object e-replace ; -M: integer e-replace -rot 2drop ; - -M: ireplace i-length ireplace-seq i-length ; -M: ireplace i-at ireplace-i-at ; -M: ireplace ileft unpack-ireplace ileft e-replace ; -M: ireplace iright unpack-ireplace iright e-replace ; -M: ireplace ihead (ihead) ; -M: ireplace itail (itail) ; -M: ireplace $$ unpack-ireplace [ $$ ] 2apply rot $$ quick-hash quick-hash ; - -TUPLE: esymbol seq ; - -GENERIC: esymbol/i-cmp ( esymbol s -- i ) - -M: object esymbol/i-cmp 2drop -1 ; -M: esymbol esymbol/i-cmp swap [ esymbol-seq ] 2apply i-cmp ; -M: esymbol object/i-cmp 2drop 1 ; -M: esymbol i-cmp swap esymbol/i-cmp ; - -DEFER: (sunion) - -: (sunion6) ( s1 s2 -- s ) - 2dup [ 0 i-at ] 2apply i-cmp dup zero? - [ 2drop ] [ 0 > [ swap ] when ++ ] if ; inline - -: (sunion5) ( s1 s2 -- s ) - over ileft i-length pick swap i-at icut rot left-right - swap roll (sunion) -rot swap (sunion) ++ ; inline - -: (sunion4) ( s1 s2 -- s ) - 2dup ifirst swap ilast i-cmp dup zero? - [ drop 1 itail ++ ] [ 0 > [ ++ ] [ (sunion5) ] if ] if ; inline - -: (sunion3) ( s1 s2 ls1 ls2 -- s ) - 1 = - [ 1 = [ (sunion6) ] [ (sunion4) ] if ] - [ 1 = [ swap ] when (sunion4) ] if ; inline - -: (sunion2) ( s1 s2 -- s ) - 2dup [ i-length ] 2apply 2dup zero? - [ 3drop drop ] [ zero? [ 2drop nip ] [ (sunion3) ] if ] if ; inline - -: (sunion) ( s1 s2 -- s ) - 2dup eq? [ drop ] [ (sunion2) ] if ; inline - -: s-union ( s1 s2 -- s ) - (sunion) ; inline - -: (free-symbols) ( s -- symbols ) - dup is-atom? - [ dup e-symbol? [ drop 0 ] unless ] - [ 0 i-at free-symbols ] if ; - -M: object free-symbols - dup i-length dup 0 = - [ 2drop 0 ] - [ 1 = [ (free-symbols) ] [ left-right [ free-symbols ] 2apply s-union ] if ] if ; - -M: integer free-symbols drop 0 ; - -M: object !! - dup i-length dup 0 = - [ 2drop 0 ] - [ 1 = [ 0 i-at dup left-side swap right-side [ e-reduce ] 2apply ] [ left-right [ !! ] 2apply ++ ] if ] if ; - -M: integer !! ; - - -: (\\) ( expr -- list ) - dup i-length dup 0 = - [ 2drop 0 ] - [ 1 = [ ] [ left-right [ (\\) ] 2apply ++ ] if ] if ; - -M: object \\ - dup i-length dup 0 = - [ 2drop 0 ] - [ 1 = [ 0 i-at left-side (\\) ] [ left-right [ \\ ] 2apply ++ ] if ] if ; -M: integer \\ ; - -TUPLE: emacro symbols expr eager? ; - -: symbol-list? ( symbols -- ? ) - i-sort dup free-symbols i-cmp 0 = ; inline - -: full-reduce ( expr -- expr ) - dup e-reducible? [ e-reduce full-reduce ] when ; - -: ( symbols expr eager? -- e-macro ) - dup [ swap full-reduce swap ] when - >r swap dup symbol-list? [ swap r> ] [ "illegal symbol list" throw ] if ; - -M: emacro free-symbols dup emacro-expr free-symbols swap emacro-symbols i-diff ; - -M: emacro e-replace - pick over [ free-symbols ] 2apply i-intersect i-length 0 = - [ -rot 2drop ] - [ dup >r emacro-expr e-replace r> dup emacro-symbols swap emacro-eager? rot swap ] if ; - -: eflatten ( s -- s ) - dup i-length dup zero? - [ 2drop 0 ] - [ 1 = [ 0 i-at left-side ] [ left-right [ eflatten ] 2apply ++ ] if ] if ; inline - -TUPLE: c-op v d-op ; - -M: object e-operator? drop f ; -M: object e-list? dup e-operator? not swap e-symbol? not and ; -M: object e-symbol? drop f ; -M: object e-dyadic? drop f ; - -M: esymbol e-symbol? drop t ; - -M: c-op e-m-operate - dup c-op-v swap c-op-d-op e-d-operate ; - -TUPLE: .- ; -M: .- e-m-operate drop -- ; -TUPLE: .` ; -M: .` e-m-operate drop `` ; -TUPLE: .$ ; -M: .$ e-m-operate drop $$ ; -TUPLE: .~ ; -M: .~ e-m-operate drop ~~ ; -TUPLE: .: ; -M: .: e-m-operate drop :: ; -TUPLE: .# ; -M: .# e-m-operate drop ## ; -TUPLE: .^ ; -M: .^ e-m-operate drop eflatten ; -TUPLE: .! ; -M: .! e-m-operate drop !! ; -TUPLE: .\ ; -M: .\ e-m-operate drop \\ ; - -TUPLE: .+ ; -M: .+ e-d-operate drop ++ ; -TUPLE: .* ; -M: .* e-d-operate drop ** [ ] 2apply ++ ; -TUPLE: ./ ; -M: ./ e-d-operate drop // [ ] 2apply ++ ; -TUPLE: .& ; -M: .& e-d-operate drop && ; -TUPLE: .| ; -M: .| e-d-operate drop || ; -TUPLE: .< ; -M: .< e-d-operate drop << [ ] 2apply ++ ; -TUPLE: .> ; -M: .> e-d-operate drop >> ; -TUPLE: .@ ; -M: .@ e-d-operate >r swap 0 i-cmp 0 = [ dup eflatten swap ++ r> ++ ] [ r> 2drop 0 ] if ; -TUPLE: .? ; -M: .? e-d-operate drop (i-eq?) [ 1 ] [ 0 ] if ; -TUPLE: .% ; -M: .% e-d-operate drop %% [ ] 2apply ++ ; - -UNION: monadic-class c-op .- .` .$ .~ .: .# .^ .! .\ emacro ; -UNION: dyadic-class .+ .* ./ .& .| .< .> .@ .? .% ; -UNION: operator-class monadic-class dyadic-class ; - -M: operator-class e-operator? drop t ; -M: monadic-class e-dyadic? drop f ; -M: dyadic-class e-dyadic? drop t ; - -DEFER: +e+ - -: (e-reducible?) ( e -- ? ) - left-right 2dup [ e-reducible? ] either? - [ 2drop t ] [ ifirst e-operator? swap ilast e-list? and ] if ; inline - -M: object e-reducible? - dup i-length 1 <= [ drop f ] [ (e-reducible?) ] if ; - -: (e-reduce2) ( e1 e2 -- e ) - 2dup ifirst swap ilast swap e-m-operate - -rot 1 itail swap dup i-length 1- ihead rot ++ swap ++ ; inline - -: (e-reduce) ( e -- e ) - left-right swap dup e-reducible? [ (e-reduce) swap ++ ] - [ swap dup e-reducible? [ (e-reduce) ++ ] [ (e-reduce2) ] if ] if ; inline - -M: object e-reduce - dup e-reducible? [ (e-reduce) ] when ; - -: (+e+2) ( e1 e2 -- e ) - 2dup ifirst swap ilast swap - -rot 1 itail swap dup i-length 1- ihead rot ++ swap ++ ; inline - -: (+e+1) ( e1 e2 -- e ) - 2dup ifirst e-dyadic? swap ilast e-list? and - [ (+e+2) ] [ ++g ] if ; inline - -TUPLE: e-exp expr reducible ; - -M: e-exp e-reducible? e-exp-reducible ; - -: ( s -- e-exp ) - dup e-exp? [ dup e-reducible? ] unless ; inline - -: +e+ ( e1 e2 -- e ) - 2dup [ i-length 1 >= ] both? - [ (+e+1) ] [ ++g ] if ; inline - -: e-ipair ( e1 e2 -- e ) - ; inline - -M: c-op e-replace dup >r c-op-v e-replace r> c-op-d-op ; - - -GENERIC: e-exp/++ ( s e -- e ) -GENERIC: e-exp/ipair ( s e -- e ) - -M: e-exp ++ swap e-exp/++ ; -M: e-exp ipair swap e-exp/ipair ; - -M: object e-exp/++ swap +e+ ; -M: object e-exp/ipair swap e-ipair ; - -M: e-exp e-exp/++ swap +e+ ; -M: e-exp e-exp/ipair swap e-ipair ; -M: e-exp object/++ swap +e+ ; -M: e-exp object/ipair swap e-ipair ; - -M: operator-class ++ +e+ ; - -M: e-exp i-length e-exp-expr i-length ; -M: e-exp i-at swap e-exp-expr swap i-at ; -M: e-exp ileft e-exp-expr ileft ; -M: e-exp iright e-exp-expr iright ; -M: e-exp ihead swap e-exp-expr swap ihead ; -M: e-exp itail swap e-exp-expr swap itail ; -M: e-exp $$ e-exp-expr $$ ; - -M: e-exp e-replace - dup i-length 1 = - [ e-exp-expr e-replace ] - [ 3dup iright e-replace >r ileft e-replace r> ++ ] if ; - -TUPLE: ereplacement from to ; - -: (ereplace) ( symbols from-symbol -- to-symbol ) - esymbol-seq dup ++ dup pick i-intersect i-length zero? - [ nip ] [ (ereplace) ] if ; inline - -: (replacements3) ( symbols from-symbol -- newsymbols replacement ) - 2dup (ereplace) rot over i-union -rot ; inline - -: (replacements2) ( symbols intersect -- replacements ) - dup i-length zero? - [ 2drop 0 ] - [ dup >r ifirst (replacements3) swap r> 1 itail (replacements2) ++ ] if ; - -: replace-s ( s replacements -- s ) - dup i-length dup zero? - [ 2drop ] - [ 1 = [ 0 i-at dup ereplacement-from swap ereplacement-to rot e-replace ] [ left-right >r replace-s r> replace-s ] if ] if ; - -: (replacements) ( value macro -- replacements ) - dup emacro-expr free-symbols swap emacro-symbols -1 ++ - i-intersect tuck swap free-symbols i-intersect (replacements2) ; inline - -: (replace-macro) ( replacements macro -- macro ) - 2dup dup >r emacro-symbols swap replace-s swap emacro-expr rot replace-s r> emacro-eager? ; - -: (eval-macro) ( value macro -- macro ) - dup >r emacro-symbols dup -1 ++ swap ilast rot r> dup >r emacro-expr e-replace r> emacro-eager? ; - -: eval-macro ( value macro -- s ) - 2dup (replacements) swap (replace-macro) (eval-macro) ; - -: emacro-e-m-operate ( value macro -- s ) - eval-macro dup emacro-symbols i-length zero? [ emacro-expr ] when ; - -M: emacro e-m-operate emacro-e-m-operate ; diff --git a/unmaintained/enchilada/parser/parser.factor b/unmaintained/enchilada/parser/parser.factor deleted file mode 100644 index 4001655261..0000000000 --- a/unmaintained/enchilada/parser/parser.factor +++ /dev/null @@ -1,139 +0,0 @@ -! Copyright (C) 2007 Robbert van Dalen. -! See http://factorcode.org/license.txt for BSD license. - -IN: enchilada.parser -USING: strings sequences kernel promises lazy-lists parser-combinators parser-combinators.simple isequences.interface isequences.base enchilada.engine ; - -USE: lazy-lists -USE: parser-combinators - -DEFER: e-expression - -LAZY: e/- ( -- parser ) - "-" token [ drop <.-> ] <@ ; - -LAZY: e/# ( -- parser ) - "#" token [ drop <.#> ] <@ ; - -LAZY: e/^ ( -- parser ) - "^" token [ drop <.^> ] <@ ; - -LAZY: e/` ( -- parser ) - "`" token [ drop <.`> ] <@ ; - -LAZY: e/: ( -- parser ) - ":" token [ drop <.:> ] <@ ; - -LAZY: e/~ ( -- parser ) - "~" token [ drop <.~> ] <@ ; - -LAZY: e/$ ( -- parser ) - "$" token [ drop <.$> ] <@ ; - -LAZY: e/! ( -- parser ) - "!" token [ drop <.!> ] <@ ; - -LAZY: e/\ ( -- parser ) - "\\" token [ drop <.\> ] <@ ; - -LAZY: e/+ ( -- parser ) - "+" token [ drop <.+> ] <@ ; - -LAZY: e/| ( -- parser ) - "|" token [ drop <.|> ] <@ ; - -LAZY: e/& ( -- parser ) - "&" token [ drop <.&> ] <@ ; - -LAZY: e/* ( -- parser ) - "*" token [ drop <.*> ] <@ ; - -LAZY: e// ( -- parser ) - "/" token [ drop <./> ] <@ ; - -LAZY: e/< ( -- parser ) - "<" token [ drop <.<> ] <@ ; - -LAZY: e/> ( -- parser ) - ">" token [ drop <.>> ] <@ ; - -LAZY: e/@ ( -- parser ) - "@" token [ drop <.@> ] <@ ; - -LAZY: e/? ( -- parser ) - "?" token [ drop <.?> ] <@ ; - -LAZY: e/% ( -- parser ) - "%" token [ drop <.%> ] <@ ; - -LAZY: e-monadic ( -- parser ) - e/- e/# <|> e/^ <|> e/` <|> e/: <|> e/~ <|> e/$ <|> e/! <|> e/\ <|> ; - -LAZY: e-dyadic ( -- parser ) - e/+ e/* <|> e/& <|> e/| <|> e// <|> e/< <|> e/> <|> e/@ <|> e/? <|> e/% <|> ; - -LAZY: e-number ( -- parser ) - 'integer' ; - -LAZY: e-letter ( -- parser ) - [ letter? ] satisfy [ 1 swap ] <@ ; - -LAZY: e-digit ( -- parser ) - [ digit? ] satisfy [ 1 swap ] <@ ; - -LAZY: e-alphanumeric-char ( -- parser ) - e-letter e-digit <|> ; - -LAZY: e-alphanumeric-symbol ( -- parser ) - e-letter e-alphanumeric-char <&> [ dup first swap second "" [ append ] reduce append ] <@ ; - -LAZY: e-symbol ( -- parser ) - e-alphanumeric-symbol 'string' <|> sp [ ] <@ ; - -LAZY: e-symbol-list ( -- parser ) - e-symbol [ { } [ ++ ] reduce ] <@ ; - -LAZY: e-macro-expression ( -- parser ) - "=" token "=" token <&> sp e-expression <&> [ dup 1 tail swap first second [ t ] [ f ] if add ] <@ ; - -LAZY: e-macro ( -- parser ) - "{" token sp e-symbol-list &> e-macro-expression <&> "}" token sp <& - [ dup first swap second dup [ first ] [ drop { 0 f } ] if dup first swap second ] <@ ; - -LAZY: e-right-expression ( -- parser ) - "=" token e-expression &> ; - -: create-e-item ( pair -- e-item ) - dup first swap second dup [ first ] [ drop 0 ] if ; - -LAZY: e-item ( -- parser ) -e-expression e-right-expression <&> [ create-e-item ] <@ ; - -LAZY: e-rest ( -- parser ) -";" token sp e-item &> [ { } [ ++ ] reduce ] <@ ; - -LAZY: e-contents ( -- parser ) -e-item e-rest <&> [ dup first swap second ++ ] <@ ; - -LAZY: e-non-empty ( -- parser ) -"[" token e-contents &> "]" token sp <& ; - -LAZY: e-empty ( -- parser ) - "[" token "]" token <&> [ drop 0 ] <@ ; - -LAZY: e-sequence ( -- parser ) - e-empty e-non-empty <|> e-number <|> ; - -LAZY: e-operand ( -- parser ) - "_" token e-sequence <&> [ dup second swap first [ -- ] when ] <@ ; - -LAZY: e-operator ( -- parser ) - e-monadic e-dyadic <|> e-macro <|> ; - -LAZY: e-element ( -- parser ) - e-operator e-operand <|> e-symbol <|> sp ; - -LAZY: e-expression ( -- parser ) - e-element [ { } [ ++ ] reduce ] <@ ; - -: e-parse ( string -- result ) e-expression parse car parse-result-parsed ; diff --git a/unmaintained/enchilada/printer/printer.factor b/unmaintained/enchilada/printer/printer.factor deleted file mode 100644 index 569c71b1eb..0000000000 --- a/unmaintained/enchilada/printer/printer.factor +++ /dev/null @@ -1,71 +0,0 @@ -! Copyright (C) 2007 Robbert van Dalen. -! See http://factorcode.org/license.txt for BSD license. - -IN: enchilada.printer -USING: prettyprint strings generic kernel math math.parser sequences isequences.interface isequences.base enchilada.engine ; - -: s-append ( s1 s2 s3 -- s ) - swap append append ; - -DEFER: e-print -DEFER: l-print - -GENERIC: (e-print) ( op -- string ) - -M: .- (e-print) drop "-" ; -M: .# (e-print) drop "#" ; -M: .$ (e-print) drop "$" ; -M: .^ (e-print) drop "^" ; -M: .` (e-print) drop "`" ; -M: .~ (e-print) drop "~" ; -M: .: (e-print) drop ":" ; -M: .! (e-print) drop "!" ; -M: .\ (e-print) drop "\\" ; - -M: .+ (e-print) drop "+" ; -M: .* (e-print) drop "*" ; -M: ./ (e-print) drop "/" ; -M: .< (e-print) drop "<" ; -M: .> (e-print) drop ">" ; -M: .| (e-print) drop "|" ; -M: .& (e-print) drop "&" ; -M: .@ (e-print) drop "@" ; -M: .? (e-print) drop "?" ; -M: .% (e-print) drop "%" ; - -: (eprint-macro-expr) ( emacro -- string ) - dup emacro-expr dup i-length 0 = - [ 2drop "" ] - [ e-print swap emacro-eager? [ "==" ] [ "=" ] if swap append ] if ; - -: (l-print1) ( e-list -- string ) - 0 i-at dup left-side swap right-side dup 0 = - [ drop dup i-length 0 = [ drop " " ] [ e-print ] if ] [ e-print swap e-print swap "=" s-append ] if ; - -: (l-print0) ( e-list -- string ) - left-right [ l-print ] 2apply ";" s-append ; - -: l-print ( e-list -- string ) - dup i-length dup 0 = - [ 2drop "0" ] [ 1 = [ (l-print1) ] [ (l-print0) ] if ] if ; - -: prefix-neg ( s -- s prefix ) - dup i-length 0 < [ -- "_" ] [ "" ] if ; - -: (e-print3) ( symbol -- string ) - esymbol-seq to-sequence >string ; - -: (e-print2) ( e-list -- string ) - dup integer? [ prefix-neg swap number>string append ] [ prefix-neg "[" append swap l-print "]" append append ] if ; - -: (e-print1) ( e-expression -- string ) - 0 i-at dup e-operator? [ (e-print) ] [ dup e-symbol? [ (e-print3) ] [ (e-print2) ] if ] if ; - -: e-print ( e-expression -- string ) - dup i-length dup 0 = - [ 2drop "" ] - [ 1 = [ (e-print1) ] [ left-right [ e-print ] 2apply " " s-append ] if ] if ; - -M: c-op (e-print) dup c-op-d-op swap c-op-v (e-print2) swap (e-print) " " s-append ; -M: emacro (e-print) "{" swap dup emacro-symbols e-print swap (eprint-macro-expr) "}" append append append ; - diff --git a/unmaintained/enchilada/summary.txt b/unmaintained/enchilada/summary.txt deleted file mode 100644 index 17d5a87279..0000000000 --- a/unmaintained/enchilada/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Enchilada, a concatenative programming language diff --git a/unmaintained/enchilada/tags.txt b/unmaintained/enchilada/tags.txt deleted file mode 100644 index eab42feac7..0000000000 --- a/unmaintained/enchilada/tags.txt +++ /dev/null @@ -1 +0,0 @@ -languages diff --git a/unmaintained/furnace-onigiri/load.factor b/unmaintained/furnace-onigiri/load.factor deleted file mode 100644 index 727eaf7a92..0000000000 --- a/unmaintained/furnace-onigiri/load.factor +++ /dev/null @@ -1,12 +0,0 @@ -! Copyright (C) 2006 Matthew Willis. All Rights Reserved. -! See http://factorcode.org/license.txt for BSD license. -! - -REQUIRES: libs/calendar libs/crypto libs/basic-authentication -libs/furnace libs/serialize ; - -PROVIDE: apps/furnace-onigiri -{ +files+ { - "onigiri.factor" - "onigiri.facts" -} } ; \ No newline at end of file diff --git a/unmaintained/furnace-onigiri/onigiri.factor b/unmaintained/furnace-onigiri/onigiri.factor deleted file mode 100644 index a015659c0f..0000000000 --- a/unmaintained/furnace-onigiri/onigiri.factor +++ /dev/null @@ -1,166 +0,0 @@ -! Copyright (C) 2006 Matthew Willis. All Rights Reserved. -! See http://factorcode.org/license.txt for BSD license. -! - -USING: httpd threads kernel namespaces furnace sequences -html strings math assocs crypto io file-responder calendar -prettyprint parser errors sha2 basic-authentication arrays -serialize ; - -IN: furnace:onigiri - -TUPLE: entry title stub body created ; - -TUPLE: user name password ; - -TUPLE: meta key value ; - -: title>stub ( title -- stub ) - ! creates a url friendly name based on the title - " " split [ [ alpha? ] subset ] map "" swap remove "-" join ; - -C: entry ( title body stub -- entry ) - tuck set-entry-stub - tuck set-entry-body - dup entry-stub [ over title>stub over set-entry-stub ] unless - now over set-entry-created tuck set-entry-title ; - -C: user ( name password -- user ) - swap string>sha-256-string over set-user-password - tuck set-user-name ; - -: base-url ( -- url ) - "http://" "Host" "header" get at append ; - -: action>url ( action -- url ) - "responder-url" get swap append ; - -: stub>url ( stub -- url ) - "entry-show?stub=" swap append action>url ; - -: stub>entry ( stub -- entry ) - entry get-global [ entry-stub = ] subset-with - dup empty? [ drop f ] [ first ] if ; - -: atom ( -- ) - "text/xml" serving-content - [ f "atom" render-template ] with-html-stream ; - -: sitemap ( -- ) - "text/xml" serving-content - [ f "sitemap" render-template ] with-html-stream ; - -: css-path ( -- path ) - ! "text/css" serving-content - "css" meta crud-lookup* meta-value - [ "onigirihouse.css" ] unless* ; - -DEFER: key>meta* -: entry-list ( -- ) - "title" key>meta* meta-value - serving-html [ - "header" render-template - entry get-global - [ [ entry-created ] 2apply swap compare-timestamps ] sort - [ "entry-show" render-template ] each - f "footer" render-template - ] with-html-stream ; - -DEFER: key>meta -: entry-show ( stub -- ) - stub>entry - [ - "title" key>meta* meta-value - " - " pick entry-title 3append - serving-html [ - "header" render-template - "entry-show" render-template - f "footer" render-template - ] with-html-stream - ] [ - "title" key>meta* meta-value " - Entry not found" append - serving-html [ - [ -

"The entry you are searching for could not be found" write

-

[ entry-list ] "Back to " "title" key>meta - [ meta-value ] [ "the main page" ] if* append render-link -

- ] html-document - ] with-html-stream - ] if* ; - -: entry-edit ( stub wiky -- ) - swap stub>entry dup [ entry-title ] [ f ] if* - "title" key>meta* meta-value " - editing " rot 3append - serving-html [ - "header" render-template - swap "entry-edit" "entry-edit-plain" ? render-template - f "footer" render-template - ] with-html-stream ; - -: entry-update ( title body stub -- ) - "onigiri-realm" [ - dup stub>entry [ - nip tuck set-entry-body tuck set-entry-title - ] [ - dup entry get-global swap add entry set-global - ] if* entry-stub entry-show - ] with-basic-authentication ; - -: entry-delete ( stub -- ) - "onigiri-realm" [ - stub>entry entry get-global remove entry set-global entry-list - ] with-basic-authentication ; - -DEFER: name>user -: onigiri-realm ( name password -- bool ) - swap name>user [ user-password = ] [ drop f ] if* - user get-global empty? or ; - -: register-actions ( -- ) - \ entry-list { } define-action - \ entry-show { { "stub" } } define-action - \ entry-edit { { "stub" } { "wiky" f v-default } } define-action - \ entry-update { { "title" } { "body" } { "stub" } } define-action - \ entry-delete { { "stub" } } define-action - \ atom { } define-action - \ sitemap { } define-action - "onigiri" "entry-list" "apps/furnace-onigiri/templates/" web-app - "onigiri-resources" [ - [ - "apps/furnace-onigiri/resources/" resource-path "doc-root" set - file-responder - ] with-scope - ] add-simple-responder - [ onigiri-realm ] "onigiri-realm" add-realm - ! and finally, use scaffolding for metadata and user data - [ - "furnace:onigiri" set-in - meta "key" "onigiri-realm" scaffold - user "name" "onigiri-realm" scaffold - ] with-scope ; - -: onigiri ( -- ) - register-actions - "default-responder" key>meta* meta-value - [ "onigiri" set-default-responder ] when - "port" key>meta* meta-value string>number [ 8888 ] unless* - [ httpd ] in-thread drop ; - -: onigiri-dump ( path -- ) - [ - [ - entry get-global serialize - meta get-global serialize - user get-global serialize - ] with-serialized - ] with-file-writer ; - -: onigiri-boot ( path -- ) - [ - [ - deserialize entry set-global - deserialize meta set-global - deserialize user set-global - ] with-serialized - ] with-stream ; diff --git a/unmaintained/furnace-onigiri/onigiri.facts b/unmaintained/furnace-onigiri/onigiri.facts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/unmaintained/furnace-onigiri/onigiri.todo b/unmaintained/furnace-onigiri/onigiri.todo deleted file mode 100644 index 2785c009f8..0000000000 --- a/unmaintained/furnace-onigiri/onigiri.todo +++ /dev/null @@ -1,4 +0,0 @@ -Recent posts sidebar -Links sidebar -Widgets (Onigirihouse feels ...) -Tagging* \ No newline at end of file diff --git a/unmaintained/furnace-onigiri/resources/onigirihouse.css b/unmaintained/furnace-onigiri/resources/onigirihouse.css deleted file mode 100644 index 89f26645f8..0000000000 --- a/unmaintained/furnace-onigiri/resources/onigirihouse.css +++ /dev/null @@ -1,7 +0,0 @@ -body { font: 14px "Trebuchet MS", Arial, Helvetica, sans-serif; } -h1, h2, h3, h4, h5, h6 { font-family: lucida grande ; } -#header { text-align: center ; } -#container { max-width: 720px ; margin: 0 auto; padding: 20px; } -.entry { margin-bottom: 75px ; } -a { color: #5C832F; text-decoration: none; } -a:hover { text-decoration: underline; } \ No newline at end of file diff --git a/unmaintained/furnace-onigiri/resources/wiky/wiky.css b/unmaintained/furnace-onigiri/resources/wiky/wiky.css deleted file mode 100644 index 062f34efd9..0000000000 --- a/unmaintained/furnace-onigiri/resources/wiky/wiky.css +++ /dev/null @@ -1,15 +0,0 @@ -/* == wiky == */ -*.wiki blockquote { background:#ddd; border:solid 1px #999; margin-left:1em; padding:0.5em;} -*.wiki table { - border-collapse: collapse; - empty-cells: show; -} - -*.wiki table td { - border: solid 1px black; - padding: 0.25em 0.5em 0.25em 0.5em; - text-align: center; -} - -/*pre { font-size:100%; background: #eed; border:1px dotted #999; padding:0 0.5em; overflow:auto; }*/ -pre { font-family:courier new, monospace; overflow:auto; } diff --git a/unmaintained/furnace-onigiri/resources/wiky/wiky.js b/unmaintained/furnace-onigiri/resources/wiky/wiky.js deleted file mode 100644 index 71e46ff86a..0000000000 --- a/unmaintained/furnace-onigiri/resources/wiky/wiky.js +++ /dev/null @@ -1,373 +0,0 @@ -/* This work is licensed under Creative Commons GNU LGPL License. - - License: http://creativecommons.org/licenses/LGPL/2.1/ - - Author: Stefan Goessner/2005-06 - Web: http://goessner.net/ -*/ -var Wiky = { - version: 0.95, - blocks: null, - rules: { - all: [ - "Wiky.rules.pre", - "Wiky.rules.nonwikiblocks", - "Wiky.rules.wikiblocks", - "Wiky.rules.post", - ], - pre: [ - { rex:/(\r?\n)/g, tmplt:"\xB6" }, // replace line breaks with '¶' .. - ], - post: [ - { rex:/(^\xB6)|(\xB6$)/g, tmplt:"" }, // .. remove linebreaks at BOS and EOS .. - { rex:/@([0-9]+)@/g, tmplt:function($0,$1){return Wiky.restore($1);} }, // resolve blocks .. - { rex:/\xB6/g, tmplt:"\n" } // replace '¶' with line breaks .. - ], - nonwikiblocks: [ - { rex:/\\([%])/g, tmplt:function($0,$1){return Wiky.store($1);} }, - { rex:/\[(?:\{([^}]*)\})?(?:\(([^)]*)\))?%(.*?)%\]/g, tmplt:function($0,$1,$2,$3){return ":p]"+Wiky.store("" + Wiky.apply($3, $2?Wiky.rules.lang[Wiky.attr($2)]:Wiky.rules.code) + "")+"[p:";} } //programm code block - ], - wikiblocks: [ - "Wiky.rules.nonwikiinlines", - "Wiky.rules.escapes", - { rex:/(?:^|\xB6)(={1,6})(.*?)[=]*(?=\xB6|$)/g, tmplt:function($0,$1,$2){ var h=$1.length; return ":p]\xB6"+$2+"\xB6[p:";} }, //

..

- { rex:/(?:^|\xB6)[-]{4}(?:\xB6|$)/g, tmplt:"\xB6
\xB6" }, // horizontal ruler .. - { rex:/\\\\([ \xB6])/g, tmplt:"
$1" }, // forced line break .. - { rex:/(^|\xB6)([*01aAiIg]*[\.*])[ ]/g, tmplt:function($0,$1,$2){var state=$2.replace(/([*])/g,"u").replace(/([\.])/,"");return ":"+state+"]"+$1+"["+state+":";}}, - { rex:/(?:^|\xB6);[ ](.*?):[ ]/g, tmplt:"\xB6:l][l:$1:d][d:"}, // ; term : definition - { rex:/\[(?:\{([^}]*)\})?(?:\(([^)]*)\))?\"/g, tmplt:function($0,$1,$2){return ":p][p:"; } }, // block quotation start - { rex:/\"\]/g, tmplt:":p][p:" }, // block quotation end - { rex:/\[(\{[^}]*\})?\|/g, tmplt:":t]$1[r:" }, // .. start table .. - { rex:/\|\]/g, tmplt:":r][t:" }, // .. end table .. - { rex:/\|\xB6[ ]?\|/g, tmplt:":r]\xB6[r:" }, // .. end/start table row .. - { rex:/\|/g, tmplt:":c][c:" }, // .. end/start table cell .. - { rex:/^(.*)$/g, tmplt:"[p:$1:p]" }, // start paragraph '[p:' at BOS .. end paragraph ':p]' at EOS .. - { rex:/(([\xB6])([ \t\f\v\xB6]*?)){2,}/g, tmplt:":p]$1[p:" }, // .. separate paragraphs at blank lines .. - { rex:/\[([01AIacdgilprtu]+)[:](.*?)[:]([01AIacdgilprtu]+)\]/g, tmplt:function($0,$1,$2,$3){return Wiky.sectionRule($1==undefined?"":$1,"",Wiky.apply($2,Wiky.rules.wikiinlines),!$3?"":$3);} }, - { rex:/\[[01AIacdgilprtu]+[:]|[:][01AIacdgilprtu]+\]/g, tmplt:"" }, // .. remove singular section delimiters (they frequently exist with incomplete documents while typing) .. - { rex:/(?:([0-9]*)[>])?([ ]?)(.*?)([ ]?)<\/td>/g, tmplt:function($0,$1,$2,$3,$4){return ""+$2+$3+$4+"";} }, - { rex:/<(p|table)>(?:\xB6)?(?:\{(.*?)\})/g, tmplt:function($0,$1,$2){return "<"+$1+Wiky.style($2)+">";} }, - { rex:/

([ \t\f\v\xB6]*?)<\/p>/g, tmplt:"$1" }, // .. remove empty paragraphs .. - "Wiky.rules.shortcuts" - ], - nonwikiinlines: [ - { rex:/%(?:\{([^}]*)\})?(?:\(([^)]*)\))?(.*?)%/g, tmplt:function($0,$1,$2,$3){return Wiky.store("" + Wiky.apply($3, $2?Wiky.rules.lang[Wiky.attr($2)]:Wiky.rules.code) + "");} }, // inline code - { rex:/%(.*?)%/g, tmplt:function($0,$1){return Wiky.store("" + Wiky.apply($2, Wiky.rules.code) + "");} } - ], - wikiinlines: [ - { rex:/\*([^*]+)\*/g, tmplt:"$1" }, // .. strong .. - { rex:/_([^_]+)_/g, tmplt:"$1" }, - { rex:/\^([^^]+)\^/g, tmplt:"$1" }, - { rex:/~([^~]+)~/g, tmplt:"$1" }, - { rex:/\(-(.+?)-\)/g, tmplt:"$1" }, - { rex:/\?([^ \t\f\v\xB6]+)\((.+)\)\?/g, tmplt:"$1" }, // .. abbreviation .. - { rex:/\[(?:\{([^}]*)\})?[Ii]ma?ge?\:([^ ,\]]*)(?:[, ]([^\]]*))?\]/g, tmplt:function($0,$1,$2,$3){return Wiky.store("");} }, // wikimedia image style .. - { rex:/\[([^ ,]+)[, ]([^\]]*)\]/g, tmplt:function($0,$1,$2){return Wiky.store(""+$2+"");}}, // wiki block style uri's .. - { rex:/(((http(s?))\:\/\/)?[A-Za-z0-9\._\/~\-:]+\.(?:png|jpg|jpeg|gif|bmp))/g, tmplt:function($0,$1,$2){return Wiky.store("\""+$1+"\"/");} }, // simple images .. - { rex:/((mailto\:|javascript\:|(news|file|(ht|f)tp(s?))\:\/\/)[A-Za-z0-9\.:_\/~%\-+&#?!=()@\x80-\xB5\xB7\xFF]+)/g, tmplt:"$1" } // simple uri's .. - ], - escapes: [ - { rex:/\\([|*_~\^])/g, tmplt:function($0,$1){return Wiky.store($1);} }, - { rex:/\\&/g, tmplt:"&" }, - { rex:/\\>/g, tmplt:">" }, - { rex:/\\/g, tmplt:"↔"}, // $harr; - { rex:/<-/g, tmplt:"←"}, // ← - { rex:/->/g, tmplt:"→"}, //→ - ], - code: [ - { rex:/&/g, tmplt:"&"}, - { rex://g, tmplt:">"} - ], - lang: {} - }, - - inverse: { - all: [ - "Wiky.inverse.pre", - "Wiky.inverse.nonwikiblocks", - "Wiky.inverse.wikiblocks", - "Wiky.inverse.post" - ], - pre: [ - { rex:/(\r?\n)/g, tmplt:"\xB6" } // replace line breaks with '¶' .. - ], - post: [ - { rex:/@([0-9]+)@/g, tmplt:function($0,$1){return Wiky.restore($1);} }, // resolve blocks .. - { rex:/\xB6/g, tmplt:"\n" } // replace '¶' with line breaks .. - ], - nonwikiblocks: [ - { rex:/]*)>(.*?)<\/pre>/mgi, tmplt:function($0,$1,$2){return Wiky.store("["+Wiky.invStyle($1)+Wiky.invAttr($1,["lang"]).replace(/x\-/,"")+"%"+Wiky.apply($2, Wiky.hasAttr($1,"lang")?Wiky.inverse.lang[Wiky.attrVal($1,"lang").substr(2)]:Wiky.inverse.code)+"%]");} } //code block - ], - wikiblocks: [ - "Wiky.inverse.nonwikiinlines", - "Wiky.inverse.escapes", - "Wiky.inverse.wikiinlines", - { rex:/

(.*?)<\/h1>/mgi, tmplt:"=$1=" }, - { rex:/

(.*?)<\/h2>/mgi, tmplt:"==$1==" }, - { rex:/

(.*?)<\/h3>/mgi, tmplt:"===$1===" }, - { rex:/

(.*?)<\/h4>/mgi, tmplt:"====$1====" }, - { rex:/

(.*?)<\/h5>/mgi, tmplt:"=====$1=====" }, - { rex:/
(.*?)<\/h6>/mgi, tmplt:"======$1======" }, - { rex:/<(p|table)[^>]+(style=\"[^\"]*\")[^>]*>/mgi, tmplt:function($0,$1,$2){return "<"+$1+">"+Wiky.invStyle($2);} }, - { rex:/\xB6{2}
  • \"]*)\"?[^>]*?>([^<]*)/mgi, tmplt:function($0,$1,$2){return $1.replace(/u/g,"*").replace(/([01aAiIg])$/,"$1.")+" "+$2;}}, // list items .. - { rex:/(^|\xB6)<(u|o)l[^>]*?>\xB6/mgi, tmplt:"$1" }, // only outer level list start at BOL ... - { rex:/(<\/(?:dl|ol|ul|p)>[ \xB6]*<(?:p)>)/gi, tmplt:"\xB6\xB6" }, - { rex:/
    (.*?)<\/dt>[ \f\n\r\t\v]*
    /mgi, tmplt:"; $1: " }, - { rex:/]*)>/mgi, tmplt:function($0,$1){return Wiky.store("["+Wiky.invStyle($1)+Wiky.invAttr($1,["cite","title"])+"\"");} }, - { rex:/<\/blockquote>/mgi, tmplt:"\"]" }, - { rex:/\xB6*[ ]?|<\/tr>/mgi, tmplt:"|" }, // ie6 only .. - { rex:/\xB6]*?)>/mgi, tmplt:"\xB6" }, - { rex:/]*?)>/mgi, tmplt:"|$1>" }, - { rex:/]*?)>/mgi, tmplt:"|" }, - { rex://mgi, tmplt:"[" }, - { rex:/<\/table>/mgi, tmplt:"]" }, - { rex:/]*?)>\xB6*|<\/td>\xB6*|\xB6*|<\/tbody>/mgi, tmplt:"" }, - { rex://mgi, tmplt:"----" }, - { rex://mgi, tmplt:"\\\\" }, - { rex:/(

    |<(d|o|u)l[^>]*>|<\/(dl|ol|ul|p)>|<\/(li|dd)>)/mgi, tmplt:"" }, - "Wiky.inverse.shortcuts" - ], - nonwikiinlines: [ - { rex:/(.*?)<\/code>/g, tmplt:function($0,$1){return Wiky.store("%"+Wiky.apply($1, Wiky.inverse["code"])+"%");} } - ], - wikiinlines: [ - { rex:/]*?>(.*?)<\/strong>/mgi, tmplt:"*$1*" }, - { rex:/]*?>(.*?)<\/b>/mgi, tmplt:"*$1*" }, - { rex:/]*?>(.*?)<\/em>/mgi, tmplt:"_$1_" }, - { rex:/]*?>(.*?)<\/i>/mgi, tmplt:"_$1_" }, - { rex:/]*?>(.*?)<\/sup>/mgi, tmplt:"^$1^" }, - { rex:/]*?>(.*?)<\/sub>/mgi, tmplt:"~$1~" }, - { rex:/]*?>(.*?)<\/del>/mgi, tmplt:"(-$1-)" }, - { rex:/(.*?)<\/abbr>/mgi, tmplt:"?$2($1)?" }, - { rex:/]*?>(.*?)<\/a>/mgi, tmplt:function($0,$1,$2){return $1==$2?$1:"["+$1+","+$2+"]";}}, - { rex:/]*)\/>/mgi, tmplt:function($0,$1){var a=Wiky.attrVal($1,"alt"),h=Wiky.attrVal($1,"src"),t=Wiky.attrVal($1,"title"),s=Wiky.attrVal($1,"style");return s||(t&&h!=t)?("["+Wiky.invStyle($1)+"img:"+h+(t&&(","+t))+"]"):h;}}, - ], - escapes: [ - { rex:/([|*_~%\^])/g, tmplt:"\\$1" }, - { rex:/&/g, tmplt:"\\&" }, - { rex:/>/g, tmplt:"\\>" }, - { rex:/</g, tmplt:"\\<" } - ], - shortcuts: [ - { rex:/–|\u2013/g, tmplt:"--"}, - { rex:/—|\u2014/g, tmplt:"---"}, - { rex:/…|\u2026/g, tmplt:"..."}, - { rex:/↔|\u2194/g, tmplt:"<->"}, - { rex:/←|\u2190/g, tmplt:"<-"}, - { rex:/→|\u2192/g, tmplt:"->"} - ], - code: [ - { rex:/&/g, tmplt:"&"}, - { rex:/</g, tmplt:"<"}, - { rex:/>/g, tmplt:">"} - ], - lang: {} - }, - - toHtml: function(str) { - Wiky.blocks = []; - return Wiky.apply(str, Wiky.rules.all); - }, - - toWiki: function(str) { - Wiky.blocks = []; - return Wiky.apply(str, Wiky.inverse.all); - }, - - apply: function(str, rules) { - if (str && rules) - for (var i in rules) { - if (typeof(rules[i]) == "string") - str = Wiky.apply(str, eval(rules[i])); - else - str = str.replace(rules[i].rex, rules[i].tmplt); - } - return str; - }, - store: function(str, unresolved) { - return unresolved ? "@" + (Wiky.blocks.push(str)-1) + "@" - : "@" + (Wiky.blocks.push(str.replace(/@([0-9]+)@/g, function($0,$1){return Wiky.restore($1);}))-1) + "@"; - }, - restore: function(idx) { - return Wiky.blocks[idx]; - }, - attr: function(str, name, idx) { - var a = str && str.split(",")[idx||0]; - return a ? (name ? (" "+name+"=\""+a+"\"") : a) : ""; - }, - hasAttr: function(str, name) { - return new RegExp(name+"=").test(str); - }, - attrVal: function(str, name) { - return str.replace(new RegExp("^.*?"+name+"=\"(.*?)\".*?$"), "$1"); - }, - invAttr: function(str, names) { - var a=[], x; - for (var i in names) - if (str.indexOf(names[i]+"=")>=0) - a.push(str.replace(new RegExp("^.*?"+names[i]+"=\"(.*?)\".*?$"), "$1")); - return a.length ? ("("+a.join(",")+")") : ""; - }, - style: function(str) { - var s = str && str.split(/,|;/), p, style = ""; - for (var i in s) { - p = s[i].split(":"); - if (p[0] == ">") style += "margin-left:4em;"; - else if (p[0] == "<") style += "margin-right:4em;"; - else if (p[0] == ">>") style += "float:right;"; - else if (p[0] == "<<") style += "float:left;"; - else if (p[0] == "=") style += "display:block;margin:0 auto;"; - else if (p[0] == "_") style += "text-decoration:underline;"; - else if (p[0] == "b") style += "border:solid 1px;"; - else if (p[0] == "c") style += "color:"+p[1]+";"; - else if (p[0] == "C") style += "background:"+p[1]+";"; - else if (p[0] == "w") style += "width:"+p[1]+";"; - else style += p[0]+":"+p[1]+";"; - } - return style ? " style=\""+style+"\"" : ""; - }, - invStyle: function(str) { - var s = /style=/.test(str) ? str.replace(/^.*?style=\"(.*?)\".*?$/, "$1") : "", - p = s && s.split(";"), pi, prop = []; - for (var i in p) { - pi = p[i].split(":"); - if (pi[0] == "margin-left" && pi[1]=="4em") prop.push(">"); - else if (pi[0] == "margin-right" && pi[1]=="4em") prop.push("<"); - else if (pi[0] == "float" && pi[1]=="right") prop.push(">>"); - else if (pi[0] == "float" && pi[1]=="left") prop.push("<<"); - else if (pi[0] == "margin" && pi[1]=="0 auto") prop.push("="); - else if (pi[0] == "display" && pi[1]=="block") ; - else if (pi[0] == "text-decoration" && pi[1]=="underline") prop.push("_"); - else if (pi[0] == "border" && pi[1]=="solid 1px") prop.push("b"); - else if (pi[0] == "color") prop.push("c:"+pi[1]); - else if (pi[0] == "background") prop.push("C:"+pi[1]); - else if (pi[0] == "width") prop.push("w:"+pi[1]); - else if (pi[0]) prop.push(pi[0]+":"+pi[1]); - } - return prop.length ? ("{" + prop.join(",") + "}") : ""; - }, - sectionRule: function(fromLevel, style, content, toLevel) { - var trf = { p_p: "

    $1

    ", - p_u: "

    $1

    ", - p_o: "

    $1

    ", - // p - ul - // ul - p - u_p: "$1", - u_c: "$1", - u_r: "$1", - uu_p: "$1", - uo_p: "$1", - uuu_p: "$1", - uou_p: "$1", - uuo_p: "$1", - uoo_p: "$1", - // ul - ul - u_u: "$1", - uu_u: "$1", - uo_u: "$1", - uuu_u: "$1", - uou_u: "$1", - uuo_u: "$1", - uoo_u: "$1", - u_uu: "$1", - // ul - ol - u_o: "$1", - uu_o: "$1", - uo_o: "$1", - uuu_o: "$1", - uou_o: "$1", - uuo_o: "$1", - uoo_o: "$1", - u_uo: "$1", - // ol - p - o_p: "$1", - oo_p: "$1", - ou_p: "$1", - ooo_p: "$1", - ouo_p: "$1", - oou_p: "$1", - ouu_p: "$1", - // ol - ul - o_u: "$1", - oo_u: "$1", - ou_u: "$1", - ooo_u: "$1", - ouo_u: "$1", - oou_u: "$1", - ouu_u: "$1", - o_ou: "$1", - // -- ol - ol -- - o_o: "$1", - oo_o: "$1", - ou_o: "$1", - ooo_o: "$1", - ouo_o: "$1", - oou_o: "$1", - ouu_o: "$1", - o_oo: "$1", - // -- dl -- - l_d: "
    $1
    ", - d_l: "
    $1
    ", - d_u: "
    $1
      ", - d_o: "
      $1
        ", - p_l: "

        $1

        ", - u_l: "$1
    ", - o_l: "$1
    ", - uu_l: "$1
    ", - uo_l: "$1
    ", - ou_l: "$1
    ", - oo_l: "$1
    ", - d_p: "
    $1
    ", - // -- table -- - p_t: "

    $1

    ", - p_r: "

    $1

    ", - p_c: "

    $1

    ", - t_p: "

    $1

    ", - r_r: "$1", - r_p: "

    $1

    ", - r_c: "$1", - r_u: "$1