]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://github.com/ex-rzr/factor
authorSlava Pestov <slava@factorcode.org>
Wed, 6 Apr 2011 21:26:41 +0000 (17:26 -0400)
committerSlava Pestov <slava@factorcode.org>
Wed, 6 Apr 2011 21:26:41 +0000 (17:26 -0400)
31 files changed:
basis/alien/c-types/c-types-docs.factor
basis/alien/c-types/c-types.factor
basis/combinators/smart/smart-docs.factor
basis/db/sqlite/sqlite.factor
basis/db/tuples/tuples-docs.factor
basis/help/apropos/apropos.factor
basis/help/markup/markup.factor
basis/regexp/regexp-docs.factor
basis/ui/tools/tools.factor
basis/xml/writer/writer-docs.factor
core/io/io-docs.factor
core/io/io.factor
core/kernel/kernel-docs.factor
core/make/make-docs.factor
extra/calendar/holidays/holidays.factor
extra/calendar/holidays/us/us.factor
extra/images/http/http.factor
extra/infix/ast/ast.factor
extra/infix/infix-docs.factor
extra/infix/infix-tests.factor
extra/infix/infix.factor
extra/infix/parser/parser.factor
extra/infix/tokenizer/tokenizer.factor
extra/openal/openal.factor
extra/webapps/imagebin/imagebin.factor
misc/factor.vim.fgen
misc/vim/README [deleted file]
misc/vim/README.md [new file with mode: 0644]
misc/vim/plugin/factor.vim
misc/vim/syntax/factor.vim
readme.html

index e14a5cb5e10ca7bbc9c2b28abff040ec029e905a..dc1754a1497a6cd3e08982b53ed52d7f80948368 100644 (file)
@@ -21,7 +21,7 @@ HELP: <c-type>
 HELP: no-c-type
 { $values { "name" c-type-name } }
 { $description "Throws a " { $link no-c-type } " error." }
-{ $error-description "Thrown by " { $link c-type } " if a given string does not name a C type. When thrown during compile time, indicates a typo in an " { $link alien-invoke } " or " { $link alien-callback } " form." } ;
+{ $error-description "Thrown by " { $link c-type } " if a given word is not a C type." } ;
 
 HELP: c-type
 { $values { "name" c-type-name } { "c-type" c-type } }
index 19103ce3a8b55128b690b68f068b92919b49e587..48f608037bebab70cf95a6ed9b1f11f0188ff9b0 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors alien alien.accessors arrays byte-arrays
 classes combinators compiler.units cpu.architecture delegate
 fry kernel layouts locals macros math math.order quotations
-sequences system words words.symbol ;
+sequences system words words.symbol summary ;
 QUALIFIED: math
 IN: alien.c-types
 
@@ -37,7 +37,9 @@ unboxer
 : <c-type> ( -- c-type )
     \ c-type new ; inline
 
-ERROR: no-c-type name ;
+ERROR: no-c-type word ;
+
+M: no-c-type summary drop "Not a C type" ;
 
 ! C type protocol
 GENERIC: c-type ( name -- c-type ) foldable
index cdd2744888098932ddd2a9adc78d28ea5c912b67..bc7b88a0fc5753ea9b311ee82b0a89edc191a287 100644 (file)
@@ -23,7 +23,7 @@ HELP: output>array
      { "quot" quotation }
      { "newquot" quotation }
 }
-{ $description "Infers the number or outputs from the quotation and constructs an array from those outputs." }
+{ $description "Infers the number of outputs from the quotation and constructs an array from those outputs." }
 { $examples
     { $example
         "USING: combinators combinators.smart math prettyprint ;
index 8d26d3b098c185a2fdcb5bf016c865dcd6a81bf4..e09d7fbc47a773438784c74d8079481458d44774 100644 (file)
@@ -126,7 +126,7 @@ M: sqlite-statement query-results ( query -- result-set )
     dup handle>> sqlite-result-set new-result-set
     dup advance-row ;
 
-M: sqlite-db-connection <insert-db-assigned-statement> ( tuple -- statement )
+M: sqlite-db-connection <insert-db-assigned-statement> ( class -- statement )
     [
         "insert into " 0% 0%
         "(" 0%
@@ -147,7 +147,7 @@ M: sqlite-db-connection <insert-db-assigned-statement> ( tuple -- statement )
         ");" 0%
     ] query-make ;
 
-M: sqlite-db-connection <insert-user-assigned-statement> ( tuple -- statement )
+M: sqlite-db-connection <insert-user-assigned-statement> ( class -- statement )
     <insert-db-assigned-statement> ;
 
 M: sqlite-db-connection bind# ( spec obj -- )
index 36e6b4bf2cd4e3c4cc8b59965fe723cab049a2b6..50f60d8adb29aca8e6dcd351a02550a6d5fa080a 100644 (file)
@@ -139,7 +139,7 @@ HELP: select-tuples
 { $values
      { "query/tuple" tuple }
      { "tuples" "an array of tuples" } }
-{ $description "A SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns a multiple tuples from the database that match the query constructed from the exemplar tuple." } ;
+{ $description "A SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns an array of multiple tuples from the database that match the query constructed from the exemplar tuple." } ;
 
 HELP: count-tuples
 { $values
index 933761871d6af6d63d99d73cd82a918f3c10a589..9377f0a656c464d919bc5d2e4b1b2b0bcf3dd5fd 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays assocs fry help.markup help.topics io
 kernel make math math.parser namespaces sequences sorting
 summary tools.completion vocabs.hierarchy help.vocabs
-vocabs words unicode.case help ;
+vocabs words unicode.case help unicode.categories ;
 IN: help.apropos
 
 : $completions ( seq -- )
@@ -71,4 +71,4 @@ M: apropos >link ;
 INSTANCE: apropos topic
 
 : apropos ( str -- )
-    <apropos> print-topic nl ;
+    [ blank? ] trim <apropos> print-topic nl ;
index ce954eae986a0249cfa7a8ffce8d0690a1c905a8..8e0c423b590a9710a9202f5fcd2bdbddc7eebc1e 100644 (file)
@@ -5,8 +5,8 @@ combinators combinators.smart definitions definitions.icons effects
 fry generic hashtables help.stylesheet help.topics io io.styles
 kernel make math namespaces parser present prettyprint
 prettyprint.stylesheet quotations see sequences sets slots
-sorting splitting strings vectors vocabs vocabs.loader words
-words.symbol ;
+sorting splitting strings urls vectors vocabs vocabs.loader
+words words.symbol ;
 FROM: prettyprint.sections => with-pprint ;
 FROM: namespaces => set ;
 IN: help.markup
@@ -76,9 +76,9 @@ ALIAS: $slot $snippet
     [ strong-style get print-element* ] ($span) ;
 
 : $url ( children -- )
-    [
-        dup first href associate url-style get assoc-union
-        print-element*
+    first dup >url [
+        dup present href associate url-style get assoc-union
+        [ write-object ] with-style
     ] ($span) ;
 
 : $nl ( children -- )
index 4fcea94cf2c57763a02fa5e828c7bd4a001b9357..2b8e3e420a5b236ff7e288d929e0b937aebf4be3 100644 (file)
@@ -113,7 +113,7 @@ ARTICLE: { "regexp" "syntax" } "Regular expression syntax"
 "To make it convenient to have a long string which uses regexp operators, a special syntax is provided. If a substring begins with " { $snippet "\\Q" } " then everything until " { $snippet "\\E" } " is quoted (escaped). For example, " { $snippet "R/ \\Qfoo\\bar|baz()\\E/" } " matches exactly the string " { $snippet "\"foo\\bar|baz()\"" } "."
 { $heading "Unsupported features" }
 { $subheading "Group capture" }
-{ $subheading "Reluctant and posessive quantifiers" }
+{ $subheading "Reluctant and possessive quantifiers" }
 { $subheading "Backreferences" }
 "Backreferences were omitted because of a design decision to allow only regular expressions following the formal theory of regular languages. For more information, see " { $link { "regexp" "theory" } } "."
 $nl
index 1b5fcb50c43a9f86ac3f1f0526d7d911ffcddea7..eddcf0dd4142f90206ffffccf7f2301e40b585a8 100644 (file)
@@ -24,7 +24,8 @@ tool "tool-switching" f {
 
 tool "common" f {
     { T{ key-down f { A+ } "w" } close-window }
+    { T{ key-down f { A+ } "F" } toggle-fullscreen }
     { T{ key-down f { A+ } "q" } com-exit }
     { T{ key-down f f "F2" } refresh-all }
     { T{ key-down f f "F3" } show-error-list }
-} define-command-map
\ No newline at end of file
+} define-command-map
index 17d9880bb3391643817f56b588638a32ab1f1604..5b66b021bd26c02abdd3d9f8f754be7b09a1ab81 100644 (file)
@@ -30,17 +30,17 @@ HELP: xml>string
 
 HELP: pprint-xml>string
 { $values { "xml" "an XML document" } { "string" "a string" } }
-{ $description "converts an XML document into a string in a prettyprinted form." }
+{ $description "Converts an XML document into a string in a prettyprinted form." }
 { $notes "This does not preserve what type of quotes were used or what data was omitted from version declaration, as that information isn't present in the XML data representation. The whitespace in the text nodes of the original document is preserved." } ;
 
 HELP: write-xml
 { $values { "xml" "an XML document" } }
-{ $description "prints the contents of an XML document to " { $link output-stream } "." }
+{ $description "Prints the contents of an XML document to " { $link output-stream } "." }
 { $notes "This does not preserve what type of quotes were used or what data was omitted from version declaration, as that information isn't present in the XML data representation. The whitespace in the text nodes of the original document is preserved." } ;
 
 HELP: pprint-xml
 { $values { "xml" "an XML document" } }
-{ $description "prints the contents of an XML document to " { $link output-stream } " in a prettyprinted form." }
+{ $description "Prints the contents of an XML document to " { $link output-stream } " in a prettyprinted form." }
 { $notes "This does not preserve what type of quotes were used or what data was omitted from version declaration, as that information isn't present in the XML data representation. Whitespace is also not preserved." } ;
 
 { xml>string write-xml pprint-xml pprint-xml>string } related-words
index 86f27f5186ec4172626a56c621b2ecb5c9a44655..ef64896dfb3e12665bc58d85823a7ad1707608c9 100644 (file)
@@ -245,11 +245,11 @@ HELP: lines
 { $description "Reads lines of text until from the " { $link input-stream } " until it is exhausted, collecting them in a sequence of strings." } ;
 
 HELP: each-line
-{ $values { "quot" { $quotation "( str -- )" } } }
+{ $values { "quot" { $quotation "( ... line -- ... )" } } }
 { $description "Calls the quotation with successive lines of text, until the current " { $link input-stream } " is exhausted." } ;
 
 HELP: each-block
-{ $values { "quot" { $quotation "( block -- )" } } }
+{ $values { "quot" { $quotation "( ... block -- ... )" } } }
 { $description "Calls the quotation with successive blocks of data, until the current " { $link input-stream } " is exhausted." } ;
 
 HELP: stream-contents
index ea37c13dd7cb00b9ad7ba4347a67ef0cd981ff00..a4b93f3f8239b612ad603a89582e6e32ba164aeb 100644 (file)
@@ -90,10 +90,10 @@ SYMBOL: error-stream
 
 PRIVATE>
 
-: each-stream-line ( stream quot -- )
+: each-stream-line ( ... stream quot: ( ... line -- ... ) -- ... )
     swap [ stream-readln ] curry each-morsel ; inline
 
-: each-line ( quot -- )
+: each-line ( ... quot: ( ... line -- ... ) -- ... )
     input-stream get swap each-stream-line ; inline
 
 : stream-lines ( stream -- seq )
@@ -102,21 +102,21 @@ PRIVATE>
 : lines ( -- seq )
     input-stream get stream-lines ; inline
 
+: each-stream-block ( ... stream quot: ( ... block -- ... ) -- ... )
+    swap 65536 swap [ stream-read-partial ] 2curry each-morsel ; inline
+
+: each-block ( ... quot: ( ... block -- ... ) -- ... )
+    input-stream get swap each-stream-block ; inline
+
 : stream-contents ( stream -- seq )
     [
-        [ [ 65536 swap stream-read-partial dup ] curry [ ] produce nip ]
+        [ [ ] collector [ each-stream-block ] dip { } like ]
         [ stream-element-exemplar concat-as ] bi
     ] with-disposal ;
 
 : contents ( -- seq )
     input-stream get stream-contents ; inline
 
-: each-stream-block ( stream quot: ( block -- ) -- )
-    swap [ 8192 swap stream-read-partial ] curry each-morsel ; inline
-
-: each-block ( quot: ( block -- ) -- )
-    input-stream get swap each-stream-block ; inline
-
 : stream-copy ( in out -- )
     [ [ [ write ] each-block ] with-output-stream ]
     curry with-input-stream ;
index 98b60b1238be3be96bebb16e40c375997bd60ef9..1fbd7c64dccd36a7a86105e5198a4c79db97bdb5 100644 (file)
@@ -582,7 +582,8 @@ $nl
         "10 3 < [ \"Math is broken\" print ] [ \"Math is good\" print ] if"
         "Math is good"
     }
-} ;
+}
+{ $notes { $snippet "if" } " is executed as a primitive when preceded by two literal quotations. The below definition is not executed unless one of its arguments is a non-literal quotation, such as a quotation constructed with " { $link curry } " or " { $link compose } ", or for " { $link "fry" } " or quotations including " { $link "locals" } "." } ;
 
 HELP: when
 { $values { "?" "a generalized boolean" } { "true" quotation } }
@@ -795,7 +796,8 @@ HELP: dip
 { $description "Removes " { $snippet "x" } " from the datastack, calls " { $snippet "quot" } ", and restores " { $snippet "x" } " to the top of the datastack when " { $snippet "quot" } " is finished." }
 { $examples
     { $example "USING: arrays kernel math prettyprint ;" "10 20 30 [ / ] dip 2array ." "{ 1/2 30 }" }
-} ;
+}
+{ $notes { $snippet "dip" } " is executed as a primitive when preceded by a literal quotation. The below definition is not executed unless its argument is a non-literal quotation, such as a quotation constructed with " { $link curry } " or " { $link compose } ", or for " { $link "fry" } " or quotations including " { $link "locals" } "." } ;
 
 HELP: 2dip
 { $values { "x" object } { "y" object } { "quot" quotation } }
index 2cbf82ae33228312c16a45a99588dd644903a8a0..2a74af7049bbe4be9ac69a9503d3c8c16d028234 100644 (file)
@@ -37,7 +37,7 @@ $nl
 { $code "'[ 2 _ + ]" } ;
 
 ARTICLE: "namespaces-make" "Making sequences with variables"
-"The " { $vocab-link "make" } " vocabulary implements a facility for constructing sequences by holding an collector sequence in a variable. Storing the collector sequence in a variable rather than the stack may allow code to be written with less stack manipulation."
+"The " { $vocab-link "make" } " vocabulary implements a facility for constructing sequences by holding a collector sequence in a variable. Storing the collector sequence in a variable rather than the stack may allow code to be written with less stack manipulation."
 $nl
 "Sequence construction is wrapped in a combinator:"
 { $subsections make }
index 0b8a1bb781d4e94cf7954014502f439f496182b7..7a87a1df45a26d7c7c25d25f65288b12cc1692f9 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs calendar fry kernel parser sequences
-shuffle vocabs words memoize ;
+USING: accessors assocs calendar fry kernel locals parser 
+sequences vocabs words memoize ;
 IN: calendar.holidays
 
 SINGLETONS: all world commonwealth-of-nations ;
@@ -15,7 +15,8 @@ SYNTAX: HOLIDAY:
     parse-definition (( timestamp/n -- timestamp )) define-declared ;
 
 SYNTAX: HOLIDAY-NAME:
-    scan-word "holiday" word-prop scan-word scan-object spin set-at ;
+    [let scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value
+    value name holidays set-at ] ;
 >>
 
 GENERIC: holidays ( n singleton -- seq )
index 538836952f339fd842262eb8d12bc8598867083a..87c367f941bd9cfa1db032aa0e0baa7254d6d19a 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs calendar calendar.holidays
 calendar.holidays.private combinators combinators.short-circuit
-fry kernel lexer math namespaces parser sequences shuffle
+fry kernel lexer math namespaces parser sequences 
 vocabs words ;
 IN: calendar.holidays.us
 
index 217c8408d1028ff2f2e7aec035c42e80d111abdb..a4c064619c93d179c750996fac3cc060866318ad 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs http.client images.loader
 images.loader.private images.viewer io.pathnames kernel
-namespaces sequences ;
+namespaces present sequences ;
 IN: images.http
 
 <PRIVATE
@@ -14,7 +14,8 @@ IN: images.http
 PRIVATE>
 
 : load-http-image ( path -- image )
-    [ http-get swap content-type ] [ file-extension ] bi or
+    [ http-get swap content-type ]
+    [ present file-extension ] bi or
     (image-class) load-image* ;
 
 : http-image. ( path -- )
index 1908b3d39bc54af20633d9b22b08e8dc9ab22dcd..ef5bed35d6dcea147bfd5afd2eec7bc90343965b 100644 (file)
@@ -5,6 +5,7 @@ IN: infix.ast
 TUPLE: ast-number value ;
 TUPLE: ast-local name ;
 TUPLE: ast-array name index ;
+TUPLE: ast-slice name from to ;
 TUPLE: ast-function name arguments ;
 TUPLE: ast-op left right op ;
 TUPLE: ast-negation term ;
index 3885fcc6134aeb8c770cf33e05dc8ecc8d1b8afa..52df131b0ede467b76f781e62a60e14d69cea16f 100644 (file)
@@ -65,6 +65,13 @@ $nl
     "[let { 1 2 3 4 } :> myarr [infix myarr[4/2]*3 infix] ] ."
     "9"
 }
+$nl
+"You can create sub-" { $vocab-link "sequences" } " inside infix expressions using " { $snippet "arr[from:to]" } " notation."
+{ $example
+    "USING: arrays locals infix ;"
+    "[let \"foobar\" :> s [infix s[0:3] infix] ] ."
+    "\"foo\""
+}
 ;
 
 ABOUT: "infix"
index c2b0d9d7b4474b357a8d03820942bb4879d144fb..79e077f2acf1d2b80e264e2f7ed13c84221ef94b 100644 (file)
@@ -32,3 +32,13 @@ IN: infix.tests
 [ 10 ] [ [infix stupid_function (0, 1, 2, 3, 4) infix] ] unit-test
 
 [ -1 ] [ [let 1 :> a [infix -a infix] ] ] unit-test
+
+[ CHAR: f ] [ [let "foo" :> s [infix s[0] infix] ] ] unit-test
+[ CHAR: r ] [ [let "bar" :> s [infix s[-1] infix] ] ] unit-test
+[ "foo" ] [ [let "foobar" :> s [infix s[0:3] infix] ] ] unit-test
+[ "foo" ] [ [let "foobar" :> s [infix s[:3] infix] ] ] unit-test
+[ "bar" ] [ [let "foobar" :> s [infix s[-3:] infix] ] ] unit-test
+[ "foobar" ] [ [let "foobar" :> s [infix s[:] infix] ] ] unit-test
+[ "bar" ] [ [let "foobar" :> s [infix s[-3:100] infix] ] ] unit-test
+[ "foobar" ] [ [let "foobar" :> s [infix s[-100:100] infix] ] ] unit-test
+
index 48ac35264b2081eb302d5c9624a20e1304a57537..1945b2e9065080a654120271c42459ac1f3d8f28 100644 (file)
@@ -1,9 +1,10 @@
 ! Copyright (C) 2009 Philipp Brüschweiler
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators combinators.short-circuit
-effects fry infix.parser infix.ast kernel locals.parser
-locals.types math multiline namespaces parser quotations
-sequences summary words vocabs.parser ;
+effects fry infix.parser infix.ast kernel locals locals.parser
+locals.types math math.order multiline namespaces parser
+quotations sequences summary words vocabs.parser ;
+
 IN: infix
 
 <PRIVATE
@@ -33,9 +34,23 @@ M: ast-number infix-codegen value>> ;
 M: ast-local infix-codegen
     name>> >local-word ;
 
+:: infix-nth ( n seq -- elt )
+    n dup 0 < [ seq length + ] when seq nth ;
+
 M: ast-array infix-codegen
     [ index>> infix-codegen prepare-operand ]
-    [ name>> >local-word ] bi '[ @ _ nth ] ;
+    [ name>> >local-word ] bi '[ @ _ infix-nth ] ;
+
+:: infix-subseq ( from to seq -- subseq )
+    seq length :> len
+    from 0 or dup 0 < [ len + ] when
+    to [ dup 0 < [ len + ] when ] [ len ] if*
+    [ 0 len clamp ] bi@ dupd max seq subseq ;
+
+M: ast-slice infix-codegen
+    [ from>> [ infix-codegen prepare-operand ] [ [ f ] ] if* ]
+    [ to>> [ infix-codegen prepare-operand ] [ [ f ] ] if* ]
+    [ name>> >local-word ] tri '[ @ @ _ infix-subseq ] ;
 
 M: ast-op infix-codegen
     [ left>> infix-codegen ] [ right>> infix-codegen ]
index 2f9ab03d18b9925e8cf17ff323245da2a3aa6ee6..ca1570e1119588d9ada08b4db1e5b12b8d4495a6 100644 (file)
@@ -8,6 +8,7 @@ EBNF: parse-infix
 Number      = . ?[ ast-number? ]?
 Identifier  = . ?[ string? ]?
 Array       = Identifier:i "[" Sum:s "]" => [[ i s ast-array boa ]]
+Slice       = Identifier:i "[" Sum?:s ":" Sum?:t "]" => [[ i s t ast-slice boa ]]
 Function    = Identifier:i "(" FunArgs?:a ")" => [[ i a [ V{ } ] unless* ast-function boa ]]
 
 FunArgs     =   FunArgs:a "," Sum:s => [[ s a push a ]]
@@ -15,7 +16,7 @@ FunArgs     =   FunArgs:a "," Sum:s => [[ s a push a ]]
 
 Terminal    =   ("-"|"+"):op Terminal:term => [[ term op "-" = [ ast-negation boa ] when ]]
               | "(" Sum:s ")" => [[ s ]]
-              | Number | Array | Function
+              | Number | Array | Slice | Function
               | Identifier => [[ ast-local boa ]]
 
 Product     =   Product:p ("*"|"/"|"%"):op Terminal:term  => [[ p term op ast-op boa ]]
index f5bce4b6d7270e860c4001f83a90bc0a2a3d0bc6..7bf1bddcd4cf80b517c6041bb683d6719e79c51c 100644 (file)
@@ -17,6 +17,7 @@ NameRest          = NameFirst | Digit
 Name              = NameFirst NameRest* => [[ first2 swap prefix >string ]]
 Special           =   [+*/%(),] | "-" => [[ CHAR: - ]]
                     | "[" => [[ CHAR: [ ]] | "]" => [[ CHAR: ] ]]
+                    | ":" => [[ CHAR: : ]]
 Tok               = Spaces (Name | Number | Special )
 End               = !(.)
 Toks              = Tok* Spaces End
index 8f2d77b1e41f1ff75d5d227f959992211d1e545b..5ce7a5b9909697bfb2ee23945a57247c8e498cb0 100755 (executable)
@@ -17,7 +17,7 @@ IN: openal
         { [ os unix?  ]  [ "libopenal.so" ] }
     } cond cdecl add-library >>
 
-<< os macosx? [ "openal" deploy-library ] unless >>
+<< os unix? [ "openal" deploy-library ] unless >>
 
 LIBRARY: openal
 
index bb8720466caa8f62e368a155f291ac05de1b495d..24cd92ca2a7cdcd2db3b8beec2e5ca574314c09a 100644 (file)
@@ -3,7 +3,8 @@
 USING: accessors furnace.actions furnace.redirection
 html.forms http http.server http.server.dispatchers
 io.directories io.encodings.utf8 io.files io.pathnames
-kernel math.parser multiline namespaces sequences urls ;
+kernel math.parser multiline namespaces sequences urls 
+math ;
 IN: webapps.imagebin
 
 TUPLE: imagebin < dispatcher path n ;
@@ -14,13 +15,13 @@ TUPLE: imagebin < dispatcher path n ;
 
 : next-image-path ( -- path )
     imagebin get
-    [ path>> ] [ n>> number>string ] bi append-path ; 
+    [ path>> ] [ [ 1 + ] change-n n>> number>string ] bi append-path ; 
 
 M: imagebin call-responder*
     [ imagebin set ] [ call-next-method ] bi ;
 
 : move-image ( mime-file -- )
-    next-image-path
+    [ next-image-path dup exists? ] [ drop ] while
     [ [ temporary-path>> ] dip move-file ]
     [ [ filename>> ] dip ".txt" append utf8 set-file-contents ] 2bi ;
 
index 42f150ac34b1a98e4b9b648148ee76e732324de8..7dcf59142d660f4033d765e1aa5e1f2411d7c22a 100644 (file)
@@ -10,10 +10,10 @@ IN: factor.vim.fgen
 
 %>
 " Vim syntax file
-" Language: factor
+" Language: Factor
 " Maintainer: Alex Chapman <chapman.alex@gmail.com>
-" Last Change: 2009 May 19
-" To run: USE: html.templates.fhtml "resource:misc/factor.vim.fgen" <fhtml> call-template
+" Last Change: 2011 Mar 21
+" To run: USING: html.templates html.templates.fhtml ; "resource:misc/factor.vim.fgen" <fhtml> call-template
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
@@ -33,11 +33,13 @@ else
     set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
 endif
 
-syn cluster factorCluster contains=factorComment,factorFryDirective,factorKeyword,factorRepeat,factorConditional,factorBoolean,factorCompileDirective,factorString,factorTriString,factorSbuf,@factorNumber,@factorNumErr,factorDelimiter,factorChar,factorBackslash,factorLiteral,factorLiteralBlock,@factorWordOps,factorAlien,factorTuple,factorStruct
+syn cluster factorCluster contains=factorComment,factorFrySpecifier,factorKeyword,factorRepeat,factorConditional,factorBoolean,factorBreakpoint,factorDeclaration,factorCallQuotation,factorExecute,factorCallNextMethod,factorString,factorTriString,factorSbuf,@factorNumber,@factorNumErr,factorDelimiter,factorChar,factorBackslash,factorLiteral,factorLiteralBlock,@factorWordOps,factorAlien,factorSlot,factorTuple,factorError,factorStruct
 
 syn match factorTodo /\(TODO\|FIXME\|XXX\):\=/ contained
-syn match factorComment /\<#!\>.*/ contains=factorTodo
-syn match factorComment /\<!\>.*/ contains=factorTodo
+syn match factorComment /\<!\>\s.*/ contains=factorTodo,@Spell
+syn match factorComment /\<#!\>\s.*/ contains=factorTodo,@Spell
+syn match factorShebang /\%\^#!\s.*/ display
+syn match factorShebangErr /\%\^#!\S\+/
 
 syn cluster factorDefnContents contains=@factorCluster,factorStackEffect,factorLiteralStackEffect,factorArray0,factorQuotation0
 
@@ -55,8 +57,12 @@ syn region None matchgroup=factorPrivate start=/\<<PRIVATE\>/ end=/\<PRIVATE>\>/
 
 
 syn keyword factorBoolean f t
-syn match factorFryDirective /\<\(@\|_\)\>/ contained
-syn keyword factorCompileDirective inline foldable recursive
+syn keyword factorBreakpoint B
+syn keyword factorFrySpecifier @ _ contained
+syn keyword factorDeclaration delimiter deprecated final flushable foldable inline recursive
+syn match factorCallQuotation /\<call(\s\(.*\s\)\?--\(\s.*\)\?\s)\>/
+syn match factorExecute /\<execute(\s\(.*\s\)\?--\(\s.*\)\?\s)\>/
+syn keyword factorCallNextMethod call-next-method
 
 <%
 
@@ -101,16 +107,21 @@ syn region  factorLiteralBlock  start=/\<\$\[\>/ end=/\<\]\>/
 syn region  factorUsing         start=/\<USING:\>/       end=/;/
 syn match   factorQualified     /\<QUALIFIED:\s\+\S\+\>/
 syn match   factorQualifiedWith /\<QUALIFIED-WITH:\s\+\S\+\s\+\S\+\>/
+syn region  factorExclude       start=/\<EXCLUDE:\>/     end=/;/
 syn region  factorFrom          start=/\<FROM:\>/        end=/;/
+syn match   factorRename        /\<RENAME:\s\+\S\+\s\+\S\+\s=>\s\+\S\+\>/
 syn region  factorSingletons    start=/\<SINGLETONS:\>/  end=/;/
 syn match   factorSymbol        /\<SYMBOL:\s\+\S\+\>/
 syn region  factorSymbols       start=/\<SYMBOLS:\>/     end=/;/
 syn region  factorConstructor2  start=/\<CONSTRUCTOR:\?/ end=/;/
+syn region  factorIntersection  start=/\<INTERSECTION:\>/ end=/\<;\>/
 syn region  factorTuple         start=/\<TUPLE:\>/ end=/\<;\>/
+syn region  factorError         start=/\<ERROR:\>/ end=/\<;\>/
+syn region  factorUnion         start=/\<UNION:\>/ end=/\<;\>/
 syn region  factorStruct        start=/\<\(UNION-STRUCT:\|STRUCT:\)\>/ end=/\<;\>/
 
 syn match   factorConstant      /\<CONSTANT:\s\+\S\+\>/
-syn match   factorAlias         /\<ALIAS:\s\+\S\+\>/
+syn match   factorAlias         /\<ALIAS:\s\+\S\+\s\+\S\+\>/
 syn match   factorSingleton     /\<SINGLETON:\s\+\S\+\>/
 syn match   factorPostpone      /\<POSTPONE:\s\+\S\+\>/
 syn match   factorDefer         /\<DEFER:\s\+\S\+\>/
@@ -121,6 +132,7 @@ syn match   factorHook          /\<HOOK:\s\+\S\+\s\+\S\+\>/
 syn match   factorMain          /\<MAIN:\s\+\S\+\>/
 syn match   factorConstructor   /\<C:\s\+\S\+\s\+\S\+\>/
 syn match   factorAlien         /\<ALIEN:\s\+[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\>/
+syn match   factorSlot          /\<SLOT:\s\+\S\+\>/
 
 syn cluster factorWordOps       contains=factorConstant,factorAlias,factorSingleton,factorSingletons,factorSymbol,factorSymbols,factorPostpone,factorDefer,factorForget,factorMixin,factorInstance,factorHook,factorMain,factorConstructor
 
@@ -138,9 +150,10 @@ syn cluster factorWordOps       contains=factorConstant,factorAlias,factorSingle
 " LIBRARY:
 "#\ "
 
-syn region factorString start=/\<"/ skip=/\\"/ end=/"/
-syn region factorTriString start=/\<"""/ skip=/\\"/ end=/"""/
-syn region factorSbuf start=/\<SBUF"\>/ skip=/\\"/ end=/"/
+syn match factorEscape /\\\([\\stnr0e\"]\|u\x\{6}\|u{\S\+}\)/ contained display
+syn region factorString start=/\<"/ skip=/\\"/ end=/"/ contains=factorEscape
+syn region factorTriString start=/\<"""/ skip=/\\"/ end=/"""/ contains=factorEscape
+syn region factorSbuf start=/\<[-a-zA-Z0-9]\+"\>/ skip=/\\"/ end=/"/
 
 syn region factorMultiString matchgroup=factorMultiStringDelims start=/\<STRING:\s\+\S\+\>/ end=/^;$/ contains=factorMultiStringContents
 syn match factorMultiStringContents /.*/ contained
@@ -148,14 +161,14 @@ syn match factorMultiStringContents /.*/ contained
 "syn match factorStackEffectErr /\<)\>/
 "syn region factorStackEffectErr start=/\<(\>/ end=/\<)\>/
 "syn region factorStackEffect start=/\<(\>/ end=/\<)\>/ contained
-syn match factorStackEffect /\<( .*--.* )\>/ contained
-syn match factorLiteralStackEffect /\<(( .*--.* ))\>/
+syn match factorStackEffect /\<(\s\(.*\s\)\?--\(\s.*\)\?\s)\>/ contained
+syn match factorLiteralStackEffect /\<((\s\(.*\s\)\?--\(\s.*\)\?\s))\>/
 
 "adapted from lisp.vim
-if exists("g:factor_norainbow") 
+if exists("g:factor_norainbow")
     syn region factorQuotation matchgroup=factorDelimiter start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ matchgroup=factorDelimiter end=/\<\]\>/ contains=ALL
 else
-    syn region factorQuotation0           matchgroup=hlLevel0 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation1,factorArray1
+    syn region factorQuotation0           matchgroup=hlLevel0 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation1,factorArray1
     syn region factorQuotation1 contained matchgroup=hlLevel1 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation2,factorArray2
     syn region factorQuotation2 contained matchgroup=hlLevel2 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation3,factorArray3
     syn region factorQuotation3 contained matchgroup=hlLevel3 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation4,factorArray4
@@ -167,7 +180,7 @@ else
     syn region factorQuotation9 contained matchgroup=hlLevel9 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation0,factorArray0
 endif
 
-if exists("g:factor_norainbow") 
+if exists("g:factor_norainbow")
     syn region factorArray    matchgroup=factorDelimiter start=/\<\(\$\|[-a-zA-Z0-9]\+\)\?{\>/  matchgroup=factorDelimiter end=/\<}\>/ contains=ALL
 else
     syn region factorArray0           matchgroup=hlLevel0 start=/\<\(\$\|[-a-zA-Z0-9]\+\)\?{\>/ end=/\<}\>/ contains=@factorCluster,factorArray1,factorQuotation1
@@ -196,6 +209,8 @@ if version >= 508 || !exists("did_factor_syn_inits")
     endif
 
     HiLink factorComment                Comment
+    HiLink factorShebang                PreProc
+    HiLink factorShebangErr             Error
     HiLink factorStackEffect            Typedef
     HiLink factorLiteralStackEffect     Typedef
     HiLink factorTodo                   Todo
@@ -203,9 +218,13 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorRepeat                 Repeat
     HiLink factorConditional            Conditional
     HiLink factorKeyword                Keyword
+    HiLink factorCallQuotation          Keyword
+    HiLink factorExecute                Keyword
+    HiLink factorCallNextMethod         Keyword
     HiLink factorOperator               Operator
-    HiLink factorFryDirective           Operator
+    HiLink factorFrySpecifier           Operator
     HiLink factorBoolean                Boolean
+    HiLink factorBreakpoint             Debug
     HiLink factorDefnDelims             Typedef
     HiLink factorMethodDelims           Typedef
     HiLink factorGenericDelims          Typedef
@@ -217,6 +236,7 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorPrivateMethodDelims    Special
     HiLink factorPGenericDelims         Special
     HiLink factorPGenericNDelims        Special
+    HiLink factorEscape                 SpecialChar
     HiLink factorString                 String
     HiLink factorTriString              String
     HiLink factorSbuf                   String
@@ -237,7 +257,9 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorUsing                  Include
     HiLink factorQualified              Include
     HiLink factorQualifiedWith          Include
+    HiLink factorExclude                Include
     HiLink factorFrom                   Include
+    HiLink factorRename                 Include
     HiLink factorUse                    Include
     HiLink factorUnuse                  Include
     HiLink factorIn                     Define
@@ -246,9 +268,11 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorBackslash              Special
     HiLink factorLiteral                Special
     HiLink factorLiteralBlock           Special
-    HiLink factorCompileDirective       Typedef
+    HiLink factorDeclaration            Typedef
     HiLink factorSymbol                 Define
+    HiLink factorSymbols                Define
     HiLink factorConstant               Define
+    HiLink factorAlias                  Define
     HiLink factorSingleton              Define
     HiLink factorSingletons             Define
     HiLink factorMixin                  Typedef
@@ -259,7 +283,11 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorDefer                  Define
     HiLink factorForget                 Define
     HiLink factorAlien                  Define
+    HiLink factorSlot                   Define
+    HiLink factorIntersection           Typedef
     HiLink factorTuple                  Typedef
+    HiLink factorError                  Typedef
+    HiLink factorUnion                  Typedef
     HiLink factorStruct                 Typedef
 
     if &bg == "dark"
@@ -291,9 +319,4 @@ endif
 
 let b:current_syntax = "factor"
 
-set sw=4
-set sts=4
-set expandtab
-set autoindent " annoying?
-
-" vim: syntax=vim
+" vim:set ft=vim sw=4:
diff --git a/misc/vim/README b/misc/vim/README
deleted file mode 100644 (file)
index db7e4f0..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-Vim support for Factor
-----------------------
-
-This directory contains various support files that make editing Factor code
-more pleasant in Vim. The file-layout exactly matches the Vim runtime
-structure, so you can install them by copying the contents of this directory
-into ~/.vim/ or the equivalent path on other platforms (Open Vim and type
-":help 'runtimepath'" for details).
-
-The current set of files is as follows:
-
-    ftdetect/factor.vim
-       Teach Vim when to load Factor support files.
-    ftplugin/factor_settings.vim
-       Teach Vim to follow the Factor Coding Style guidelines.
-    plugin/factor.vim
-       Teach Vim some commands for navigating Factor source code. See below.
-    syntax/factor.vim
-        Syntax highlighting for Factor code.
-
-The "plugin/factor.vim" file implements the following commands for
-navigating Factor source:
-
-    :FactorVocab factor.vocab.name
-        Opens the source file implementing the "factor.vocab.name"
-        vocabulary.
-    :NewFactorVocab factor.vocab.name
-        Creates a new factor vocabulary under the working vocabulary root.
-    :FactorVocabImpl
-        Opens the main implementation file for the current vocabulary
-        (name.factor).  The keyboard shortcut "\fi" is bound to this
-        command.
-    :FactorVocabDocs
-        Opens the documentation file for the current vocabulary
-        (name-docs.factor).  The keyboard shortcut "\fd" is bound to this
-        command.
-    :FactorVocabTests
-        Opens the unit test file for the current vocabulary
-        (name-tests.factor).  The keyboard shortcut "\ft" is bound to this
-        command.
-
-In order for the ":FactorVocab" command to work, you'll need to set some
-variables in your vimrc file:
-    g:FactorRoot
-        This variable should be set to the root of your Factor
-        installation. The default value is "~/factor".
-    g:FactorVocabRoots
-        This variable should be set to a list of Factor vocabulary roots.
-        The paths may be either relative to g:FactorRoot or absolute paths.
-        The default value is ["core", "basis", "extra", "work"].
-    g:FactorNewVocabRoot
-        This variable should be set to the vocabulary root in which
-        vocabularies created with NewFactorVocab should be created. The
-        default value is "work".
-
-Note: The syntax-highlighting file is automatically generated to include the
-names of all the vocabularies Factor knows about. To regenerate it manually,
-run the following code in the listener:
-
-    "editors.vim.generate-syntax" run
-
-...or run it from the command line:
-
-    factor -run=editors.vim.generate-syntax
diff --git a/misc/vim/README.md b/misc/vim/README.md
new file mode 100644 (file)
index 0000000..e75d02a
--- /dev/null
@@ -0,0 +1,81 @@
+Vim support for Factor
+======================
+
+This directory contains various support files that make editing Factor code
+more pleasant in Vim.
+
+## Installation
+
+The file-layout exactly matches the Vim runtime
+structure, so you can install them by copying the contents of this directory
+into `~/.vim/` or the equivalent path on other platforms (Open Vim and type
+`:help 'runtimepath'` for details).
+
+## File organization
+
+The current set of files is as follows:
+
+* ftdetect/factor.vim - Teach Vim when to load Factor support files.
+* ftplugin/factor_settings.vim - Teach Vim to follow the Factor Coding Style guidelines.
+* plugin/factor.vim - Teach Vim some commands for navigating Factor source code. See below.
+* syntax/factor.vim - Syntax highlighting for Factor code.
+
+## Commands
+
+The `plugin/factor.vim` file implements the following commands for navigating Factor source.
+
+### :FactorVocab factor.vocab.name
+
+Opens the source file implementing the `factor.vocab.name` vocabulary.
+
+### :NewFactorVocab factor.vocab.name
+
+Creates a new factor vocabulary under the working vocabulary root.
+
+### :FactorVocabImpl
+
+Opens the main implementation file for the current vocabulary
+(name.factor).  The keyboard shortcut `<Leader>fi` is bound to this command.
+
+### :FactorVocabDocs
+
+Opens the documentation file for the current vocabulary
+(name-docs.factor).  The keyboard shortcut `<Leader>fd` is bound to this command.
+
+### :FactorVocabTests
+
+Opens the unit test file for the current vocabulary
+(name-tests.factor).  The keyboard shortcut `<Leader>ft` is bound to this command.
+
+## Configuration
+
+In order for the `:FactorVocab` command to work, you'll need to set some variables in your vimrc file.
+
+### g:FactorRoot
+
+This variable should be set to the root of your Factor
+installation. The default value is `~/factor`.
+
+### g:FactorVocabRoots
+
+This variable should be set to a list of Factor vocabulary roots.
+The paths may be either relative to g:FactorRoot or absolute paths.
+The default value is `["core", "basis", "extra", "work"]`.
+
+### g:FactorNewVocabRoot
+
+This variable should be set to the vocabulary root in which
+vocabularies created with NewFactorVocab should be created.
+The default value is `work`.
+
+## Note
+
+The syntax-highlighting file is automatically generated to include the
+names of all the vocabularies Factor knows about. To regenerate it manually,
+run the following code in the listener:
+
+    "editors.vim.generate-syntax" run
+
+or run it from the command line:
+
+    factor -run=editors.vim.generate-syntax
index ad6f92f3c09b1e7cb9471b418c66fb3ca5a6e4e0..1a27b5a1ca26822b3f10c4c72b1f1ad4f82aafe2 100644 (file)
@@ -59,7 +59,7 @@ endfunction
 function! FactorVocabFile(root, vocab, mustexist)
     let vocabpath = substitute(a:vocab, "\\.", "/", "g")
     let vocabfile = FactorVocabRoot(a:root) . vocabpath . "/" . fnamemodify(vocabpath, ":t") . ".factor"
-    
+
     if !a:mustexist || getftype(vocabfile) != ""
         return vocabfile
     else
index 05f9f853f1b9076c02bcc6f847d974ec472a5800..35b7a4c253b5702f20bb0edd2d4e1baf4ddfe2c5 100644 (file)
@@ -1,9 +1,8 @@
-
 " Vim syntax file
-" Language: factor
+" Language: Factor
 " Maintainer: Alex Chapman <chapman.alex@gmail.com>
-" Last Change: 2009 May 19
-" To run: USE: html.templates.fhtml "resource:misc/factor.vim.fgen" <fhtml> call-template
+" Last Change: 2011 Mar 21
+" To run: USING: html.templates html.templates.fhtml ; "resource:misc/factor.vim.fgen" <fhtml> call-template
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
@@ -23,11 +22,13 @@ else
     set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
 endif
 
-syn cluster factorCluster contains=factorComment,factorFryDirective,factorKeyword,factorRepeat,factorConditional,factorBoolean,factorCompileDirective,factorString,factorTriString,factorSbuf,@factorNumber,@factorNumErr,factorDelimiter,factorChar,factorBackslash,factorLiteral,factorLiteralBlock,@factorWordOps,factorAlien,factorTuple,factorStruct
+syn cluster factorCluster contains=factorComment,factorFrySpecifier,factorKeyword,factorRepeat,factorConditional,factorBoolean,factorBreakpoint,factorDeclaration,factorCallQuotation,factorExecute,factorCallNextMethod,factorString,factorTriString,factorSbuf,@factorNumber,@factorNumErr,factorDelimiter,factorChar,factorBackslash,factorLiteral,factorLiteralBlock,@factorWordOps,factorAlien,factorSlot,factorTuple,factorError,factorStruct
 
 syn match factorTodo /\(TODO\|FIXME\|XXX\):\=/ contained
-syn match factorComment /\<#!\>.*/ contains=factorTodo
-syn match factorComment /\<!\>.*/ contains=factorTodo
+syn match factorComment /\<!\>\s.*/ contains=factorTodo,@Spell
+syn match factorComment /\<#!\>\s.*/ contains=factorTodo,@Spell
+syn match factorShebang /\%\^#!\s.*/ display
+syn match factorShebangErr /\%\^#!\S\+/
 
 syn cluster factorDefnContents contains=@factorCluster,factorStackEffect,factorLiteralStackEffect,factorArray0,factorQuotation0
 
@@ -45,8 +46,12 @@ syn region None matchgroup=factorPrivate start=/\<<PRIVATE\>/ end=/\<PRIVATE>\>/
 
 
 syn keyword factorBoolean f t
-syn match factorFryDirective /\<\(@\|_\)\>/ contained
-syn keyword factorCompileDirective inline foldable recursive
+syn keyword factorBreakpoint B
+syn keyword factorFrySpecifier @ _ contained
+syn keyword factorDeclaration delimiter deprecated final flushable foldable inline recursive
+syn match factorCallQuotation /\<call(\s\(.*\s\)\?--\(\s.*\)\?\s)\>/
+syn match factorExecute /\<execute(\s\(.*\s\)\?--\(\s.*\)\?\s)\>/
+syn keyword factorCallNextMethod call-next-method
 
 syn keyword factorKeyword or 2bi 2tri while wrapper nip 4dip wrapper? bi* callstack>array both? hashcode die dupd callstack callstack? 3dup tri@ pick curry build ?execute 3bi prepose >boolean ?if clone eq? tri* ? = swapd 2over 2keep 3keep clear 2dup when not tuple? dup 2bi* 2tri* call tri-curry object bi@ do unless* if* loop bi-curry* drop when* assert= retainstack assert? -rot execute 2bi@ 2tri@ boa with 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 keep 2curry equal? assert tri 2drop most <wrapper> boolean? identity-hashcode identity-tuple? null new dip bi-curry@ rot xor identity-tuple 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-like key? assoc-intersect assoc-refine update assoc-union assoc-combine at* assoc-empty? at+ set-at assoc-all? assoc-subset? assoc-hashcode change-at assoc-each assoc-diff zip values value-at rename-at inc-at enum? at cache assoc>map <enum> assoc assoc-map enum value-at* assoc-map-as >alist assoc-filter-as clear-assoc assoc-stack maybe-set-at substitute assoc-filter 2cache delete-at assoc-find keys assoc-any? unzip
@@ -89,16 +94,21 @@ syn region  factorLiteralBlock  start=/\<\$\[\>/ end=/\<\]\>/
 syn region  factorUsing         start=/\<USING:\>/       end=/;/
 syn match   factorQualified     /\<QUALIFIED:\s\+\S\+\>/
 syn match   factorQualifiedWith /\<QUALIFIED-WITH:\s\+\S\+\s\+\S\+\>/
+syn region  factorExclude       start=/\<EXCLUDE:\>/     end=/;/
 syn region  factorFrom          start=/\<FROM:\>/        end=/;/
+syn match   factorRename        /\<RENAME:\s\+\S\+\s\+\S\+\s=>\s\+\S\+\>/
 syn region  factorSingletons    start=/\<SINGLETONS:\>/  end=/;/
 syn match   factorSymbol        /\<SYMBOL:\s\+\S\+\>/
 syn region  factorSymbols       start=/\<SYMBOLS:\>/     end=/;/
 syn region  factorConstructor2  start=/\<CONSTRUCTOR:\?/ end=/;/
+syn region  factorIntersection  start=/\<INTERSECTION:\>/ end=/\<;\>/
 syn region  factorTuple         start=/\<TUPLE:\>/ end=/\<;\>/
+syn region  factorError         start=/\<ERROR:\>/ end=/\<;\>/
+syn region  factorUnion         start=/\<UNION:\>/ end=/\<;\>/
 syn region  factorStruct        start=/\<\(UNION-STRUCT:\|STRUCT:\)\>/ end=/\<;\>/
 
 syn match   factorConstant      /\<CONSTANT:\s\+\S\+\>/
-syn match   factorAlias         /\<ALIAS:\s\+\S\+\>/
+syn match   factorAlias         /\<ALIAS:\s\+\S\+\s\+\S\+\>/
 syn match   factorSingleton     /\<SINGLETON:\s\+\S\+\>/
 syn match   factorPostpone      /\<POSTPONE:\s\+\S\+\>/
 syn match   factorDefer         /\<DEFER:\s\+\S\+\>/
@@ -109,6 +119,7 @@ syn match   factorHook          /\<HOOK:\s\+\S\+\s\+\S\+\>/
 syn match   factorMain          /\<MAIN:\s\+\S\+\>/
 syn match   factorConstructor   /\<C:\s\+\S\+\s\+\S\+\>/
 syn match   factorAlien         /\<ALIEN:\s\+[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\>/
+syn match   factorSlot          /\<SLOT:\s\+\S\+\>/
 
 syn cluster factorWordOps       contains=factorConstant,factorAlias,factorSingleton,factorSingletons,factorSymbol,factorSymbols,factorPostpone,factorDefer,factorForget,factorMixin,factorInstance,factorHook,factorMain,factorConstructor
 
@@ -126,8 +137,9 @@ syn cluster factorWordOps       contains=factorConstant,factorAlias,factorSingle
 " LIBRARY:
 "#\ "
 
-syn region factorString start=/\<"/ skip=/\\"/ end=/"/
-syn region factorTriString start=/\<"""/ skip=/\\"/ end=/"""/
+syn match factorEscape /\\\([\\stnr0e\"]\|u\x\{6}\|u{\S\+}\)/ contained display
+syn region factorString start=/\<"/ skip=/\\"/ end=/"/ contains=factorEscape
+syn region factorTriString start=/\<"""/ skip=/\\"/ end=/"""/ contains=factorEscape
 syn region factorSbuf start=/\<[-a-zA-Z0-9]\+"\>/ skip=/\\"/ end=/"/
 
 syn region factorMultiString matchgroup=factorMultiStringDelims start=/\<STRING:\s\+\S\+\>/ end=/^;$/ contains=factorMultiStringContents
@@ -136,14 +148,14 @@ syn match factorMultiStringContents /.*/ contained
 "syn match factorStackEffectErr /\<)\>/
 "syn region factorStackEffectErr start=/\<(\>/ end=/\<)\>/
 "syn region factorStackEffect start=/\<(\>/ end=/\<)\>/ contained
-syn match factorStackEffect /\<( .*--.* )\>/ contained
-syn match factorLiteralStackEffect /\<(( .*--.* ))\>/
+syn match factorStackEffect /\<(\s\(.*\s\)\?--\(\s.*\)\?\s)\>/ contained
+syn match factorLiteralStackEffect /\<((\s\(.*\s\)\?--\(\s.*\)\?\s))\>/
 
 "adapted from lisp.vim
-if exists("g:factor_norainbow") 
+if exists("g:factor_norainbow")
     syn region factorQuotation matchgroup=factorDelimiter start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ matchgroup=factorDelimiter end=/\<\]\>/ contains=ALL
 else
-    syn region factorQuotation0           matchgroup=hlLevel0 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation1,factorArray1
+    syn region factorQuotation0           matchgroup=hlLevel0 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation1,factorArray1
     syn region factorQuotation1 contained matchgroup=hlLevel1 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation2,factorArray2
     syn region factorQuotation2 contained matchgroup=hlLevel2 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation3,factorArray3
     syn region factorQuotation3 contained matchgroup=hlLevel3 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation4,factorArray4
@@ -155,7 +167,7 @@ else
     syn region factorQuotation9 contained matchgroup=hlLevel9 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/  end=/\<\]\>/ contains=@factorCluster,factorQuotation0,factorArray0
 endif
 
-if exists("g:factor_norainbow") 
+if exists("g:factor_norainbow")
     syn region factorArray    matchgroup=factorDelimiter start=/\<\(\$\|[-a-zA-Z0-9]\+\)\?{\>/  matchgroup=factorDelimiter end=/\<}\>/ contains=ALL
 else
     syn region factorArray0           matchgroup=hlLevel0 start=/\<\(\$\|[-a-zA-Z0-9]\+\)\?{\>/ end=/\<}\>/ contains=@factorCluster,factorArray1,factorQuotation1
@@ -184,6 +196,8 @@ if version >= 508 || !exists("did_factor_syn_inits")
     endif
 
     HiLink factorComment                Comment
+    HiLink factorShebang                PreProc
+    HiLink factorShebangErr             Error
     HiLink factorStackEffect            Typedef
     HiLink factorLiteralStackEffect     Typedef
     HiLink factorTodo                   Todo
@@ -191,9 +205,13 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorRepeat                 Repeat
     HiLink factorConditional            Conditional
     HiLink factorKeyword                Keyword
+    HiLink factorCallQuotation          Keyword
+    HiLink factorExecute                Keyword
+    HiLink factorCallNextMethod         Keyword
     HiLink factorOperator               Operator
-    HiLink factorFryDirective           Operator
+    HiLink factorFrySpecifier           Operator
     HiLink factorBoolean                Boolean
+    HiLink factorBreakpoint             Debug
     HiLink factorDefnDelims             Typedef
     HiLink factorMethodDelims           Typedef
     HiLink factorGenericDelims          Typedef
@@ -205,6 +223,7 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorPrivateMethodDelims    Special
     HiLink factorPGenericDelims         Special
     HiLink factorPGenericNDelims        Special
+    HiLink factorEscape                 SpecialChar
     HiLink factorString                 String
     HiLink factorTriString              String
     HiLink factorSbuf                   String
@@ -225,7 +244,9 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorUsing                  Include
     HiLink factorQualified              Include
     HiLink factorQualifiedWith          Include
+    HiLink factorExclude                Include
     HiLink factorFrom                   Include
+    HiLink factorRename                 Include
     HiLink factorUse                    Include
     HiLink factorUnuse                  Include
     HiLink factorIn                     Define
@@ -234,9 +255,11 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorBackslash              Special
     HiLink factorLiteral                Special
     HiLink factorLiteralBlock           Special
-    HiLink factorCompileDirective       Typedef
+    HiLink factorDeclaration            Typedef
     HiLink factorSymbol                 Define
+    HiLink factorSymbols                Define
     HiLink factorConstant               Define
+    HiLink factorAlias                  Define
     HiLink factorSingleton              Define
     HiLink factorSingletons             Define
     HiLink factorMixin                  Typedef
@@ -247,7 +270,11 @@ if version >= 508 || !exists("did_factor_syn_inits")
     HiLink factorDefer                  Define
     HiLink factorForget                 Define
     HiLink factorAlien                  Define
+    HiLink factorSlot                   Define
+    HiLink factorIntersection           Typedef
     HiLink factorTuple                  Typedef
+    HiLink factorError                  Typedef
+    HiLink factorUnion                  Typedef
     HiLink factorStruct                 Typedef
 
     if &bg == "dark"
@@ -279,10 +306,4 @@ endif
 
 let b:current_syntax = "factor"
 
-set sw=4
-set sts=4
-set expandtab
-set autoindent " annoying?
-
-" vim: syntax=vim
-
+" vim:set ft=vim sw=4:
index 4c04c59cd5f68c1d4a48e912d5ae027b9a8f31ea..0cd1f22722c4d533627362fad570b3d5df82bb88 100644 (file)
@@ -10,7 +10,7 @@
 package, or checked out Factor sources from the GIT repository.</p>
 
 <ul>
-<li><a href="http://concatenative.org/wiki/view/Factor/Getting%20started">Getting started</a></li>
+<li><a href="http://concatenative.org/wiki/view/Factor/Learning">Learning Factor</a></li>
 <li><a href="http://concatenative.org/wiki/view/Factor/Requirements">System requirements</a></li>
 <li><a href="http://concatenative.org/wiki/view/Factor/Building%20Factor">Building Factor from source</a> (don't do this if you're using a binary package)</li>
 </ul>