diff --git a/core/alien/alien-docs.factor b/core/alien/alien-docs.factor index 7d13080e3c..0caf0e9a9f 100755 --- a/core/alien/alien-docs.factor +++ b/core/alien/alien-docs.factor @@ -265,7 +265,7 @@ ARTICLE: "embedding-restrictions" "Embedding API restrictions" ARTICLE: "embedding-factor" "What embedding looks like from Factor" "Factor code will run inside an embedded instance in the same way it would run in a stand-alone instance." $nl -"One exception is the global " { $link stdio } " stream, which is by default not bound to the terminal where the process is running, to avoid conflicting with any I/O the host process might perform. To initialize the terminal stream, " { $link init-stdio } " must be called explicitly." +"One exception is that the global " { $link input-stream } " and " { $link output-stream } " streams are not bound by default, to avoid conflicting with any I/O the host process might perform. The " { $link init-stdio } " words must be called explicitly to initialize terminal streams." $nl "There is a word which can detect when Factor is embedded:" { $subsection embedded? } diff --git a/core/bootstrap/image/image.factor b/core/bootstrap/image/image.factor index cb83dd9488..1ff04bacc2 100755 --- a/core/bootstrap/image/image.factor +++ b/core/bootstrap/image/image.factor @@ -475,7 +475,7 @@ M: quotation ' "Writing image to " write architecture get boot-image-name resource-path [ write "..." print flush ] - [ binary [ (write-image) ] with-stream ] bi ; + [ binary [ (write-image) ] with-file-writer ] bi ; PRIVATE> diff --git a/core/bootstrap/stage2.factor b/core/bootstrap/stage2.factor index 3247832d52..2e087ff5bd 100755 --- a/core/bootstrap/stage2.factor +++ b/core/bootstrap/stage2.factor @@ -87,7 +87,7 @@ f error-continuation set-global parse-command-line run-user-init "run" get run - stdio get [ stream-flush ] when* + output-stream get [ stream-flush ] when* ] [ print-error 1 exit ] recover ] set-boot-quot diff --git a/core/compiler/errors/errors-docs.factor b/core/compiler/errors/errors-docs.factor index dd71eb704f..d86587662b 100755 --- a/core/compiler/errors/errors-docs.factor +++ b/core/compiler/errors/errors-docs.factor @@ -21,19 +21,19 @@ HELP: compiler-error HELP: compiler-error. { $values { "error" "an error" } { "word" word } } -{ $description "Prints a compiler error to the " { $link stdio } " stream." } ; +{ $description "Prints a compiler error to " { $link output-stream } "." } ; HELP: compiler-errors. { $values { "type" symbol } } -{ $description "Prints compiler errors to the " { $link stdio } " stream. The type parameter is one of " { $link +error+ } ", " { $link +warning+ } ", or " { $link +linkage+ } "." } ; +{ $description "Prints compiler errors to " { $link output-stream } ". The type parameter is one of " { $link +error+ } ", " { $link +warning+ } ", or " { $link +linkage+ } "." } ; HELP: :errors -{ $description "Prints all serious compiler errors from the most recent compile to the " { $link stdio } " stream." } ; +{ $description "Prints all serious compiler errors from the most recent compile to " { $link output-stream } "." } ; HELP: :warnings -{ $description "Prints all ignorable compiler warnings from the most recent compile to the " { $link stdio } " stream." } ; +{ $description "Prints all ignorable compiler warnings from the most recent compile to " { $link output-stream } "." } ; HELP: :linkage -{ $description "Prints all C library interface linkage errors from the most recent compile to the " { $link stdio } " stream." } ; +{ $description "Prints all C library interface linkage errors from the most recent compile to " { $link output-stream } "." } ; { :errors :warnings } related-words diff --git a/core/continuations/continuations-docs.factor b/core/continuations/continuations-docs.factor index b1db09b6bc..472136da8e 100755 --- a/core/continuations/continuations-docs.factor +++ b/core/continuations/continuations-docs.factor @@ -34,7 +34,7 @@ $nl { $code " ... do stuff ... dispose" } -"The reason being that if " { $snippet "do stuff" } " throws an error, the resource will not be disposed of. The most important case where this can occur is with I/O streams, and the correct solution is to always use " { $link with-stream } "; see " { $link "stdio" } " for details." ; +"The reason being that if " { $snippet "do stuff" } " throws an error, the resource will not be disposed of. The most important case where this can occur is with I/O streams, and the correct solution is to always use " { $link with-input-stream } " and " { $link with-output-stream } "; see " { $link "stdio" } " for details." ; ARTICLE: "errors" "Error handling" "Support for handling exceptional situations such as bad user input, implementation bugs, and input/output errors is provided by a set of words built using continuations." diff --git a/core/debugger/debugger-docs.factor b/core/debugger/debugger-docs.factor index ca6aa59cc4..cb79597a73 100755 --- a/core/debugger/debugger-docs.factor +++ b/core/debugger/debugger-docs.factor @@ -64,7 +64,7 @@ HELP: :3 HELP: error. { $values { "error" "an error" } } -{ $contract "Print an error to the " { $link stdio } " stream. You can define methods on this generic word to print human-readable messages for custom errors." } +{ $contract "Print an error to " { $link output-stream } ". You can define methods on this generic word to print human-readable messages for custom errors." } { $notes "Code should call " { $link print-error } " instead, which handles the case where the printing of the error itself throws an error." } ; HELP: error-help @@ -75,11 +75,11 @@ HELP: error-help HELP: print-error { $values { "error" "an error" } } -{ $description "Print an error to the " { $link stdio } " stream." } +{ $description "Print an error to " { $link output-stream } "." } { $notes "This word is called by the listener and other tools which report caught errors to the user." } ; HELP: restarts. -{ $description "Print a list of restarts for the most recently thrown error to the " { $link stdio } " stream." } ; +{ $description "Print a list of restarts for the most recently thrown error to " { $link output-stream } "." } ; HELP: error-hook { $var-description "A quotation with stack effect " { $snippet "( error -- )" } " which is used by " { $link try } " to report the error to the user." } diff --git a/core/debugger/debugger.factor b/core/debugger/debugger.factor index 34fcf8e6bc..64a59fb9be 100755 --- a/core/debugger/debugger.factor +++ b/core/debugger/debugger.factor @@ -1,13 +1,13 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays definitions generic hashtables inspector io kernel -math namespaces prettyprint sequences assocs sequences.private -strings io.styles vectors words system splitting math.parser -classes.tuple continuations continuations.private combinators -generic.math io.streams.duplex classes.builtin classes -compiler.units generic.standard vocabs threads threads.private -init kernel.private libc io.encodings mirrors accessors -math.order ; +math namespaces prettyprint prettyprint.config sequences assocs +sequences.private strings io.styles vectors words system +splitting math.parser classes.tuple continuations +continuations.private combinators generic.math +classes.builtin classes compiler.units generic.standard vocabs +threads threads.private init kernel.private libc io.encodings +mirrors accessors math.order ; IN: debugger GENERIC: error. ( error -- ) @@ -209,9 +209,6 @@ M: no-next-method summary M: inconsistent-next-method summary drop "Executing call-next-method with inconsistent parameters" ; -M: stream-closed-twice summary - drop "Attempt to perform I/O on closed stream" ; - M: check-method summary drop "Invalid parameters for create-method" ; @@ -241,6 +238,15 @@ M: condition error-help error>> error-help ; M: assert summary drop "Assertion failed" ; +M: assert error. + "Assertion failed" print + standard-table-style [ + 15 length-limit set + 5 line-limit set + [ expect>> [ [ "Expect:" write ] with-cell pprint-cell ] with-row ] + [ got>> [ [ "Got:" write ] with-cell pprint-cell ] with-row ] bi + ] tabular-output ; + M: immutable summary drop "Sequence is immutable" ; M: redefine-error error. diff --git a/core/generic/standard/engines/tuple/tuple.factor b/core/generic/standard/engines/tuple/tuple.factor index 7639d1d499..51ea4f8225 100644 --- a/core/generic/standard/engines/tuple/tuple.factor +++ b/core/generic/standard/engines/tuple/tuple.factor @@ -127,8 +127,6 @@ M: echelon-dispatch-engine engine>quot 1 slot { tuple-layout } declare 5 slot ; inline -: unclip-last [ 1 head* ] [ peek ] bi ; - M: tuple-dispatch-engine engine>quot [ picker % diff --git a/core/inference/inference-docs.factor b/core/inference/inference-docs.factor index e32c94ed37..d79c82ed65 100755 --- a/core/inference/inference-docs.factor +++ b/core/inference/inference-docs.factor @@ -135,7 +135,7 @@ HELP: infer HELP: infer. { $values { "quot" "a quotation" } } -{ $description "Attempts to infer the quotation's stack effect, and prints this data to the " { $link stdio } " stream." } +{ $description "Attempts to infer the quotation's stack effect, and prints this data to " { $link output-stream } "." } { $errors "Throws an " { $link inference-error } " if stack effect inference fails." } ; { infer infer. } related-words diff --git a/core/inspector/inspector-docs.factor b/core/inspector/inspector-docs.factor index 84ae34480d..ab1c38b0b7 100644 --- a/core/inspector/inspector-docs.factor +++ b/core/inspector/inspector-docs.factor @@ -108,4 +108,4 @@ HELP: me HELP: inspector-hook { $var-description "A quotation with stack effect " { $snippet "( obj -- )" } ", called by the inspector to display an overview of an object." $nl -"The default implementation calls " { $link describe } " which outputs on the " { $link stdio } " stream, but the graphical listener sets this variable so that calling " { $link inspect } " in the UI opens the graphical inspector." } ; +"The default implementation calls " { $link describe } " which outputs on " { $link output-stream } ", but the graphical listener sets this variable so that calling " { $link inspect } " in the UI opens the graphical inspector." } ; diff --git a/core/io/backend/backend-docs.factor b/core/io/backend/backend-docs.factor index 8bf761e2a6..48b49ed32b 100644 --- a/core/io/backend/backend-docs.factor +++ b/core/io/backend/backend-docs.factor @@ -9,4 +9,4 @@ HELP: init-io { $contract "Initializes the I/O system. Called on startup." } ; HELP: init-stdio -{ $contract "Initializes the global " { $link stdio } " stream. Called on startup." } ; +{ $contract "Initializes the global " { $link input-stream } " and " { $link output-stream } ". Called on startup." } ; diff --git a/core/io/backend/backend.factor b/core/io/backend/backend.factor index 44b1eea349..0760063f0d 100755 --- a/core/io/backend/backend.factor +++ b/core/io/backend/backend.factor @@ -11,8 +11,10 @@ HOOK: init-io io-backend ( -- ) HOOK: (init-stdio) io-backend ( -- stdin stdout stderr ) : init-stdio ( -- ) - (init-stdio) utf8 stderr set-global - utf8 stdio set-global ; + (init-stdio) + [ utf8 input-stream set-global ] + [ utf8 output-stream set-global ] + [ utf8 error-stream set-global ] tri* ; HOOK: io-multiplex io-backend ( ms -- ) diff --git a/core/io/encodings/encodings-docs.factor b/core/io/encodings/encodings-docs.factor index 8a176ce4ec..92471acb5d 100644 --- a/core/io/encodings/encodings-docs.factor +++ b/core/io/encodings/encodings-docs.factor @@ -12,8 +12,7 @@ ARTICLE: "io.encodings" "I/O encodings" ARTICLE: "encodings-constructors" "Manually constructing an encoded stream" "The following words can be used to construct encoded streams. Note that they are usually not used directly, but rather by the stream constructors themselves. Most stream constructors take an encoding descriptor as a parameter and internally call these constructors." { $subsection } -{ $subsection } -{ $subsection } ; +{ $subsection } ; HELP: { $values { "stream" "an output stream" } @@ -29,16 +28,6 @@ HELP: { $description "Wraps the given stream in a new stream using the given encoding for all input. The encoding descriptor can either be a class or an instance of something conforming to the " { $link "encodings-protocol" } "." } $low-level-note ; -HELP: -{ $values { "stream-in" "an input stream" } - { "stream-out" "an output stream" } - { "encoding" "an encoding descriptor" } - { "duplex" "an encoded duplex stream" } } -{ $description "Wraps the given streams in an encoder or decoder stream, and puts them together in a duplex stream for input and output. If either input stream is already encoded, that encoding is stripped off before it is reencoded. The encoding descriptor must conform to the " { $link "encodings-protocol" } "." } -$low-level-note ; - -{ } related-words - ARTICLE: "encodings-descriptors" "Encoding descriptors" "An encoding descriptor is something which can be used for input or output streams to encode or decode files. It must conform to the " { $link "encodings-protocol" } ". Encodings which you can use are defined in the following vocabularies:" { $subsection "io.encodings.binary" } diff --git a/core/io/encodings/encodings-tests.factor b/core/io/encodings/encodings-tests.factor index 397d1ea89c..79922b019c 100755 --- a/core/io/encodings/encodings-tests.factor +++ b/core/io/encodings/encodings-tests.factor @@ -10,7 +10,7 @@ IN: io.streams.encodings.tests unit-test : lines-test ( stream -- line1 line2 ) - [ readln readln ] with-stream ; + [ readln readln ] with-input-stream ; [ "This is a line." diff --git a/core/io/encodings/encodings.factor b/core/io/encodings/encodings.factor index 4559cec666..0f6e58bdc9 100755 --- a/core/io/encodings/encodings.factor +++ b/core/io/encodings/encodings.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: math kernel sequences sbufs vectors namespaces growable strings io classes continuations combinators io.styles -io.streams.plain splitting io.streams.duplex byte-arrays -sequences.private accessors ; +io.streams.plain splitting byte-arrays sequences.private +accessors ; IN: io.encodings ! The encoding descriptor protocol @@ -131,6 +131,3 @@ INSTANCE: encoder plain-writer over decoder? [ >r decoder-stream r> ] when ; PRIVATE> - -: ( stream-in stream-out encoding -- duplex ) - tuck reencode >r redecode r> ; diff --git a/core/io/files/files-docs.factor b/core/io/files/files-docs.factor index b9b1f39ed3..d18babf31b 100755 --- a/core/io/files/files-docs.factor +++ b/core/io/files/files-docs.factor @@ -205,17 +205,17 @@ HELP: HELP: with-file-reader { $values { "path" "a pathname string" } { "encoding" "an encoding descriptor" } { "quot" "a quotation" } } -{ $description "Opens a file for reading and calls the quotation using " { $link with-stream } "." } +{ $description "Opens a file for reading and calls the quotation using " { $link with-input-stream } "." } { $errors "Throws an error if the file is unreadable." } ; HELP: with-file-writer { $values { "path" "a pathname string" } { "encoding" "an encoding descriptor" } { "quot" "a quotation" } } -{ $description "Opens a file for writing using the given encoding and calls the quotation using " { $link with-stream } "." } +{ $description "Opens a file for writing using the given encoding and calls the quotation using " { $link with-output-stream } "." } { $errors "Throws an error if the file cannot be opened for writing." } ; HELP: with-file-appender { $values { "path" "a pathname string" } { "encoding" "an encoding descriptor" } { "quot" "a quotation" } } -{ $description "Opens a file for appending using the given encoding and calls the quotation using " { $link with-stream } "." } +{ $description "Opens a file for appending using the given encoding and calls the quotation using " { $link with-output-stream } "." } { $errors "Throws an error if the file cannot be opened for writing." } ; HELP: set-file-lines diff --git a/core/io/files/files.factor b/core/io/files/files.factor index 576307b589..76c7b144d0 100755 --- a/core/io/files/files.factor +++ b/core/io/files/files.factor @@ -25,13 +25,13 @@ HOOK: (file-appender) io-backend ( path -- stream ) lines ; : with-file-reader ( path encoding quot -- ) - >r r> with-stream ; inline + >r r> with-input-stream ; inline : file-contents ( path encoding -- str ) contents ; : with-file-writer ( path encoding quot -- ) - >r r> with-stream ; inline + >r r> with-output-stream ; inline : set-file-lines ( seq path encoding -- ) [ [ print ] each ] with-file-writer ; @@ -40,7 +40,7 @@ HOOK: (file-appender) io-backend ( path -- stream ) [ write ] with-file-writer ; : with-file-appender ( path encoding quot -- ) - >r r> with-stream ; inline + >r r> with-output-stream ; inline ! Pathnames : path-separator? ( ch -- ? ) os windows? "/\\" "/" ? member? ; diff --git a/core/io/io-docs.factor b/core/io/io-docs.factor index fd40950e62..ddea4da556 100755 --- a/core/io/io-docs.factor +++ b/core/io/io-docs.factor @@ -5,7 +5,7 @@ IN: io ARTICLE: "stream-protocol" "Stream protocol" "The stream protocol consists of a large number of generic words, many of which are optional." $nl -"Stream protocol words are rarely called directly, since code which only works with one stream at a time should be written use " { $link "stdio" } " instead, wrapping I/O operations such as " { $link read } " and " { $link write } " in a " { $link with-stream } ". This leads more simpler, more reusable and more robust code." +"Stream protocol words are rarely called directly, since code which only works with one stream at a time should be written use " { $link "stdio" } " instead, wrapping I/O operations such as " { $link read } " and " { $link write } " in " { $link with-input-stream } " and " { $link with-output-stream } "." $nl "All streams must implement the " { $link dispose } " word in addition to the stream protocol." $nl @@ -26,24 +26,24 @@ $nl { $subsection stream-write-table } { $see-also "io.timeouts" } ; -ARTICLE: "stdio" "The default stream" -"Most I/O code only operates on one stream at a time. The " { $emphasis "default stream" } " is an implicit parameter used by many I/O words designed for this particular use-case. Using this idiom improves code in three ways:" +ARTICLE: "stdio" "Default input and output streams" +"Most I/O code only operates on one stream at a time. The " { $link input-stream } " and " { $link output-stream } " variables are implicit parameters used by many I/O words. Using this idiom improves code in three ways:" { $list { "Code becomes simpler because there is no need to keep a stream around on the stack." } - { "Code becomes more robust because " { $link with-stream } " automatically closes the stream if there is an error." } - { "Code becomes more reusable because it can be written to not worry about which stream is being used, and instead the caller can use " { $link with-stream } " to specify the source or destination for I/O operations." } + { "Code becomes more robust because " { $link with-input-stream } " and " { $link with-output-stream } " automatically close the streams if there is an error." } + { "Code becomes more reusable because it can be written to not worry about which stream is being used, and instead the caller can use " { $link with-input-stream } " or " { $link with-output-stream } " to specify the source or destination for I/O operations." } } "For example, here is a program which reads the first line of a file, converts it to an integer, then reads that many characters, and splits them into groups of 16:" { $code "USING: continuations kernel io io.files math.parser splitting ;" - "\"data.txt\" " + "\"data.txt\" utf8 " "dup stream-readln number>string over stream-read 16 group" "swap dispose" } "This code has two problems: it has some unnecessary stack shuffling, and if either " { $link stream-readln } " or " { $link stream-read } " throws an I/O error, the stream is not closed because " { $link dispose } " is never reached. So we can add a call to " { $link with-disposal } " to ensure the stream is always closed:" { $code "USING: continuations kernel io io.files math.parser splitting ;" - "\"data.txt\" [" + "\"data.txt\" utf8 [" " dup stream-readln number>string over stream-read" " 16 group" "] with-disposal" @@ -51,17 +51,34 @@ ARTICLE: "stdio" "The default stream" "This code is robust however it is more complex than it needs to be since. This is where the default stream words come in; using them, the above can be rewritten as follows:" { $code "USING: continuations kernel io io.files math.parser splitting ;" - "\"data.txt\" [" + "\"data.txt\" utf8 [" " readln number>string read 16 group" - "] with-stream" + "] with-input-stream" } -"The default stream is stored in a dynamically-scoped variable:" -{ $subsection stdio } -"Unless rebound in a child namespace, this variable will be set to a console stream for interacting with the user." +"An even better implementation that takes advantage of a utility word:" +{ $code + "USING: continuations kernel io io.files math.parser splitting ;" + "\"data.txt\" utf8 [" + " readln number>string read 16 group" + "] with-file-reader" +} +"The default input stream is stored in a dynamically-scoped variable:" +{ $subsection input-stream } +"Unless rebound in a child namespace, this variable will be set to a console stream for reading input from the user." +$nl +"Words reading from the default input stream:" { $subsection read1 } { $subsection read } { $subsection read-until } { $subsection readln } +"A pair of combinators for rebinding the " { $link input-stream } " variable:" +{ $subsection with-input-stream } +{ $subsection with-input-stream* } +"The default output stream is stored in a dynamically-scoped variable:" +{ $subsection output-stream } +"Unless rebound in a child namespace, this variable will be set to a console stream for showing output to the user." +$nl +"Words writing to the default input stream:" { $subsection flush } { $subsection write1 } { $subsection write } @@ -78,9 +95,12 @@ ARTICLE: "stdio" "The default stream" { $subsection with-row } { $subsection with-cell } { $subsection write-cell } -"A pair of combinators support rebinding the " { $link stdio } " variable:" -{ $subsection with-stream } -{ $subsection with-stream* } ; +"A pair of combinators for rebinding the " { $link output-stream } " variable:" +{ $subsection with-output-stream } +{ $subsection with-output-stream* } +"A pair of combinators for rebinding both default streams at once:" +{ $subsection with-streams } +{ $subsection with-streams* } ; ARTICLE: "stream-utils" "Stream utilities" "There are a few useful stream-related words which are not generic, but merely built up from the stream protocol." @@ -204,62 +224,65 @@ HELP: stream-copy { $description "Copies the contents of one stream into another, closing both streams when done." } $io-error ; -HELP: stdio -{ $var-description "Holds a stream, used for various implicit stream operations. Rebound using " { $link with-stream } " and " { $link with-stream* } "." } ; +HELP: input-stream +{ $var-description "Holds an input stream for various implicit stream operations. Rebound using " { $link with-input-stream } " and " { $link with-input-stream* } "." } ; + +HELP: output-stream +{ $var-description "Holds an output stream for various implicit stream operations. Rebound using " { $link with-output-stream } " and " { $link with-output-stream* } "." } ; HELP: readln { $values { "str/f" "a string or " { $link f } } } -{ $description "Reads a line of input from the " { $link stdio } " stream. Outputs " { $link f } " on stream exhaustion." } +{ $description "Reads a line of input from " { $link input-stream } ". Outputs " { $link f } " on stream exhaustion." } $io-error ; HELP: read1 { $values { "ch/f" "a character or " { $link f } } } -{ $description "Reads a character of input from the " { $link stdio } " stream. Outputs " { $link f } " on stream exhaustion." } +{ $description "Reads a character of input from " { $link input-stream } ". Outputs " { $link f } " on stream exhaustion." } $io-error ; HELP: read { $values { "n" "a non-negative integer" } { "str/f" "a string or " { $link f } } } -{ $description "Reads " { $snippet "n" } " characters of input from the " { $link stdio } " stream. Outputs a truncated string or " { $link f } " on stream exhaustion." } +{ $description "Reads " { $snippet "n" } " characters of input from " { $link input-stream } ". Outputs a truncated string or " { $link f } " on stream exhaustion." } $io-error ; HELP: read-until { $values { "seps" string } { "str/f" "a string or " { $link f } } { "sep/f" "a character or " { $link f } } } -{ $contract "Reads characters from the " { $link stdio } " stream. until the first occurrence of a separator character, or stream exhaustion. In the former case, the separator character is pushed on the stack, and is not part of the output string. In the latter case, the entire stream contents are output, along with " { $link f } "." } +{ $contract "Reads characters from " { $link input-stream } ". until the first occurrence of a separator character, or stream exhaustion. In the former case, the separator character is pushed on the stack, and is not part of the output string. In the latter case, the entire stream contents are output, along with " { $link f } "." } $io-error ; HELP: write1 { $values { "ch" "a character" } } -{ $contract "Writes a character of output to the " { $link stdio } " stream. If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } +{ $contract "Writes a character of output to " { $link output-stream } ". If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } $io-error ; HELP: write { $values { "str" string } } -{ $description "Writes a string of output to the " { $link stdio } " stream. If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } +{ $description "Writes a string of output to " { $link output-stream } ". If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } $io-error ; HELP: flush -{ $description "Waits for any pending output to the " { $link stdio } " stream to complete." } +{ $description "Waits for any pending output on " { $link output-stream } " to complete." } $io-error ; HELP: nl -{ $description "Writes a line terminator to the " { $link stdio } " stream. If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } +{ $description "Writes a line terminator to " { $link output-stream } ". If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } $io-error ; HELP: format { $values { "str" string } { "style" "a hashtable" } } -{ $description "Writes formatted text to the " { $link stdio } " stream. If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } +{ $description "Writes formatted text to " { $link output-stream } ". If the stream does buffering, output may not be performed immediately; use " { $link flush } " to force output." } { $notes "Details are in the documentation for " { $link stream-format } "." } $io-error ; HELP: with-nesting -{ $values { "style" "a hashtable" } { "quot" "a quotation" } } -{ $description "Calls the quotation in a new dynamic scope with the " { $link stdio } " stream rebound to a nested paragraph stream, with formatting information applied." } +{ $values { "style" "a hashtable" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to a nested paragraph stream, with formatting information applied." } { $notes "Details are in the documentation for " { $link make-block-stream } "." } $io-error ; HELP: tabular-output { $values { "style" "a hashtable" } { "quot" quotation } } -{ $description "Calls a quotation which emits a series of equal-length table rows using " { $link with-row } ". The results are laid out in a tabular fashion on the " { $link stdio } " stream." +{ $description "Calls a quotation which emits a series of equal-length table rows using " { $link with-row } ". The results are laid out in a tabular fashion on " { $link output-stream } "." $nl "The " { $snippet "style" } " hashtable holds table style information. See " { $link "table-styles" } "." } { $examples @@ -279,7 +302,7 @@ $io-error ; HELP: with-cell { $values { "quot" quotation } } -{ $description "Calls a quotation in a new scope with the " { $link stdio } " stream rebound. Output performed by the quotation is displayed in a table cell. This word can only be called inside the quotation given to " { $link with-row } "." } +{ $description "Calls a quotation in a new scope with " { $link output-stream } " rebound. Output performed by the quotation is displayed in a table cell. This word can only be called inside the quotation given to " { $link with-row } "." } $io-error ; HELP: write-cell @@ -288,34 +311,54 @@ HELP: write-cell $io-error ; HELP: with-style -{ $values { "style" "a hashtable" } { "quot" "a quotation" } } +{ $values { "style" "a hashtable" } { "quot" quotation } } { $description "Calls the quotation in a new dynamic scope where calls to " { $link write } ", " { $link format } " and other stream output words automatically inherit style settings from " { $snippet "style" } "." } { $notes "Details are in the documentation for " { $link make-span-stream } "." } $io-error ; HELP: print { $values { "string" string } } -{ $description "Writes a newline-terminated string to the " { $link stdio } " stream." } +{ $description "Writes a newline-terminated string to " { $link output-stream } "." } $io-error ; -HELP: with-stream -{ $values { "stream" "an input or output stream" } { "quot" "a quotation" } } -{ $description "Calls the quotation in a new dynamic scope, with the " { $link stdio } " variable rebound to " { $snippet "stream" } ". The stream is closed if the quotation returns or throws an error." } ; +HELP: with-input-stream +{ $values { "stream" "an input stream" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with " { $link input-stream } " rebound to " { $snippet "stream" } ". The stream is closed if the quotation returns or throws an error." } ; -{ with-stream with-stream* } related-words +HELP: with-output-stream +{ $values { "stream" "an output stream" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with " { $link output-stream } " rebound to " { $snippet "stream" } ". The stream is closed if the quotation returns or throws an error." } ; -HELP: with-stream* -{ $values { "stream" "an input or output stream" } { "quot" "a quotation" } } -{ $description "Calls the quotation in a new dynamic scope, with the " { $link stdio } " variable rebound to " { $snippet "stream" } "." } -{ $notes "This word does not close the stream. Compare with " { $link with-stream } "." } ; +HELP: with-streams +{ $values { "input" "an input stream" } { "output" "an output stream" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with " { $link input-stream } " rebound to " { $snippet "input" } " and " { $link output-stream } " rebound to " { $snippet "output" } ". The stream is closed if the quotation returns or throws an error." } ; + +HELP: with-streams* +{ $values { "input" "an input stream" } { "output" "an output stream" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with " { $link input-stream } " rebound to " { $snippet "input" } " and " { $link output-stream } " rebound to " { $snippet "output" } "." } +{ $notes "This word does not close the stream. Compare with " { $link with-streams } "." } ; + +{ with-input-stream with-input-stream* } related-words + +{ with-output-stream with-output-stream* } related-words + +HELP: with-input-stream* +{ $values { "stream" "an input stream" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with " { $link input-stream } " rebound to " { $snippet "stream" } "." } +{ $notes "This word does not close the stream. Compare with " { $link with-input-stream } "." } ; + +HELP: with-output-stream* +{ $values { "stream" "an output stream" } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with " { $link output-stream } " rebound to " { $snippet "stream" } "." } +{ $notes "This word does not close the stream. Compare with " { $link with-output-stream } "." } ; HELP: bl -{ $description "Outputs a space character (" { $snippet "\" \"" } ")." } +{ $description "Outputs a space character (" { $snippet "\" \"" } ") to " { $link output-stream } "." } $io-error ; HELP: write-object { $values { "str" string } { "obj" "an object" } } -{ $description "Writes a string to the " { $link stdio } " stream, associating it with the object. If formatted output is supported, the string will become a clickable presentation of the object, otherwise this word behaves like a call to " { $link write } "." } +{ $description "Writes a string to " { $link output-stream } ", associating it with the object. If formatted output is supported, the string will become a clickable presentation of the object, otherwise this word behaves like a call to " { $link write } "." } $io-error ; HELP: lines diff --git a/core/io/io-tests.factor b/core/io/io-tests.factor index b7d1cf81c8..7204bde6fb 100755 --- a/core/io/io-tests.factor +++ b/core/io/io-tests.factor @@ -15,14 +15,14 @@ IN: io.tests "This is a line.\rThis is another line.\r" ] [ "core/io/test/mac-os-eol.txt" - [ 500 read ] with-stream + [ 500 read ] with-input-stream ] unit-test [ 255 ] [ "core/io/test/binary.txt" - [ read1 ] with-stream >fixnum + [ read1 ] with-input-stream >fixnum ] unit-test ! Make sure we use correct to_c_string form when writing @@ -40,7 +40,7 @@ IN: io.tests "J" read-until 2array , "i" read-until 2array , "X" read-until 2array , - ] with-stream + ] with-input-stream ] { } make ] unit-test @@ -49,12 +49,3 @@ IN: io.tests 10 [ 65536 read drop ] times ] with-file-reader ] unit-test - -! [ "" ] [ 0 read ] unit-test - -! [ ] [ "123" write 9000 CHAR: x write flush ] unit-test - -! [ -! "/core/io/test/binary.txt" -! [ 0.2 read ] with-stream -! ] must-fail diff --git a/core/io/io.factor b/core/io/io.factor index ef9eae7902..e28fd28fb3 100755 --- a/core/io/io.factor +++ b/core/io/io.factor @@ -30,39 +30,52 @@ GENERIC: stream-write-table ( table-cells style stream -- ) [ 2dup (stream-copy) ] [ dispose dispose ] [ ] cleanup ; -! Default stream -SYMBOL: stdio +! Default streams +SYMBOL: input-stream +SYMBOL: output-stream +SYMBOL: error-stream -! Default error stream -SYMBOL: stderr +: readln ( -- str/f ) input-stream get stream-readln ; +: read1 ( -- ch/f ) input-stream get stream-read1 ; +: read ( n -- str/f ) input-stream get stream-read ; +: read-until ( seps -- str/f sep/f ) input-stream get stream-read-until ; -: readln ( -- str/f ) stdio get stream-readln ; -: read1 ( -- ch/f ) stdio get stream-read1 ; -: read ( n -- str/f ) stdio get stream-read ; -: read-until ( seps -- str/f sep/f ) stdio get stream-read-until ; +: write1 ( ch -- ) output-stream get stream-write1 ; +: write ( str -- ) output-stream get stream-write ; +: flush ( -- ) output-stream get stream-flush ; -: write1 ( ch -- ) stdio get stream-write1 ; -: write ( str -- ) stdio get stream-write ; -: flush ( -- ) stdio get stream-flush ; +: nl ( -- ) output-stream get stream-nl ; +: format ( str style -- ) output-stream get stream-format ; -: nl ( -- ) stdio get stream-nl ; -: format ( str style -- ) stdio get stream-format ; +: with-input-stream* ( stream quot -- ) + input-stream swap with-variable ; inline -: with-stream* ( stream quot -- ) - stdio swap with-variable ; inline +: with-input-stream ( stream quot -- ) + [ with-input-stream* ] curry with-disposal ; inline -: with-stream ( stream quot -- ) - [ with-stream* ] curry with-disposal ; inline +: with-output-stream* ( stream quot -- ) + output-stream swap with-variable ; inline + +: with-output-stream ( stream quot -- ) + [ with-output-stream* ] curry with-disposal ; inline + +: with-streams* ( input output quot -- ) + [ output-stream set input-stream set ] prepose with-scope ; inline + +: with-streams ( input output quot -- ) + [ [ with-streams* ] 3curry ] + [ [ drop dispose dispose ] 3curry ] 3bi + [ ] cleanup ; inline : tabular-output ( style quot -- ) - swap >r { } make r> stdio get stream-write-table ; inline + swap >r { } make r> output-stream get stream-write-table ; inline : with-row ( quot -- ) { } make , ; inline : with-cell ( quot -- ) - H{ } stdio get make-cell-stream - [ swap with-stream ] keep , ; inline + H{ } output-stream get make-cell-stream + [ swap with-output-stream ] keep , ; inline : write-cell ( str -- ) [ write ] with-cell ; inline @@ -71,13 +84,14 @@ SYMBOL: stderr swap dup assoc-empty? [ drop call ] [ - stdio get make-span-stream swap with-stream + output-stream get make-span-stream swap with-output-stream ] if ; inline : with-nesting ( style quot -- ) - >r stdio get make-block-stream r> with-stream ; inline + >r output-stream get make-block-stream + r> with-output-stream ; inline -: print ( string -- ) stdio get stream-print ; +: print ( string -- ) output-stream get stream-print ; : bl ( -- ) " " write ; @@ -85,9 +99,9 @@ SYMBOL: stderr presented associate format ; : lines ( stream -- seq ) - [ [ readln dup ] [ ] [ drop ] unfold ] with-stream ; + [ [ readln dup ] [ ] [ drop ] unfold ] with-input-stream ; : contents ( stream -- str ) [ [ 65536 read dup ] [ ] [ drop ] unfold concat f like - ] with-stream ; + ] with-input-stream ; diff --git a/core/io/streams/byte-array/byte-array-docs.factor b/core/io/streams/byte-array/byte-array-docs.factor index 741725af41..7b27621343 100644 --- a/core/io/streams/byte-array/byte-array-docs.factor +++ b/core/io/streams/byte-array/byte-array-docs.factor @@ -25,10 +25,10 @@ HELP: HELP: with-byte-reader { $values { "encoding" "an encoding descriptor" } { "quot" quotation } { "byte-array" byte-array } } -{ $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to an input stream for reading from a byte array using an encoding." } ; +{ $description "Calls the quotation in a new dynamic scope with " { $link input-stream } " rebound to an input stream for reading from a byte array using an encoding." } ; HELP: with-byte-writer { $values { "encoding" "an encoding descriptor" } { "quot" quotation } { "byte-array" byte-array } } -{ $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to an output stream writing data to a byte array using an encoding." } ; +{ $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to an output stream writing data to a byte array using an encoding." } ; diff --git a/core/io/streams/byte-array/byte-array.factor b/core/io/streams/byte-array/byte-array.factor index 2a8441ff23..28d789d66f 100644 --- a/core/io/streams/byte-array/byte-array.factor +++ b/core/io/streams/byte-array/byte-array.factor @@ -1,16 +1,16 @@ USING: byte-arrays byte-vectors kernel io.encodings io.streams.string -sequences io namespaces io.encodings.private ; +sequences io namespaces io.encodings.private accessors ; IN: io.streams.byte-array : ( encoding -- stream ) 512 swap ; : with-byte-writer ( encoding quot -- byte-array ) - >r r> [ stdio get ] compose with-stream* - dup encoder? [ encoder-stream ] when >byte-array ; inline + >r r> [ output-stream get ] compose with-output-stream* + dup encoder? [ stream>> ] when >byte-array ; inline : ( byte-array encoding -- stream ) >r >byte-vector dup reverse-here r> ; : with-byte-reader ( byte-array encoding quot -- ) - >r r> with-stream ; inline + >r r> with-input-stream* ; inline diff --git a/core/io/streams/c/c.factor b/core/io/streams/c/c.factor index 372acbe0c1..91732f3211 100755 --- a/core/io/streams/c/c.factor +++ b/core/io/streams/c/c.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel kernel.private namespaces io io.encodings sequences math generic threads.private classes io.backend -io.streams.duplex io.files continuations byte-arrays ; +io.files continuations byte-arrays ; IN: io.streams.c TUPLE: c-writer handle ; diff --git a/core/io/streams/duplex/duplex-docs.factor b/core/io/streams/duplex/duplex-docs.factor deleted file mode 100755 index c9691af5ba..0000000000 --- a/core/io/streams/duplex/duplex-docs.factor +++ /dev/null @@ -1,19 +0,0 @@ -USING: help.markup help.syntax io continuations ; -IN: io.streams.duplex - -ARTICLE: "io.streams.duplex" "Duplex streams" -"Duplex streams combine an input stream and an output stream into a bidirectional stream." -{ $subsection duplex-stream } -{ $subsection } ; - -ABOUT: "io.streams.duplex" - -HELP: duplex-stream -{ $class-description "A bidirectional stream wrapping an input and output stream." } ; - -HELP: -{ $values { "in" "an input stream" } { "out" "an output stream" } { "stream" " a duplex stream" } } -{ $description "Creates a duplex stream. Writing to a duplex stream will write to " { $snippet "out" } ", and reading from a duplex stream will read from " { $snippet "in" } ". Closing a duplex stream closes both the input and output streams." } ; - -HELP: stream-closed-twice -{ $error-description "This error is thrown when performing an I/O operation on a " { $link duplex-stream } " which has been closed with " { $link dispose } "." } ; diff --git a/core/io/streams/string/string-docs.factor b/core/io/streams/string/string-docs.factor index 5b09baa56d..b87e5ca591 100644 --- a/core/io/streams/string/string-docs.factor +++ b/core/io/streams/string/string-docs.factor @@ -17,7 +17,7 @@ HELP: HELP: with-string-writer { $values { "quot" quotation } { "str" string } } -{ $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to a new string writer. The accumulated string is output when the quotation returns." } ; +{ $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to a new string writer. The accumulated string is output when the quotation returns." } ; HELP: { $values { "str" string } { "stream" "an input stream" } } @@ -26,4 +26,4 @@ HELP: HELP: with-string-reader { $values { "str" string } { "quot" quotation } } -{ $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to an input stream reading " { $snippet "str" } " from beginning to end." } ; +{ $description "Calls the quotation in a new dynamic scope with " { $link input-stream } " rebound to an input stream reading " { $snippet "str" } " from beginning to end." } ; diff --git a/core/io/streams/string/string-tests.factor b/core/io/streams/string/string-tests.factor index ca117534da..3512ac871d 100644 --- a/core/io/streams/string/string-tests.factor +++ b/core/io/streams/string/string-tests.factor @@ -35,7 +35,7 @@ unit-test "J" read-until 2array , "i" read-until 2array , "X" read-until 2array , - ] with-stream + ] with-input-stream ] { } make ] unit-test diff --git a/core/io/streams/string/string.factor b/core/io/streams/string/string.factor index 531d0401b2..d43599776b 100755 --- a/core/io/streams/string/string.factor +++ b/core/io/streams/string/string.factor @@ -15,7 +15,7 @@ M: growable stream-flush drop ; 512 ; : with-string-writer ( quot -- str ) - swap [ stdio get ] compose with-stream* + swap [ output-stream get ] compose with-output-stream* >string ; inline M: growable stream-read1 dup empty? [ drop f ] [ pop ] if ; @@ -56,7 +56,7 @@ M: null decode-char drop stream-read1 ; >sbuf dup reverse-here null ; : with-string-reader ( str quot -- ) - >r r> with-stream ; inline + >r r> with-input-stream ; inline INSTANCE: growable plain-writer @@ -67,15 +67,14 @@ INSTANCE: growable plain-writer ] unless ; : map-last ( seq quot -- seq ) - swap dup length - [ zero? rot [ call ] keep swap ] 2map nip ; inline + >r dup length [ zero? ] r> compose 2map ; inline : format-table ( table -- seq ) flip [ format-column ] map-last flip [ " " join ] map ; M: plain-writer stream-write-table - [ drop format-table [ print ] each ] with-stream* ; + [ drop format-table [ print ] each ] with-output-stream* ; M: plain-writer make-cell-stream 2drop ; diff --git a/core/listener/listener-docs.factor b/core/listener/listener-docs.factor index 755c79ac68..beea9005b4 100755 --- a/core/listener/listener-docs.factor +++ b/core/listener/listener-docs.factor @@ -32,14 +32,14 @@ HELP: listener-hook HELP: read-quot { $values { "quot/f" "a parsed quotation, or " { $link f } " indicating end of file" } } -{ $description "Reads a Factor expression which possibly spans more than one line from " { $link stdio } " stream. Additional lines of input are read while the parser stack height is greater than one. Since structural parsing words push partial quotations on the stack, this will keep on reading input until all delimited parsing words are terminated." } ; +{ $description "Reads a Factor expression which possibly spans more than one line from " { $link input-stream } ". Additional lines of input are read while the parser stack height is greater than one. Since structural parsing words push partial quotations on the stack, this will keep on reading input until all delimited parsing words are terminated." } ; HELP: listen -{ $description "Prompts for an expression on the " { $link stdio } " stream and evaluates it. On end of file, " { $link quit-flag } " is set to terminate the listener loop." } -{ $errors "If the expression input by the user throws an error, the error is printed to the " { $link stdio } " stream and the word returns normally." } ; +{ $description "Prompts for an expression on " { $link input-stream } " and evaluates it. On end of file, " { $link quit-flag } " is set to terminate the listener loop." } +{ $errors "If the expression input by the user throws an error, the error is printed to " { $link output-stream } " and the word returns normally." } ; HELP: listener -{ $description "Prompts for expressions on the " { $link stdio } " stream and evaluates them until end of file is reached." } ; +{ $description "Prompts for expressions on " { $link input-stream } " and evaluates them until end of file is reached." } ; HELP: bye { $description "Exits the current listener." } diff --git a/core/listener/listener.factor b/core/listener/listener.factor index ddb29bb768..ff172ccda4 100755 --- a/core/listener/listener.factor +++ b/core/listener/listener.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: arrays hashtables io kernel math math.parser memory namespaces parser sequences strings io.styles -io.streams.duplex vectors words generic system combinators -continuations debugger definitions compiler.units accessors ; +vectors words generic system combinators continuations debugger +definitions compiler.units accessors ; IN: listener SYMBOL: quit-flag @@ -35,10 +35,7 @@ GENERIC: stream-read-quot ( stream -- quot/f ) M: object stream-read-quot V{ } clone read-quot-loop ; -M: duplex-stream stream-read-quot - duplex-stream-in stream-read-quot ; - -: read-quot ( -- quot/f ) stdio get stream-read-quot ; +: read-quot ( -- quot/f ) input-stream get stream-read-quot ; : bye ( -- ) quit-flag on ; diff --git a/core/math/parser/parser-tests.factor b/core/math/parser/parser-tests.factor index baa6634a9f..15234ee310 100755 --- a/core/math/parser/parser-tests.factor +++ b/core/math/parser/parser-tests.factor @@ -98,3 +98,9 @@ unit-test [ 1 1 >base ] must-fail [ 1 0 >base ] must-fail [ 1 -1 >base ] must-fail + +[ "0.0/0.0" ] [ 0.0 0.0 / number>string ] unit-test + +[ "1.0/0.0" ] [ 1.0 0.0 / number>string ] unit-test + +[ "-1.0/0.0" ] [ -1.0 0.0 / number>string ] unit-test diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 1a1a080564..d1b8e6fd37 100755 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -140,9 +140,9 @@ M: ratio >base M: float >base drop { + { [ dup fp-nan? ] [ drop "0.0/0.0" ] } { [ dup 1.0/0.0 = ] [ drop "1.0/0.0" ] } { [ dup -1.0/0.0 = ] [ drop "-1.0/0.0" ] } - { [ dup fp-nan? ] [ drop "0.0/0.0" ] } [ float>string fix-float ] } cond ; diff --git a/core/parser/parser-docs.factor b/core/parser/parser-docs.factor index b69985fb1d..418278baee 100755 --- a/core/parser/parser-docs.factor +++ b/core/parser/parser-docs.factor @@ -5,7 +5,7 @@ quotations namespaces compiler.units assocs ; IN: parser ARTICLE: "vocabulary-search-shadow" "Shadowing word names" -"If adding a vocabulary to the search path results in a word in another vocabulary becoming inaccessible due to the new vocabulary defining a word with the same name, a message is printed to the " { $link stdio } " stream. Except when debugging suspected name clashes, these messages can be ignored." +"If adding a vocabulary to the search path results in a word in another vocabulary becoming inaccessible due to the new vocabulary defining a word with the same name, we say that the old word has been " { $emphasis "shadowed" } "." $nl "Here is an example where shadowing occurs:" { $code @@ -13,18 +13,18 @@ $nl "USING: sequences io ;" "" ": append" - " \"foe::append calls sequences::append\" print append ;" + " \"foe::append calls sequences:append\" print append ;" "" "IN: fee" "" ": append" - " \"fee::append calls fee::append\" print append ;" + " \"fee::append calls fee:append\" print append ;" "" "IN: fox" "USE: foe" "" ": append" - " \"fox::append calls foe::append\" print append ;" + " \"fox::append calls foe:append\" print append ;" "" "\"1234\" \"5678\" append print" "" @@ -33,12 +33,13 @@ $nl } "When placed in a source file and run, the above code produces the following output:" { $code - "foe::append calls sequences::append" + "foe:append calls sequences:append" "12345678" - "fee::append calls foe::append" - "foe::append calls sequences::append" + "fee:append calls foe:append" + "foe:append calls sequences:append" "12345678" -} ; +} +"The " { $vocab-link "qualified" } " vocabulary contains some tools for helping with shadowing." ; ARTICLE: "vocabulary-search-errors" "Word lookup errors" "If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies. Then, one of three things happen:" @@ -215,7 +216,7 @@ HELP: save-location { $description "Saves the location of a definition and associates this definition with the current source file." } ; HELP: parser-notes -{ $var-description "A boolean controlling whether the parser will print various notes and warnings. Switched on by default. If a source file is being run for its effect on the " { $link stdio } " stream, this variable should be switched off, to prevent parser notes from polluting the output." } ; +{ $var-description "A boolean controlling whether the parser will print various notes and warnings. Switched on by default. If a source file is being run for its effect on " { $link output-stream } ", this variable should be switched off, to prevent parser notes from polluting the output." } ; HELP: parser-notes? { $values { "?" "a boolean" } } @@ -506,7 +507,7 @@ HELP: bootstrap-file HELP: eval>string { $values { "str" string } { "output" string } } -{ $description "Evaluates the Factor code in " { $snippet "str" } " with the " { $link stdio } " stream rebound to a string output stream, then outputs the resulting string." } ; +{ $description "Evaluates the Factor code in " { $snippet "str" } " with " { $link output-stream } " rebound to a string output stream, then outputs the resulting string." } ; HELP: staging-violation { $values { "word" word } } diff --git a/core/prettyprint/prettyprint-docs.factor b/core/prettyprint/prettyprint-docs.factor index 2933c8ee6f..f7f0f7ee44 100755 --- a/core/prettyprint/prettyprint-docs.factor +++ b/core/prettyprint/prettyprint-docs.factor @@ -135,7 +135,7 @@ ARTICLE: "prettyprint" "The prettyprinter" $nl "Prettyprinter words are found in the " { $vocab-link "prettyprint" } " vocabulary." $nl -"The key words to print an object to the " { $link stdio } " stream; the first two emit a trailing newline, the second two do not:" +"The key words to print an object to " { $link output-stream } "; the first two emit a trailing newline, the second two do not:" { $subsection . } { $subsection short. } { $subsection pprint } @@ -161,17 +161,17 @@ ABOUT: "prettyprint" HELP: with-pprint { $values { "obj" object } { "quot" quotation } } -{ $description "Sets up the prettyprinter and calls the quotation in a new scope. The quotation should add sections to the top-level block. When the quotation returns, the top-level block is printed to the " { $link stdio } " stream." } ; +{ $description "Sets up the prettyprinter and calls the quotation in a new scope. The quotation should add sections to the top-level block. When the quotation returns, the top-level block is printed to " { $link output-stream } "." } ; HELP: pprint { $values { "obj" object } } -{ $description "Prettyprints an object to the " { $link stdio } " stream. Output is influenced by many variables; see " { $link "prettyprint-variables" } "." } ; +{ $description "Prettyprints an object to " { $link output-stream } ". Output is influenced by many variables; see " { $link "prettyprint-variables" } "." } ; { pprint pprint* with-pprint } related-words HELP: . { $values { "obj" object } } -{ $description "Prettyprints an object to the " { $link stdio } " stream with a trailing line break. Output is influenced by many variables; see " { $link "prettyprint-variables" } "." } ; +{ $description "Prettyprints an object to " { $link output-stream } " with a trailing line break. Output is influenced by many variables; see " { $link "prettyprint-variables" } "." } ; HELP: unparse { $values { "obj" object } { "str" "Factor source string" } } @@ -179,11 +179,11 @@ HELP: unparse HELP: pprint-short { $values { "obj" object } } -{ $description "Prettyprints an object to the " { $link stdio } " stream. This word rebinds printer control variables to enforce ``shorter'' output. See " { $link "prettyprint-variables" } "." } ; +{ $description "Prettyprints an object to " { $link output-stream } ". This word rebinds printer control variables to enforce ``shorter'' output. See " { $link "prettyprint-variables" } "." } ; HELP: short. { $values { "obj" object } } -{ $description "Prettyprints an object to the " { $link stdio } " stream with a trailing line break. This word rebinds printer control variables to enforce ``shorter'' output." } ; +{ $description "Prettyprints an object to " { $link output-stream } " with a trailing line break. This word rebinds printer control variables to enforce ``shorter'' output." } ; HELP: .b { $values { "n" "an integer" } } diff --git a/core/prettyprint/sections/sections-docs.factor b/core/prettyprint/sections/sections-docs.factor index ceb37c2fe4..842a36a13b 100755 --- a/core/prettyprint/sections/sections-docs.factor +++ b/core/prettyprint/sections/sections-docs.factor @@ -15,7 +15,7 @@ HELP: line-limit? HELP: do-indent -{ $description "Outputs the current indent nesting to the " { $link stdio } " stream." } ; +{ $description "Outputs the current indent nesting to " { $link output-stream } "." } ; HELP: fresh-line { $values { "n" "the current column position" } } diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index a63e6d2835..f39bf08e58 100755 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -670,9 +670,15 @@ PRIVATE> : unclip ( seq -- rest first ) [ rest ] [ first ] bi ; +: unclip-last ( seq -- butfirst last ) + [ 1 head* ] [ peek ] bi ; + : unclip-slice ( seq -- rest first ) [ rest-slice ] [ first ] bi ; +: unclip-last-slice ( seq -- butfirst last ) + [ 1 head-slice* ] [ peek ] bi ; + : ( seq -- slice ) dup slice? [ { } like ] when 0 over length rot ; inline diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index eb10b9fe4a..62c5121e50 100755 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -1,42 +1,72 @@ -! Copyright (C) 2005, 2007 Slava Pestov. +! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel math namespaces strings arrays vectors sequences -sets math.order ; +sets math.order accessors ; IN: splitting -TUPLE: groups seq n sliced? ; +TUPLE: abstract-groups seq n ; -: check-groups 0 <= [ "Invalid group count" throw ] when ; +: check-groups dup 0 <= [ "Invalid group count" throw ] when ; inline + +: construct-groups ( seq n class -- groups ) + >r check-groups r> boa ; inline + +GENERIC: group@ ( n groups -- from to seq ) + +M: abstract-groups nth group@ subseq ; + +M: abstract-groups set-nth group@ 0 swap copy ; + +M: abstract-groups like drop { } like ; + +INSTANCE: abstract-groups sequence + +TUPLE: groups < abstract-groups ; : ( seq n -- groups ) - dup check-groups f groups boa ; inline - -: ( seq n -- groups ) - t over set-groups-sliced? ; + groups construct-groups ; inline M: groups length - dup groups-seq length swap groups-n [ + 1- ] keep /i ; + [ seq>> length ] [ n>> ] bi [ + 1- ] keep /i ; M: groups set-length - [ groups-n * ] keep groups-seq set-length ; + [ n>> * ] [ seq>> ] bi set-length ; -: group@ ( n groups -- from to seq ) - [ groups-n [ * dup ] keep + ] keep - groups-seq [ length min ] keep ; +M: groups group@ + [ n>> [ * dup ] keep + ] [ seq>> ] bi [ length min ] keep ; -M: groups nth - [ group@ ] keep - groups-sliced? [ ] [ subseq ] if ; +TUPLE: sliced-groups < groups ; -M: groups set-nth - group@ 0 swap copy ; +: ( seq n -- groups ) + sliced-groups construct-groups ; inline -M: groups like drop { } like ; +M: sliced-groups nth group@ ; -INSTANCE: groups sequence +TUPLE: clumps < abstract-groups ; + +: ( seq n -- groups ) + clumps construct-groups ; inline + +M: clumps length + [ seq>> length ] [ n>> ] bi - 1+ ; + +M: clumps set-length + [ n>> + 1- ] [ seq>> ] bi set-length ; + +M: clumps group@ + [ n>> over + ] [ seq>> ] bi ; + +TUPLE: sliced-clumps < groups ; + +: ( seq n -- groups ) + sliced-clumps construct-groups ; inline + +M: sliced-clumps nth group@ ; : group ( seq n -- array ) { } like ; +: clump ( seq n -- array ) { } like ; + : ?head ( seq begin -- newseq ? ) 2dup head? [ length tail t ] [ drop f ] if ; diff --git a/core/threads/threads-docs.factor b/core/threads/threads-docs.factor index 3f9ff54ac8..7d8791d493 100755 --- a/core/threads/threads-docs.factor +++ b/core/threads/threads-docs.factor @@ -116,10 +116,13 @@ $nl "Other threads may interrupt the sleep by calling " { $link interrupt } "." } ; HELP: sleep -{ $values { "ms" "a non-negative integer" } } -{ $description "Suspends the current thread for " { $snippet "ms" } " milliseconds." +{ $values { "dt" "a duration" } } +{ $description "Suspends the current thread for the given duration." $nl -"Other threads may interrupt the sleep by calling " { $link interrupt } "." } ; +"Other threads may interrupt the sleep by calling " { $link interrupt } "." } +{ $examples + { $code "USING: threads calendar ;" "10 seconds sleep" } +} ; HELP: interrupt { $values { "thread" thread } } diff --git a/core/threads/threads.factor b/core/threads/threads.factor index 8b89cd5732..cbca7ac029 100755 --- a/core/threads/threads.factor +++ b/core/threads/threads.factor @@ -93,7 +93,7 @@ PRIVATE> r check-registered dup r> sleep-queue heap-push* >>sleep-entry drop ; @@ -153,7 +153,7 @@ M: integer sleep-until M: f sleep-until drop [ drop ] "interrupt" suspend drop ; -GENERIC: sleep ( ms -- ) +GENERIC: sleep ( dt -- ) M: real sleep millis + >integer sleep-until ; diff --git a/extra/asn1/asn1-tests.factor b/extra/asn1/asn1-tests.factor index 329ba8256d..1908e28d39 100755 --- a/extra/asn1/asn1-tests.factor +++ b/extra/asn1/asn1-tests.factor @@ -1,16 +1,16 @@ USING: asn1 asn1.ldap io io.streams.string tools.test ; [ 6 ] [ - "\u000002\u000001\u000006" [ asn-syntax read-ber ] with-stream + "\u000002\u000001\u000006" [ asn-syntax read-ber ] with-input-stream ] unit-test [ "testing" ] [ - "\u000004\u000007testing" [ asn-syntax read-ber ] with-stream + "\u000004\u000007testing" [ asn-syntax read-ber ] with-input-stream ] unit-test [ { 1 { 3 "Administrator" "ad_is_bogus" } } ] [ "0$\u000002\u000001\u000001`\u00001f\u000002\u000001\u000003\u000004\rAdministrator\u000080\u00000bad_is_bogus" - [ asn-syntax read-ber ] with-stream + [ asn-syntax read-ber ] with-input-stream ] unit-test [ diff --git a/extra/asn1/asn1.factor b/extra/asn1/asn1.factor index 32e3602f8f..50102d1929 100644 --- a/extra/asn1/asn1.factor +++ b/extra/asn1/asn1.factor @@ -98,7 +98,7 @@ DEFER: read-ber SYMBOL: end -: (read-array) ( stream -- ) +: (read-array) ( -- ) elements get element-id [ elements get element-syntax read-ber dup end = [ drop ] [ , (read-array) ] if @@ -106,7 +106,7 @@ SYMBOL: end : read-array ( -- array ) [ (read-array) ] { } make ; -: set-case ( -- ) +: set-case ( -- object ) elements get element-newobj elements get element-objtype { { "boolean" [ "\0" = not ] } diff --git a/extra/benchmark/reverse-complement/reverse-complement.factor b/extra/benchmark/reverse-complement/reverse-complement.factor index d83b720187..5fdaf49d8f 100755 --- a/extra/benchmark/reverse-complement/reverse-complement.factor +++ b/extra/benchmark/reverse-complement/reverse-complement.factor @@ -32,13 +32,11 @@ HINTS: do-line vector string ; readln [ do-line (reverse-complement) ] [ show-seq ] if* ; : reverse-complement ( infile outfile -- ) - ascii [ - swap ascii [ - swap [ - 500000 (reverse-complement) - ] with-stream - ] with-disposal - ] with-disposal ; + ascii [ + ascii [ + 500000 (reverse-complement) + ] with-file-reader + ] with-file-writer ; : reverse-complement-in "reverse-complement-in.txt" temp-file ; diff --git a/extra/benchmark/sockets/sockets.factor b/extra/benchmark/sockets/sockets.factor index 25212c7264..1c33bfc4dc 100755 --- a/extra/benchmark/sockets/sockets.factor +++ b/extra/benchmark/sockets/sockets.factor @@ -1,6 +1,6 @@ USING: io.sockets io kernel math threads io.encodings.ascii -debugger tools.time prettyprint concurrency.count-downs -namespaces arrays continuations ; +io.streams.duplex debugger tools.time prettyprint +concurrency.count-downs namespaces arrays continuations ; IN: benchmark.sockets SYMBOL: counter @@ -30,17 +30,17 @@ SYMBOL: counter ] ignore-errors ; : simple-client ( -- ) - server-addr ascii [ + server-addr ascii [ CHAR: b write1 flush number-of-requests [ CHAR: a dup write1 flush read1 assert= ] times counter get count-down - ] with-stream ; + ] with-client ; : stop-server ( -- ) - server-addr ascii [ + server-addr ascii [ CHAR: x write1 - ] with-stream ; + ] with-client ; : clients ( n -- ) dup pprint " clients: " write [ diff --git a/extra/builder/util/util.factor b/extra/builder/util/util.factor index 3b0834b190..c40efaaa04 100644 --- a/extra/builder/util/util.factor +++ b/extra/builder/util/util.factor @@ -16,7 +16,7 @@ IN: builder.util : minutes>ms ( min -- ms ) 60 * 1000 * ; -: file>string ( file -- string ) utf8 [ stdio get contents ] with-file-reader ; +: file>string ( file -- string ) utf8 file-contents ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -107,5 +107,5 @@ USE: prettyprint ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : git-id ( -- id ) - { "git" "show" } utf8 [ readln ] with-stream + { "git" "show" } utf8 [ readln ] with-input-stream " " split second ; diff --git a/extra/checksums/md5/md5.factor b/extra/checksums/md5/md5.factor index 78494a40c0..a385f6d04f 100755 --- a/extra/checksums/md5/md5.factor +++ b/extra/checksums/md5/md5.factor @@ -180,4 +180,4 @@ SINGLETON: md5 INSTANCE: md5 checksum M: md5 checksum-stream ( stream -- byte-array ) - drop [ initialize-md5 stream>md5 get-md5 ] with-stream ; + drop [ initialize-md5 stream>md5 get-md5 ] with-input-stream ; diff --git a/extra/checksums/sha1/sha1.factor b/extra/checksums/sha1/sha1.factor index 2efab873bc..6427e0e8eb 100755 --- a/extra/checksums/sha1/sha1.factor +++ b/extra/checksums/sha1/sha1.factor @@ -111,7 +111,7 @@ SINGLETON: sha1 INSTANCE: sha1 checksum M: sha1 checksum-stream ( stream -- sha1 ) - drop [ initialize-sha1 stream>sha1 get-sha1 ] with-stream ; + drop [ initialize-sha1 stream>sha1 get-sha1 ] with-input-stream ; : sha1-interleave ( string -- seq ) [ zero? ] left-trim diff --git a/extra/concurrency/distributed/distributed.factor b/extra/concurrency/distributed/distributed.factor index 6704272305..c637f4baa3 100755 --- a/extra/concurrency/distributed/distributed.factor +++ b/extra/concurrency/distributed/distributed.factor @@ -3,7 +3,7 @@ USING: serialize sequences concurrency.messaging threads io io.server qualified arrays namespaces kernel io.encodings.binary accessors ; -QUALIFIED: io.sockets +FROM: io.sockets => host-name with-client ; IN: concurrency.distributed SYMBOL: local-node @@ -23,7 +23,7 @@ SYMBOL: local-node : start-node ( port -- ) [ internet-server ] - [ io.sockets:host-name swap io.sockets: ] bi + [ host-name swap ] bi (start-node) ; TUPLE: remote-process id node ; @@ -31,8 +31,7 @@ TUPLE: remote-process id node ; C: remote-process : send-remote-message ( message node -- ) - binary io.sockets: - [ serialize ] with-stream ; + binary [ serialize ] with-client ; M: remote-process send ( message thread -- ) [ id>> 2array ] [ node>> ] bi diff --git a/extra/contributors/contributors.factor b/extra/contributors/contributors.factor index 868e968169..4b7acb468c 100755 --- a/extra/contributors/contributors.factor +++ b/extra/contributors/contributors.factor @@ -7,7 +7,7 @@ IN: contributors : changelog ( -- authors ) image parent-directory [ - "git-log --pretty=format:%an" lines + "git-log --pretty=format:%an" lines ] with-directory ; : patch-counts ( authors -- assoc ) diff --git a/extra/cpu/8080/test/test.factor b/extra/cpu/8080/test/test.factor index 85f27d7e40..f88db2935f 100755 --- a/extra/cpu/8080/test/test.factor +++ b/extra/cpu/8080/test/test.factor @@ -1,5 +1,5 @@ USING: kernel cpu.8080 cpu.8080.emulator math math io -tools.time combinators sequences io.files ; +tools.time combinators sequences io.files io.encodings.ascii ; IN: cpu.8080.test : step ( cpu -- ) @@ -29,7 +29,7 @@ IN: cpu.8080.test : >ppm ( cpu filename -- cpu ) #! Dump the current screen image to a ppm image file with the given name. - [ + ascii [ "P3" print "256 224" print "1" print @@ -45,7 +45,7 @@ IN: cpu.8080.test ] each-8bit drop ] each drop nl ] each - ] with-stream ; + ] with-file-writer ; : time-test ( -- ) test-cpu [ 1000000 run-n drop ] time ; diff --git a/extra/crypto/hmac/hmac.factor b/extra/crypto/hmac/hmac.factor index fe77aa8969..6e30f19775 100755 --- a/extra/crypto/hmac/hmac.factor +++ b/extra/crypto/hmac/hmac.factor @@ -30,7 +30,7 @@ MEMO: opad ( -- seq ) 64 HEX: 5c ; ipad seq-bitxor ; : stream>sha1-hmac ( K stream -- hmac ) - [ init-hmac sha1-hmac ] with-stream ; + [ init-hmac sha1-hmac ] with-input-stream ; : file>sha1-hmac ( K path -- hmac ) binary stream>sha1-hmac ; @@ -39,7 +39,7 @@ MEMO: opad ( -- seq ) 64 HEX: 5c ; binary stream>sha1-hmac ; : stream>md5-hmac ( K stream -- hmac ) - [ init-hmac md5-hmac ] with-stream ; + [ init-hmac md5-hmac ] with-input-stream ; : file>md5-hmac ( K path -- hmac ) binary stream>md5-hmac ; diff --git a/extra/csv/csv.factor b/extra/csv/csv.factor index b1953f5b57..8ba0832b29 100644 --- a/extra/csv/csv.factor +++ b/extra/csv/csv.factor @@ -61,11 +61,11 @@ VAR: delimiter : csv-row ( stream -- row ) init-vars - [ row nip ] with-stream ; + [ row nip ] with-input-stream ; : csv ( stream -- rows ) init-vars - [ [ (csv) ] { } make ] with-stream ; + [ [ (csv) ] { } make ] with-input-stream ; : with-delimiter ( char quot -- ) delimiter swap with-variable ; inline diff --git a/extra/delegate/protocols/protocols.factor b/extra/delegate/protocols/protocols.factor index f1ad068fe2..c1d7e1e4ab 100755 --- a/extra/delegate/protocols/protocols.factor +++ b/extra/delegate/protocols/protocols.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: delegate sequences.private sequences assocs prettyprint.sections -io definitions kernel continuations ; +io definitions kernel continuations listener ; IN: delegate.protocols PROTOCOL: sequence-protocol @@ -12,8 +12,10 @@ PROTOCOL: assoc-protocol at* assoc-size >alist set-at assoc-clone-like { assoc-find 1 } delete-at clear-assoc new-assoc assoc-like ; -PROTOCOL: stream-protocol - stream-read1 stream-read stream-read-until dispose +PROTOCOL: input-stream-protocol + stream-read1 stream-read stream-read-until stream-read-quot ; + +PROTOCOL: output-stream-protocol stream-flush stream-write1 stream-write stream-format stream-nl make-span-stream make-block-stream stream-readln make-cell-stream stream-write-table ; diff --git a/extra/destructors/destructors.factor b/extra/destructors/destructors.factor index c3914e9c93..6fc7ab249f 100755 --- a/extra/destructors/destructors.factor +++ b/extra/destructors/destructors.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: continuations io.backend libc kernel namespaces -sequences system vectors ; +USING: continuations io.backend io.nonblocking libc kernel +namespaces sequences system vectors ; IN: destructors SYMBOL: error-destructors @@ -59,10 +59,8 @@ TUPLE: handle-destructor alien ; C: handle-destructor -HOOK: destruct-handle io-backend ( obj -- ) - M: handle-destructor dispose ( obj -- ) - handle-destructor-alien destruct-handle ; + handle-destructor-alien close-handle ; : close-always ( handle -- ) add-always-destructor ; diff --git a/extra/editors/jedit/jedit.factor b/extra/editors/jedit/jedit.factor index e4f19781ef..fe9abc0e76 100755 --- a/extra/editors/jedit/jedit.factor +++ b/extra/editors/jedit/jedit.factor @@ -25,11 +25,11 @@ IN: editors.jedit ] with-byte-writer ; : send-jedit-request ( request -- ) - jedit-server-info "localhost" rot binary [ + jedit-server-info "localhost" rot binary [ 4 >be write dup length 2 >be write write - ] with-stream ; + ] with-client ; : jedit-location ( file line -- ) number>string "+line:" prepend 2array diff --git a/extra/fry/fry-docs.factor b/extra/fry/fry-docs.factor index 84d02d529d..7a444fecbc 100755 --- a/extra/fry/fry-docs.factor +++ b/extra/fry/fry-docs.factor @@ -87,7 +87,7 @@ $nl } ; ARTICLE: "fry.limitations" "Fried quotation limitations" -"As with " { $link "locals" } ", fried quotations cannot contain " { $link >r } " and " { $link r> } ". Unlike " { $link "locals" } ", using " { $link dip } " is not a suitable workaround since unlike closure conversion, fry conversion is not recursive, and so the quotation passed to " { $link dip } " cannot contain fry specifiers." ; +"As with " { $vocab-link "locals" } ", fried quotations cannot contain " { $link >r } " and " { $link r> } "." ; ARTICLE: "fry" "Fried quotations" "A " { $emphasis "fried quotation" } " differs from a literal quotation in that when it is evaluated, instead of just pushing itself on the stack, it consumes zero or more stack values and inserts them into the quotation." diff --git a/extra/fry/fry-tests.factor b/extra/fry/fry-tests.factor index 7586e254b2..eb59ffae4e 100755 --- a/extra/fry/fry-tests.factor +++ b/extra/fry/fry-tests.factor @@ -48,3 +48,7 @@ sequences ; [ { 1 2 3 } ] [ 3 1 '[ , [ , + ] map ] call ] unit-test + +[ { 1 { 2 { 3 } } } ] [ + 1 2 3 '[ , [ , [ , 1array ] call 2array ] call 2array ] call +] unit-test diff --git a/extra/fry/fry.factor b/extra/fry/fry.factor index 1b9e2dc82b..27a321ed92 100755 --- a/extra/fry/fry.factor +++ b/extra/fry/fry.factor @@ -54,7 +54,7 @@ DEFER: (shallow-fry) [ { , namespaces:, @ } member? ] filter length \ , % ] - [ deep-fry % ] bi + [ fry % ] bi ] [ namespaces:, ] if ] each ] [ ] make deep-fry ; diff --git a/core/io/streams/duplex/authors.txt b/extra/geo-ip/authors.txt similarity index 100% rename from core/io/streams/duplex/authors.txt rename to extra/geo-ip/authors.txt diff --git a/extra/geo-ip/geo-ip.factor b/extra/geo-ip/geo-ip.factor new file mode 100644 index 0000000000..5926dd596d --- /dev/null +++ b/extra/geo-ip/geo-ip.factor @@ -0,0 +1,46 @@ +USING: kernel sequences io.files io.launcher io.encodings.ascii +io.streams.string http.client sequences.lib combinators +math.parser math.vectors math.intervals interval-maps memoize +csv accessors assocs strings math splitting ; +IN: geo-ip + +: db-path "IpToCountry.csv" temp-file ; + +: db-url "http://software77.net/cgi-bin/ip-country/geo-ip.pl?action=download" ; + +: download-db ( -- path ) + db-path dup exists? [ + db-url over ".gz" append download-to + { "gunzip" } over ".gz" append (normalize-path) suffix try-process + ] unless ; + +TUPLE: ip-entry from to registry assigned city cntry country ; + +: parse-ip-entry ( row -- ip-entry ) + 7 firstn { + [ string>number ] + [ string>number ] + [ ] + [ ] + [ ] + [ ] + [ ] + } spread ip-entry boa ; + +MEMO: ip-db ( -- seq ) + download-db ascii file-lines + [ "#" head? not ] filter "\n" join csv + [ parse-ip-entry ] map ; + +MEMO: ip-intervals ( -- interval-map ) + ip-db [ [ [ from>> ] [ to>> ] bi [a,b] ] keep ] { } map>assoc + ; + +GENERIC: lookup-ip ( ip -- ip-entry ) + +M: string lookup-ip + "." split [ string>number ] map + { HEX: 1000000 HEX: 10000 HEX: 100 1 } v. + lookup-ip ; + +M: integer lookup-ip ip-intervals interval-at ; diff --git a/extra/geo-ip/summary.txt b/extra/geo-ip/summary.txt new file mode 100644 index 0000000000..402d3230f1 --- /dev/null +++ b/extra/geo-ip/summary.txt @@ -0,0 +1 @@ +IP address geolocation using database from http://software77.net/cgi-bin/ip-country/ diff --git a/extra/geo-ip/tags.txt b/extra/geo-ip/tags.txt new file mode 100644 index 0000000000..0aef4feca8 --- /dev/null +++ b/extra/geo-ip/tags.txt @@ -0,0 +1 @@ +enterprise diff --git a/extra/gesture-logger/gesture-logger.factor b/extra/gesture-logger/gesture-logger.factor index 1977efd3f9..b9de7c1b74 100644 --- a/extra/gesture-logger/gesture-logger.factor +++ b/extra/gesture-logger/gesture-logger.factor @@ -15,13 +15,13 @@ TUPLE: gesture-logger stream ; M: gesture-logger handle-gesture* drop dup T{ button-down } = [ over request-focus ] when - swap gesture-logger-stream [ . ] with-stream* + swap gesture-logger-stream [ . ] with-output-stream* t ; M: gesture-logger user-input* gesture-logger-stream [ "User input: " write print - ] with-stream* t ; + ] with-output-stream* t ; : gesture-logger ( -- ) [ diff --git a/extra/help/cookbook/cookbook.factor b/extra/help/cookbook/cookbook.factor index 995b8540f5..c2e12469c5 100755 --- a/extra/help/cookbook/cookbook.factor +++ b/extra/help/cookbook/cookbook.factor @@ -205,8 +205,8 @@ ARTICLE: "cookbook-io" "Input and output cookbook" } "Send some bytes to a remote host:" { $code - "\"myhost\" 1033 " - "[ { 12 17 102 } >string write ] with-stream" + "\"myhost\" 1033 " + "[ { 12 17 102 } >string write ] with-client" } { $references { } diff --git a/extra/help/handbook/handbook.factor b/extra/help/handbook/handbook.factor index a9e94466c4..a8271a0e3b 100755 --- a/extra/help/handbook/handbook.factor +++ b/extra/help/handbook/handbook.factor @@ -31,7 +31,7 @@ $nl { { $snippet "set-" { $emphasis "foo" } } { "sets " { $snippet "foo" } " to a new value" } { $links set-length } } { { $snippet { $emphasis "foo" } "-" { $emphasis "bar" } } { "(tuple accessors) outputs the value of the " { $snippet "bar" } " slot of the " { $snippet "foo" } " at the top of the stack" } { } } { { $snippet "set-" { $emphasis "foo" } "-" { $emphasis "bar" } } { "(tuple mutators) sets the value of the " { $snippet "bar" } " slot of the " { $snippet "foo" } " at the top of the stack" } { } } - { { $snippet "with-" { $emphasis "foo" } } { "performs some kind of initialization and cleanup related to " { $snippet "foo" } ", usually in a new dynamic scope" } { $links with-scope with-stream } } + { { $snippet "with-" { $emphasis "foo" } } { "performs some kind of initialization and cleanup related to " { $snippet "foo" } ", usually in a new dynamic scope" } { $links with-scope with-input-stream with-output-stream } } { { $snippet "$" { $emphasis "foo" } } { "help markup" } { $links $heading $emphasis } } } { $heading "Stack effect conventions" } @@ -193,17 +193,19 @@ ARTICLE: "io" "Input and output" "Utilities:" { $subsection "stream-binary" } { $subsection "styles" } -{ $heading "Files" } -{ $subsection "io.files" } -{ $subsection "io.mmap" } -{ $subsection "io.monitors" } { $heading "Encodings" } { $subsection "encodings-introduction" } { $subsection "io.encodings" } { $subsection "io.encodings.string" } -{ $heading "Other features" } +{ $heading "Files" } +{ $subsection "io.files" } +{ $subsection "io.mmap" } +{ $subsection "io.monitors" } +{ $heading "Communications" } { $subsection "network-streams" } { $subsection "io.launcher" } +{ $subsection "io.pipes" } +{ $heading "Other features" } { $subsection "io.timeouts" } { $subsection "checksums" } ; diff --git a/extra/help/help-docs.factor b/extra/help/help-docs.factor index d4981751e2..f20ce89263 100755 --- a/extra/help/help-docs.factor +++ b/extra/help/help-docs.factor @@ -126,7 +126,7 @@ HELP: $title HELP: help { $values { "topic" "an article name or a word" } } { $description - "Displays a help article or documentation associated to a word on the " { $link stdio } " stream." + "Displays a help article or documentation associated to a word on " { $link output-stream } "." } ; HELP: about @@ -151,7 +151,7 @@ HELP: $index HELP: ($index) { $values { "articles" "a sequence of help articles" } } -{ $description "Writes a list of " { $link $subsection } " elements to the " { $link stdio } " stream." } ; +{ $description "Writes a list of " { $link $subsection } " elements to " { $link output-stream } "." } ; HELP: xref-help { $description "Update help cross-referencing. Usually this is done automatically." } ; @@ -168,11 +168,11 @@ HELP: $predicate HELP: print-element { $values { "element" "a markup element" } } -{ $description "Prints a markup element to the " { $link stdio } " stream." } ; +{ $description "Prints a markup element to " { $link output-stream } "." } ; HELP: print-content { $values { "element" "a markup element" } } -{ $description "Prints a top-level markup element to the " { $link stdio } " stream." } ; +{ $description "Prints a top-level markup element to " { $link output-stream } "." } ; HELP: simple-element { $class-description "Class of simple elements, which are just arrays of elements." } ; diff --git a/extra/help/tutorial/tutorial.factor b/extra/help/tutorial/tutorial.factor index fffcda69b6..cafa758c7e 100755 --- a/extra/help/tutorial/tutorial.factor +++ b/extra/help/tutorial/tutorial.factor @@ -135,7 +135,7 @@ $nl { $code "[ Letter? ] filter >lower" } "This code starts with a string on the stack, removes non-alphabetical characters, and converts the result to lower case, leaving a new string on the stack. We put this code in a new word, and add the new word to " { $snippet "palindrome.factor" } ":" { $code ": normalize ( str -- newstr ) [ Letter? ] filter >lower ;" } -"You will need to add " { $vocab-link "unicode.categories" } " to the vocabulary search path, so that " { $link Letter? } " can be used in the source file." +"You will need to add " { $vocab-link "unicode.case" } " and " { $vocab-link "unicode.categories" } " to the vocabulary search path, so that " { $link Letter? } " can be used in the source file." $nl "We modify " { $snippet "palindrome?" } " to first apply " { $snippet "normalize" } " to its input:" { $code ": palindrome? ( str -- ? ) normalize dup reverse = ;" } diff --git a/extra/html/html-tests.factor b/extra/html/html-tests.factor index ce320ca75b..9f1ce6b689 100644 --- a/extra/html/html-tests.factor +++ b/extra/html/html-tests.factor @@ -24,7 +24,7 @@ IN: html.tests ] unit-test [ "<" ] [ - [ "<" H{ } stdio get format-html-span ] make-html-string + [ "<" H{ } output-stream get format-html-span ] make-html-string ] unit-test TUPLE: funky town ; diff --git a/extra/html/html.factor b/extra/html/html.factor index 7a0fa17c9a..c154c35223 100755 --- a/extra/html/html.factor +++ b/extra/html/html.factor @@ -44,7 +44,7 @@ TUPLE: html-sub-stream style stream ; rot html-sub-stream-stream ; : delegate-write ( string -- ) - stdio get delegate stream-write ; + output-stream get delegate stream-write ; : object-link-tag ( style quot -- ) presented pick at [ @@ -101,7 +101,7 @@ TUPLE: html-sub-stream style stream ; : format-html-span ( string style stream -- ) [ [ [ drop delegate-write ] span-tag ] object-link-tag - ] with-stream* ; + ] with-output-stream* ; TUPLE: html-span-stream ; @@ -134,7 +134,7 @@ M: html-span-stream dispose : format-html-div ( string style stream -- ) [ [ [ delegate-write ] div-tag ] object-link-tag - ] with-stream* ; + ] with-output-stream* ; TUPLE: html-block-stream ; @@ -184,17 +184,17 @@ M: html-stream stream-write-table ( grid style stream -- ) ] with each ] with each - ] with-stream* ; + ] with-output-stream* ; M: html-stream make-cell-stream ( style stream -- stream' ) (html-sub-stream) ; M: html-stream stream-nl ( stream -- ) - dup test-last-div? [ drop ] [ [
] with-stream* ] if ; + dup test-last-div? [ drop ] [ [
] with-output-stream* ] if ; ! Utilities : with-html-stream ( quot -- ) - stdio get swap with-stream* ; inline + output-stream get swap with-output-stream* ; inline : xhtml-preamble "" write-html diff --git a/extra/http/client/client.factor b/extra/http/client/client.factor index 7762b01843..17882277a3 100755 --- a/extra/http/client/client.factor +++ b/extra/http/client/client.factor @@ -3,7 +3,8 @@ USING: assocs http kernel math math.parser namespaces sequences io io.sockets io.streams.string io.files io.timeouts strings splitting calendar continuations accessors vectors math.order -io.encodings.8-bit io.encodings.binary fry debugger inspector ; +io.encodings.8-bit io.encodings.binary io.streams.duplex +fry debugger inspector ; IN: http.client : max-redirects 10 ; @@ -26,73 +27,56 @@ DEFER: http-request : store-path ( request path -- request ) "?" split1 >r >>path r> dup [ query>assoc ] when >>query ; -: request-with-url ( url request -- request ) - swap parse-url >r >r store-path r> >>host r> >>port ; - -! This is all pretty complex because it needs to handle -! HTTP redirects, which might be absolute or relative -: absolute-redirect ( url -- request ) - request get request-with-url ; - -: relative-redirect ( path -- request ) - request get swap store-path ; +: request-with-url ( request url -- request ) + parse-url >r >r store-path r> >>host r> >>port ; SYMBOL: redirects : absolute-url? ( url -- ? ) [ "http://" head? ] [ "https://" head? ] bi or ; -: do-redirect ( response -- response stream ) - dup response-code 300 399 between? [ - stdio get dispose +: do-redirect ( response data -- response data ) + over code>> 300 399 between? [ + drop redirects inc redirects get max-redirects < [ - header>> "location" swap at - dup absolute-url? [ - absolute-redirect - ] [ - relative-redirect - ] if "GET" >>method http-request + request get + swap "location" header dup absolute-url? + [ request-with-url ] [ store-path ] if + "GET" >>method http-request ] [ too-many-redirects ] if - ] [ - stdio get - ] if ; - -: close-on-error ( stream quot -- ) - '[ , with-stream* ] [ ] pick '[ , dispose ] cleanup ; inline + ] when ; PRIVATE> -: http-request ( request -- response stream ) - dup request [ - dup request-addr latin1 - 1 minutes over set-timeout - [ - write-request flush - read-response - do-redirect - ] close-on-error - ] with-variable ; - : read-chunks ( -- ) read-crlf ";" split1 drop hex> dup { f 0 } member? [ drop ] [ read % read-crlf "" assert= read-chunks ] if ; -: do-chunked-encoding ( response stream -- response stream/string ) - over "transfer-encoding" header "chunked" = [ - [ [ read-chunks ] "" make ] with-stream - ] when ; +: read-response-body ( response -- response data ) + dup "transfer-encoding" header "chunked" = + [ [ read-chunks ] "" make ] [ input-stream get contents ] if ; + +: http-request ( request -- response data ) + dup request [ + dup request-addr latin1 [ + 1 minutes timeouts + write-request + read-response + read-response-body + ] with-client + do-redirect + ] with-variable ; : ( url -- request ) - request-with-url "GET" >>method ; + + swap request-with-url + "GET" >>method ; -: string-or-contents ( stream/string -- string ) - dup string? [ contents ] unless ; - -: http-get-stream ( url -- response stream/string ) - http-request do-chunked-encoding ; +: http-get* ( url -- response data ) + http-request ; : success? ( code -- ? ) 200 = ; @@ -112,29 +96,24 @@ M: download-failed error. over code>> success? [ nip ] [ download-failed ] if ; : http-get ( url -- string ) - http-get-stream string-or-contents check-response ; + http-get* check-response ; : download-name ( url -- name ) file-name "?" split1 drop "/" ?tail drop ; : download-to ( url file -- ) #! Downloads the contents of a URL to a file. - swap http-get-stream check-response - dup string? [ - latin1 [ write ] with-file-writer - ] [ - [ swap latin1 stream-copy ] with-disposal - ] if ; + >r http-get r> latin1 [ write ] with-file-writer ; : download ( url -- ) dup download-name download-to ; : ( content-type content url -- request ) - request-with-url - "POST" >>method - swap >>post-data - swap >>post-data-type ; + "POST" >>method + swap request-with-url + swap >>post-data + swap >>post-data-type ; -: http-post ( content-type content url -- response string ) - http-request do-chunked-encoding string-or-contents ; +: http-post ( content-type content url -- response data ) + http-request ; diff --git a/extra/http/http-tests.factor b/extra/http/http-tests.factor index 76c48d38f1..07b34f17c3 100755 --- a/extra/http/http-tests.factor +++ b/extra/http/http-tests.factor @@ -31,6 +31,7 @@ IN: http.tests [ H{ { "a" { "b" "c" } } } ] [ "a=b&a=c" query>assoc ] unit-test [ "a=3" ] [ { { "a" 3 } } assoc>query ] unit-test + : lf>crlf "\n" split "\r\n" join ; STRING: read-request-test-1 @@ -183,12 +184,12 @@ test-db [ ! Try with a slightly malformed request [ t ] [ - "localhost" 1237 ascii [ + "localhost" 1237 ascii [ "GET nested HTTP/1.0\r\n" write flush "\r\n" write flush read-crlf drop read-header - ] with-stream "location" swap at "/" head? + ] with-client "location" swap at "/" head? ] unit-test [ "http://localhost:1237/redirect-loop" http-get ] diff --git a/extra/http/http.factor b/extra/http/http.factor index 98c1d8e74c..786210123d 100755 --- a/extra/http/http.factor +++ b/extra/http/http.factor @@ -472,7 +472,7 @@ M: string write-response-body* write ; M: callable write-response-body* call ; -M: object write-response-body* stdio get stream-copy ; +M: object write-response-body* output-stream get stream-copy ; : write-response-body ( response -- response ) dup body>> write-response-body* ; diff --git a/extra/http/server/auth/admin/admin.factor b/extra/http/server/auth/admin/admin.factor index e762103d7b..21e1a6181b 100644 --- a/extra/http/server/auth/admin/admin.factor +++ b/extra/http/server/auth/admin/admin.factor @@ -82,10 +82,8 @@ IN: http.server.auth.admin same-password-twice - user new "username" value >>username select-tuple [ - user-exists? on - validation-failed - ] when + user new "username" value >>username select-tuple + [ user-exists ] when "username" value "realname" value >>realname diff --git a/extra/http/server/cgi/cgi.factor b/extra/http/server/cgi/cgi.factor index 509943faa8..20eb7318d0 100755 --- a/extra/http/server/cgi/cgi.factor +++ b/extra/http/server/cgi/cgi.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: namespaces kernel assocs io.files combinators -arrays io.launcher io http.server.static http.server +USING: namespaces kernel assocs io.files io.streams.duplex +combinators arrays io.launcher io http.server.static http.server http accessors sequences strings math.parser fry ; IN: http.server.cgi @@ -51,9 +51,9 @@ IN: http.server.cgi 200 >>code "CGI output follows" >>message swap '[ - , stdio get swap [ + , output-stream get swap [ post? [ request get post-data>> write flush ] when - stdio get swap (stream-copy) + input-stream get swap (stream-copy) ] with-stream ] >>body ; diff --git a/extra/http/server/server.factor b/extra/http/server/server.factor index f6dd6c57bb..70c1e9a1f5 100755 --- a/extra/http/server/server.factor +++ b/extra/http/server/server.factor @@ -260,15 +260,13 @@ SYMBOL: exit-continuation bi ] recover ; -: default-timeout 1 minutes stdio get set-timeout ; - : ?refresh-all ( -- ) development-mode get-global [ global [ refresh-all ] bind ] when ; : handle-client ( -- ) [ - default-timeout + 1 minutes timeouts ?refresh-all read-request do-request diff --git a/extra/http/server/static/static.factor b/extra/http/server/static/static.factor index 2ecc347d76..b9a8e9d46e 100755 --- a/extra/http/server/static/static.factor +++ b/extra/http/server/static/static.factor @@ -36,7 +36,7 @@ TUPLE: file-responder root hook special allow-listings ; [ size>> "content-length" set-header ] [ modified>> "last-modified" set-header ] bi ] - [ '[ , binary stdio get stream-copy ] >>body ] bi + [ '[ , binary output-stream get stream-copy ] >>body ] bi ] ; : serve-static ( filename mime-type -- response ) diff --git a/extra/interval-maps/authors.txt b/extra/interval-maps/authors.txt new file mode 100755 index 0000000000..504363d316 --- /dev/null +++ b/extra/interval-maps/authors.txt @@ -0,0 +1 @@ +Daniel Ehrenberg diff --git a/extra/interval-maps/interval-maps-docs.factor b/extra/interval-maps/interval-maps-docs.factor new file mode 100755 index 0000000000..1a862fbe2d --- /dev/null +++ b/extra/interval-maps/interval-maps-docs.factor @@ -0,0 +1,29 @@ +USING: help.markup help.syntax ; +IN: interval-maps + +HELP: interval-at* +{ $values { "key" "an object" } { "map" "an interval map" } { "value" "the value for the key, or f" } { "?" "whether the key is present" } } +{ $description "Looks up a key in an interval map, returning the corresponding value if the item is in an interval in the map, and a boolean flag. The operation takes O(log n) time." } ; + +HELP: interval-at +{ $values { "key" "an object" } { "map" "an interval map" } { "value" "the value for the key, or f" } } +{ $description "Looks up a key in an interval map, returning the value of the corresponding interval, or f if the interval is not present in the map." } ; + +HELP: interval-key? +{ $values { "key" "an object" } { "map" "an interval map" } { "?" "a boolean" } } +{ $description "Tests whether an object is in an interval in the interval map, returning t if the object is present." } ; + +HELP: +{ $values { "specification" "an assoc" } { "map" "an interval map" } } +{ $description "From a specification, produce an interval tree. The specification is an assoc where the keys are intervals, or pairs of numbers to represent intervals, or individual numbers to represent singleton intervals. The values are the values int he interval map. Construction time is O(n log n)." } ; + +ARTICLE: "interval-maps" "Interval maps" +"Interval maps are a mechanism, similar to assocs, where a set of closed intervals of keys are associated with values. As such, interval maps do not conform to the assoc protocol, because intervals of floats, for example, can be used, and it is impossible to get a list of keys in between." +"The following operations are used to query interval maps:" +{ $subsection interval-at* } +{ $subsection interval-at } +{ $subsection interval-key? } +"Use the following to construct interval maps" +{ $subsection } ; + +ABOUT: "interval-maps" diff --git a/extra/interval-maps/interval-maps-tests.factor b/extra/interval-maps/interval-maps-tests.factor new file mode 100755 index 0000000000..54d2e9d26b --- /dev/null +++ b/extra/interval-maps/interval-maps-tests.factor @@ -0,0 +1,13 @@ +USING: kernel namespaces interval-maps tools.test ; +IN: interval-maps.test + +SYMBOL: test + +[ ] [ { { { 4 8 } 3 } { 1 2 } } test set ] unit-test +[ 3 ] [ 5 test get interval-at ] unit-test +[ 3 ] [ 8 test get interval-at ] unit-test +[ 3 ] [ 4 test get interval-at ] unit-test +[ f ] [ 9 test get interval-at ] unit-test +[ 2 ] [ 1 test get interval-at ] unit-test +[ f ] [ 2 test get interval-at ] unit-test +[ f ] [ 0 test get interval-at ] unit-test diff --git a/extra/interval-maps/interval-maps.factor b/extra/interval-maps/interval-maps.factor new file mode 100755 index 0000000000..bc23d0d346 --- /dev/null +++ b/extra/interval-maps/interval-maps.factor @@ -0,0 +1,41 @@ +USING: kernel sequences arrays math.intervals accessors +math.order sorting math assocs ; +IN: interval-maps + +TUPLE: interval-map array ; + +> from>> first <=> ] binsearch ; + +GENERIC: >interval ( object -- interval ) +M: number >interval [a,a] ; +M: sequence >interval first2 [a,b] ; +M: interval >interval ; + +: all-intervals ( sequence -- intervals ) + [ >r >interval r> ] assoc-map ; + +: ensure-disjoint ( intervals -- intervals ) + dup keys [ interval-intersect not ] monotonic? + [ "Intervals are not disjoint" throw ] unless ; +PRIVATE> + +: interval-at* ( key map -- value ? ) + array>> [ find-interval ] 2keep swapd nth + [ nip value>> ] [ interval>> interval-contains? ] 2bi + fixup-value ; + +: interval-at ( key map -- value ) interval-at* drop ; +: interval-key? ( key map -- ? ) interval-at* nip ; + +: ( specification -- map ) + all-intervals ensure-disjoint + [ [ first to>> ] compare ] sort + [ interval-node boa ] { } assoc>map + interval-map boa ; diff --git a/extra/interval-maps/summary.txt b/extra/interval-maps/summary.txt new file mode 100755 index 0000000000..d25263260e --- /dev/null +++ b/extra/interval-maps/summary.txt @@ -0,0 +1 @@ +Interval maps for disjoint closed ranges diff --git a/extra/interval-maps/tags.txt b/extra/interval-maps/tags.txt new file mode 100755 index 0000000000..5e9549f425 --- /dev/null +++ b/extra/interval-maps/tags.txt @@ -0,0 +1 @@ +collections diff --git a/extra/io/launcher/launcher-docs.factor b/extra/io/launcher/launcher-docs.factor index dadb627fc0..45bbec20e3 100755 --- a/extra/io/launcher/launcher-docs.factor +++ b/extra/io/launcher/launcher-docs.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: help.markup help.syntax quotations kernel io math -calendar ; +USING: help.markup help.syntax quotations kernel io io.files +math calendar ; IN: io.launcher ARTICLE: "io.launcher.command" "Specifying a command" @@ -26,10 +26,10 @@ $nl "To specify redirection, set the " { $snippet "stdin" } ", " { $snippet "stdout" } " and " { $snippet "stderr" } " slots of a " { $link process } " to one of the following values:" { $list { { $link f } " - default value; the stream is either inherited from the current process, or is a " { $link } " pipe" } - { { $link +inherit+ } " - the stream is inherited from the current process, overriding a " { $link } " pipe" } { { $link +closed+ } " - the stream is closed; reads will return end of file and writes will fails" } { { $link +stdout+ } " - a special value for the " { $snippet "stderr" } " slot only, indicating that the standard output and standard error streams should be merged" } { "a path name - the stream is sent to the given file, which must exist for input and is created automatically on output" } + { "an " { $link appender } " wrapping a path name - output is sent to the end given file, as with " { $link } } { "a file stream or a socket - the stream is connected to the given Factor stream, which cannot be used again from within Factor and must be closed after the process has been started" } } ; @@ -47,12 +47,16 @@ ARTICLE: "io.launcher.priority" "Setting process priority" HELP: +closed+ { $description "Possible value for the " { $snippet "stdin" } ", " { $snippet "stdout" } ", and " { $snippet "stderr" } " slots of a " { $link process } "." } ; -HELP: +inherit+ -{ $description "Possible value for the " { $snippet "stdin" } ", " { $snippet "stdout" } ", and " { $snippet "stderr" } " slots of a " { $link process } "." } ; - HELP: +stdout+ { $description "Possible value for the " { $snippet "stderr" } " slot of a " { $link process } "." } ; +HELP: appender +{ $class-description "An object representing a file to append to. Instances are created with " { $link } "." } ; + +HELP: +{ $values { "path" "a pathname string" } { "appender" appender } } +{ $description "Creates an object which may be stored in the " { $snippet "stdout" } " or " { $snippet "stderr" } " slot of a " { $link process } " instance." } ; + HELP: +prepend-environment+ { $description "Possible value of " { $snippet "environment-mode" } " slot of a " { $link process } "." $nl @@ -138,13 +142,6 @@ HELP: { "stream" "a bidirectional stream" } } { $description "Launches a process and redirects its input and output via a pair of pipes which may be read and written as a stream of the given encoding." } ; -HELP: with-process-stream -{ $values - { "desc" "a launch descriptor" } - { "quot" quotation } - { "status" "an exit code" } } -{ $description "Calls " { $snippet "quot" } " in a dynamic scope where " { $link stdio } " is rebound to a process stream. After the quotation returns, waits for the process to end and outputs the exit code." } ; - HELP: wait-for-process { $values { "process" process } { "status" integer } } { $description "If the process is still running, waits for it to exit, otherwise outputs the exit code immediately. Can be called multiple times on the same process." } ; @@ -175,8 +172,9 @@ ARTICLE: "io.launcher.launch" "Launching processes" { $subsection try-process } { $subsection run-detached } "Redirecting standard input and output to a pipe:" -{ $subsection } -{ $subsection with-process-stream } ; +{ $subsection } +{ $subsection } +{ $subsection } ; ARTICLE: "io.launcher.examples" "Launcher examples" "Starting a command and waiting for it to finish:" @@ -212,7 +210,7 @@ ARTICLE: "io.launcher.examples" "Launcher examples" " " " swap >>stderr" " \"report\" >>command" - " ascii lines sort reverse [ print ] each" + " ascii lines sort reverse [ print ] each" "] with-disposal" } ; diff --git a/extra/io/launcher/launcher-tests.factor b/extra/io/launcher/launcher-tests.factor index bacb8eb5a9..003f382020 100755 --- a/extra/io/launcher/launcher-tests.factor +++ b/extra/io/launcher/launcher-tests.factor @@ -2,3 +2,5 @@ IN: io.launcher.tests USING: tools.test io.launcher ; \ must-infer +\ must-infer +\ must-infer diff --git a/extra/io/launcher/launcher.factor b/extra/io/launcher/launcher.factor index 6ee8660528..286febd589 100755 --- a/extra/io/launcher/launcher.factor +++ b/extra/io/launcher/launcher.factor @@ -1,9 +1,10 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io io.backend io.timeouts system kernel namespaces -strings hashtables sequences assocs combinators vocabs.loader -init threads continuations math io.encodings io.streams.duplex -io.nonblocking accessors concurrency.flags ; +USING: io io.backend io.timeouts io.pipes system kernel +namespaces strings hashtables sequences assocs combinators +vocabs.loader init threads continuations math io.encodings +io.streams.duplex io.nonblocking io.streams.duplex accessors +concurrency.flags destructors ; IN: io.launcher TUPLE: process < identity-tuple @@ -26,9 +27,12 @@ handle status killed ; SYMBOL: +closed+ -SYMBOL: +inherit+ SYMBOL: +stdout+ +TUPLE: appender path ; + +: ( path -- appender ) appender boa ; + SYMBOL: +prepend-environment+ SYMBOL: +replace-environment+ SYMBOL: +append-environment+ @@ -145,20 +149,67 @@ M: process set-timeout set-process-timeout ; M: process timed-out kill-process ; -HOOK: (process-stream) io-backend ( process -- handle in out ) +M: object pipeline-element-quot + [ + >process + swap >>stdout + swap >>stdin + run-detached + ] curry ; -: ( desc encoding -- stream process ) - >r >process dup dup (process-stream) - r> -roll - process-started ; +M: process wait-for-pipeline-element wait-for-process ; + +: ( process encoding -- process stream ) + [ + >r (pipe) { + [ add-error-destructor ] + [ + swap >process + [ swap out>> or ] change-stdout + run-detached + ] + [ out>> close-handle ] + [ in>> ] + } cleave r> + ] with-destructors ; + +: ( desc encoding -- stream ) + nip ; inline + +: ( process encoding -- process stream ) + [ + >r (pipe) { + [ add-error-destructor ] + [ + swap >process + [ swap in>> or ] change-stdout + run-detached + ] + [ in>> close-handle ] + [ out>> ] + } cleave r> + ] with-destructors ; + +: ( desc encoding -- stream ) + nip ; inline + +: ( process encoding -- process stream ) + [ + >r (pipe) (pipe) { + [ [ add-error-destructor ] bi@ ] + [ + rot >process + [ swap out>> or ] change-stdout + [ swap in>> or ] change-stdin + run-detached + ] + [ [ in>> close-handle ] [ out>> close-handle ] bi* ] + [ [ in>> ] [ out>> ] bi* ] + } 2cleave r> + ] with-destructors ; : ( desc encoding -- stream ) - drop ; inline - -: with-process-stream ( desc quot -- status ) - swap >r - [ swap with-stream ] keep - r> wait-for-process ; inline + nip ; inline : notify-exit ( process status -- ) >>status @@ -168,9 +219,9 @@ HOOK: (process-stream) io-backend ( process -- handle in out ) GENERIC: underlying-handle ( stream -- handle ) -M: port underlying-handle port-handle ; +M: port underlying-handle handle>> ; M: duplex-stream underlying-handle - dup duplex-stream-in underlying-handle - swap duplex-stream-out underlying-handle tuck = - [ "Invalid duplex stream" throw ] when ; + [ in>> underlying-handle ] + [ out>> underlying-handle ] bi + [ = [ "Invalid duplex stream" throw ] when ] keep ; diff --git a/extra/io/nonblocking/nonblocking.factor b/extra/io/nonblocking/nonblocking.factor index fc8ade5758..d25d4b7050 100755 --- a/extra/io/nonblocking/nonblocking.factor +++ b/extra/io/nonblocking/nonblocking.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2005, 2008 Slava Pestov, Doug Coleman ! See http://factorcode.org/license.txt for BSD license. USING: math kernel io sequences io.buffers io.timeouts generic -byte-vectors system io.streams.duplex io.encodings math.order -io.backend continuations debugger classes byte-arrays namespaces -splitting dlists assocs io.encodings.binary inspector accessors ; +byte-vectors system io.encodings math.order io.backend +continuations debugger classes byte-arrays namespaces splitting +dlists assocs io.encodings.binary inspector accessors ; IN: io.nonblocking SYMBOL: default-buffer-size diff --git a/extra/io/pipes/pipes-docs.factor b/extra/io/pipes/pipes-docs.factor new file mode 100644 index 0000000000..d51ae94bc7 --- /dev/null +++ b/extra/io/pipes/pipes-docs.factor @@ -0,0 +1,47 @@ +USING: help.markup help.syntax continuations io ; +IN: io.pipes + +HELP: pipe +{ $class-description "A low-level pipe. Instances are created by calling " { $link (pipe) } " and closed by calling " { $link dispose } "." } ; + +HELP: (pipe) +{ $values { "pipe" pipe } } +{ $description "Opens a new pipe. This is a low-level word; the " { $link } " and " { $link run-pipeline } " words can be used in most cases instead." } ; + +HELP: +{ $values { "encoding" "an encoding specifier" } { "stream" "a bidirectional stream" } } +{ $description "Opens a new pipe and wraps it in a stream. Data written from the stream can be read back from the same stream instance." } +{ $notes "Pipe streams must be disposed by calling " { $link dispose } " or " { $link with-disposal } " to avoid resource leaks." } ; + +HELP: run-pipeline +{ $values { "seq" "a sequence of pipeline components" } { "results" "a sequence of pipeline results" } } +{ $description + "Creates a pipe between each pipeline component, with the output of each component becoming the input of the next." + $nl + "The first component reads input from " { $link input-stream } " and the last component writes output to " { $link output-stream } "." + $nl + "Each component runs in its own thread, and the word returns when all components finish executing. Each component outputs a result value." + $nl + "Pipeline components must be one of the following:" + { $list + { "A quotation. The quotation is called with both " { $link input-stream } " and " { $link output-stream } " rebound, except for the first and last pipeline components, and it must output a single value." } + { "A process launch descriptor. See " { $link "io.launcher.descriptors" } "." } + } +} +{ $examples + "Print the lines of a log file which contain the string ``error'', sort them and filter out duplicates, using Unix shell commands only:" + { $code "{ \"cat log.txt\" \"grep error\" \"sort\" \"uniq\" } run-pipeline" } +} ; + +ARTICLE: "io.pipes" "Pipes" +"A " { $emphasis "pipe" } " is a unidirectional channel for transfer of bytes. Data written to one end of the pipe can be read from the other. Pipes can be used to pass data between processes; they can also be used within a single process to implement communication between coroutines." +$nl +"Low-level pipes:" +{ $subsection pipe } +{ $subsection (pipe) } +"High-level pipe streams:" +{ $subsection } +"Pipelines of coroutines and processes:" +{ $subsection run-pipeline } ; + +ABOUT: "io.pipes" diff --git a/extra/io/pipes/pipes-tests.factor b/extra/io/pipes/pipes-tests.factor new file mode 100644 index 0000000000..0b93e4dff2 --- /dev/null +++ b/extra/io/pipes/pipes-tests.factor @@ -0,0 +1,26 @@ +USING: io io.pipes io.streams.string io.encodings.utf8 +io.streams.duplex io.encodings namespaces continuations +tools.test kernel ; +IN: io.pipes.tests + +[ "Hello" ] [ + utf8 [ + "Hello" print flush + readln + ] with-stream +] unit-test + +[ { } ] [ { } run-pipeline ] unit-test +[ { f } ] [ { [ f ] } run-pipeline ] unit-test +[ { "Hello" } ] [ + "Hello" [ + { [ input-stream [ utf8 ] change readln ] } with-pipeline + ] with-string-reader +] unit-test + +[ { f "Hello" } ] [ + { + [ output-stream [ utf8 ] change "Hello" print flush f ] + [ input-stream [ utf8 ] change readln ] + } run-pipeline +] unit-test diff --git a/extra/io/pipes/pipes.factor b/extra/io/pipes/pipes.factor new file mode 100644 index 0000000000..3e91c5e48e --- /dev/null +++ b/extra/io/pipes/pipes.factor @@ -0,0 +1,56 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: io.encodings io.backend io.nonblocking io.streams.duplex +io splitting sequences sequences.lib namespaces kernel +destructors math concurrency.combinators accessors +arrays continuations quotations ; +IN: io.pipes + +TUPLE: pipe in out ; + +M: pipe dispose ( pipe -- ) + [ in>> close-handle ] [ out>> close-handle ] bi ; + +HOOK: (pipe) io-backend ( -- pipe ) + +: ( encoding -- stream ) + [ + >r (pipe) + [ add-error-destructor ] + [ in>> ] + [ out>> ] + tri + r> + ] with-destructors ; + +: with-fds ( input-fd output-fd quot -- ) + >r >r [ dup add-always-destructor ] [ input-stream get ] if* r> r> [ + >r [ dup add-always-destructor ] [ output-stream get ] if* r> + with-output-stream* + ] 2curry with-input-stream* ; inline + +: ( n -- pipes ) + [ (pipe) dup add-always-destructor ] replicate + f f pipe boa [ prefix ] [ suffix ] bi + 2 ; + +: with-pipe-fds ( seq -- results ) + [ + [ length dup zero? [ drop { } ] [ 1- ] if ] keep + [ >r [ first in>> ] [ second out>> ] bi r> 2curry ] 2map + [ call ] parallel-map + ] with-destructors ; + +GENERIC: pipeline-element-quot ( obj -- quot ) + +M: callable pipeline-element-quot + [ with-fds ] curry ; + +GENERIC: wait-for-pipeline-element ( obj -- result ) + +M: object wait-for-pipeline-element ; + +: run-pipeline ( seq -- results ) + [ pipeline-element-quot ] map + with-pipe-fds + [ wait-for-pipeline-element ] map ; diff --git a/extra/io/server/server-docs.factor b/extra/io/server/server-docs.factor index 7eda48f747..50f38cb146 100755 --- a/extra/io/server/server-docs.factor +++ b/extra/io/server/server-docs.factor @@ -3,8 +3,8 @@ IN: io.server HELP: with-server { $values { "seq" "a sequence of address specifiers" } { "service" "a string or " { $link f } } { "encoding" "an encoding to use for client connections" } { "quot" "a quotation" } } -{ $description "Starts a TCP/IP server. The quotation is called in a new thread for each client connection, with the client connection being the " { $link stdio } " stream. Client connections are logged to the " { $link stdio } " stream at the time the server was started." } ; +{ $description "Starts a TCP/IP server. The quotation is called in a new thread for each client connection, with the client connection being both the " { $link input-stream } " and " { $link output-stream } "." } ; HELP: with-datagrams { $values { "seq" "a sequence of address specifiers" } { "service" "a string or " { $link f } } { "quot" "a quotation" } } -{ $description "Starts a UDP/IP server. The quotation is called for each datagram packet received. Datagram packets are logged to the " { $link stdio } " stream at the time the server was started." } ; +{ $description "Starts a UDP/IP server. The quotation is called for each datagram packet received." } ; diff --git a/extra/io/server/server.factor b/extra/io/server/server.factor index 45e3b1de66..1d626a9e15 100755 --- a/extra/io/server/server.factor +++ b/extra/io/server/server.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io io.sockets io.files logging continuations kernel -math math.parser namespaces parser sequences strings -prettyprint debugger quotations calendar +USING: io io.sockets io.files io.streams.duplex logging +continuations kernel math math.parser namespaces parser +sequences strings prettyprint debugger quotations calendar threads concurrency.combinators assocs ; IN: io.server diff --git a/extra/io/sockets/sockets-docs.factor b/extra/io/sockets/sockets-docs.factor index ad78b4631c..ee3cb3aa7b 100755 --- a/extra/io/sockets/sockets-docs.factor +++ b/extra/io/sockets/sockets-docs.factor @@ -14,6 +14,7 @@ ARTICLE: "network-addressing" "Address specifiers" ARTICLE: "network-connection" "Connection-oriented networking" "Network connections can be established with this word:" { $subsection } +{ $subsection with-client } "Connection-oriented network servers are implemented by first opening a server socket, then waiting for connections:" { $subsection } { $subsection accept } diff --git a/extra/io/sockets/sockets.factor b/extra/io/sockets/sockets.factor index 859dcb4cdc..f835f0beb2 100755 --- a/extra/io/sockets/sockets.factor +++ b/extra/io/sockets/sockets.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2007, 2008 Slava Pestov, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: generic kernel io.backend namespaces continuations -sequences arrays io.encodings io.nonblocking accessors ; +sequences arrays io.encodings io.nonblocking io.streams.duplex +accessors ; IN: io.sockets TUPLE: local path ; @@ -30,6 +31,9 @@ M: object (client) ((client)) ; : ( addrspec encoding -- stream ) >r (client) r> ; +: with-client ( addrspec encoding quot -- ) + >r r> with-stream ; inline + HOOK: (server) io-backend ( addrspec -- handle ) : ( addrspec encoding -- server ) diff --git a/extra/io/streams/duplex/authors.txt b/extra/io/streams/duplex/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/io/streams/duplex/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/io/streams/duplex/duplex-docs.factor b/extra/io/streams/duplex/duplex-docs.factor new file mode 100755 index 0000000000..15d401ad68 --- /dev/null +++ b/extra/io/streams/duplex/duplex-docs.factor @@ -0,0 +1,39 @@ +USING: help.markup help.syntax io continuations quotations ; +IN: io.streams.duplex + +ARTICLE: "io.streams.duplex" "Duplex streams" +"Duplex streams combine an input stream and an output stream into a bidirectional stream." +{ $subsection duplex-stream } +{ $subsection } +"A pair of combinators for rebinding both default streams at once:" +{ $subsection with-stream } +{ $subsection with-stream* } ; + +ABOUT: "io.streams.duplex" + +HELP: duplex-stream +{ $class-description "A bidirectional stream wrapping an input and output stream." } ; + +HELP: +{ $values { "in" "an input stream" } { "out" "an output stream" } { "stream" " a duplex stream" } } +{ $description "Creates a duplex stream. Writing to a duplex stream will write to " { $snippet "out" } ", and reading from a duplex stream will read from " { $snippet "in" } ". Closing a duplex stream closes both the input and output streams." } ; + +HELP: stream-closed-twice +{ $error-description "This error is thrown when performing an I/O operation on a " { $link duplex-stream } " which has been closed with " { $link dispose } "." } ; + +HELP: with-stream +{ $values { "stream" duplex-stream } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with both " { $link input-stream } " and " { $link output-stream } " rebound to " { $snippet "stream" } ". The stream is closed if the quotation returns or throws an error." } ; + +HELP: with-stream* +{ $values { "stream" duplex-stream } { "quot" quotation } } +{ $description "Calls the quotation in a new dynamic scope, with both " { $link input-stream } " and " { $link output-stream } " rebound to " { $snippet "stream" } "." } +{ $notes "This word does not close the stream. Compare with " { $link with-stream } "." } ; + +HELP: +{ $values { "stream-in" "an input stream" } + { "stream-out" "an output stream" } + { "encoding" "an encoding descriptor" } + { "duplex" "an encoded duplex stream" } } +{ $description "Wraps the given streams in an encoder or decoder stream, and puts them together in a duplex stream for input and output. If either input stream is already encoded, that encoding is stripped off before it is reencoded. The encoding descriptor must conform to the " { $link "encodings-protocol" } "." } +$low-level-note ; diff --git a/core/io/streams/duplex/duplex-tests.factor b/extra/io/streams/duplex/duplex-tests.factor similarity index 100% rename from core/io/streams/duplex/duplex-tests.factor rename to extra/io/streams/duplex/duplex-tests.factor diff --git a/core/io/streams/duplex/duplex.factor b/extra/io/streams/duplex/duplex.factor similarity index 51% rename from core/io/streams/duplex/duplex.factor rename to extra/io/streams/duplex/duplex.factor index 40f0cb6e73..cb96d8017a 100755 --- a/core/io/streams/duplex/duplex.factor +++ b/extra/io/streams/duplex/duplex.factor @@ -1,6 +1,8 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel continuations io accessors ; +USING: kernel continuations io io.encodings io.encodings.private +io.timeouts debugger inspector listener accessors delegate +delegate.protocols ; IN: io.streams.duplex ! We ensure that the stream can only be closed once, to preserve @@ -13,6 +15,9 @@ TUPLE: duplex-stream in out closed ; ERROR: stream-closed-twice ; +M: stream-closed-twice summary + drop "Attempt to perform I/O on closed stream" ; + -M: duplex-stream stream-flush - out stream-flush ; +CONSULT: input-stream-protocol duplex-stream in ; -M: duplex-stream stream-readln - in stream-readln ; +CONSULT: output-stream-protocol duplex-stream out ; -M: duplex-stream stream-read1 - in stream-read1 ; - -M: duplex-stream stream-read-until - in stream-read-until ; - -M: duplex-stream stream-read-partial - in stream-read-partial ; - -M: duplex-stream stream-read - in stream-read ; - -M: duplex-stream stream-write1 - out stream-write1 ; - -M: duplex-stream stream-write - out stream-write ; - -M: duplex-stream stream-nl - out stream-nl ; - -M: duplex-stream stream-format - out stream-format ; - -M: duplex-stream make-span-stream - out make-span-stream ; - -M: duplex-stream make-block-stream - out make-block-stream ; - -M: duplex-stream make-cell-stream - out make-cell-stream ; - -M: duplex-stream stream-write-table - out stream-write-table ; +M: duplex-stream set-timeout + [ in set-timeout ] [ out set-timeout ] 2bi ; M: duplex-stream dispose #! The output stream is closed first, in case both streams @@ -75,3 +45,12 @@ M: duplex-stream dispose [ dup out>> dispose ] [ dup in>> dispose ] [ ] cleanup ] unless drop ; + +: ( stream-in stream-out encoding -- duplex ) + tuck reencode >r redecode r> ; + +: with-stream* ( stream quot -- ) + >r [ in>> ] [ out>> ] bi r> with-streams* ; inline + +: with-stream ( stream quot -- ) + >r [ in>> ] [ out>> ] bi r> with-streams ; inline diff --git a/core/io/streams/duplex/summary.txt b/extra/io/streams/duplex/summary.txt similarity index 100% rename from core/io/streams/duplex/summary.txt rename to extra/io/streams/duplex/summary.txt diff --git a/extra/io/streams/null/null.factor b/extra/io/streams/null/null.factor index eee66239be..384a3806b8 100755 --- a/extra/io/streams/null/null.factor +++ b/extra/io/streams/null/null.factor @@ -1,25 +1,38 @@ ! Copyright (C) 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. IN: io.streams.null -USING: kernel io io.timeouts continuations ; +USING: kernel io io.timeouts io.streams.duplex continuations ; TUPLE: null-stream ; M: null-stream dispose drop ; M: null-stream set-timeout 2drop ; -M: null-stream stream-readln drop f ; -M: null-stream stream-read1 drop f ; -M: null-stream stream-read-until 2drop f f ; -M: null-stream stream-read 2drop f ; -M: null-stream stream-write1 2drop ; -M: null-stream stream-write 2drop ; -M: null-stream stream-nl drop ; -M: null-stream stream-flush drop ; -M: null-stream stream-format 3drop ; -M: null-stream make-span-stream nip ; -M: null-stream make-block-stream nip ; -M: null-stream make-cell-stream nip ; -M: null-stream stream-write-table 3drop ; + +TUPLE: null-reader < null-stream ; + +M: null-reader stream-readln drop f ; +M: null-reader stream-read1 drop f ; +M: null-reader stream-read-until 2drop f f ; +M: null-reader stream-read 2drop f ; + +TUPLE: null-writer < null-stream ; + +M: null-writer stream-write1 2drop ; +M: null-writer stream-write 2drop ; +M: null-writer stream-nl drop ; +M: null-writer stream-flush drop ; +M: null-writer stream-format 3drop ; +M: null-writer make-span-stream nip ; +M: null-writer make-block-stream nip ; +M: null-writer make-cell-stream nip ; +M: null-writer stream-write-table 3drop ; + +: with-null-reader ( quot -- ) + T{ null-reader } swap with-input-stream* ; inline + +: with-null-writer ( quot -- ) + T{ null-writer } swap with-output-stream* ; inline : with-null-stream ( quot -- ) - T{ null-stream } swap with-stream* ; inline + T{ duplex-stream f T{ null-reader } T{ null-writer } } + swap with-stream* ; inline diff --git a/extra/io/timeouts/timeouts.factor b/extra/io/timeouts/timeouts.factor index f1031e98e2..f9ffd5e98f 100755 --- a/extra/io/timeouts/timeouts.factor +++ b/extra/io/timeouts/timeouts.factor @@ -1,20 +1,16 @@ ! Copyright (C) 2008 Slava Pestov, Doug Coleman ! See http://factorcode.org/license.txt for BSD license. -USING: kernel calendar alarms io.streams.duplex io.encodings ; +USING: kernel calendar alarms io io.encodings accessors +namespaces ; IN: io.timeouts ! Won't need this with new slot accessors GENERIC: timeout ( obj -- dt/f ) GENERIC: set-timeout ( dt/f obj -- ) -M: duplex-stream set-timeout - 2dup - duplex-stream-in set-timeout - duplex-stream-out set-timeout ; +M: decoder set-timeout stream>> set-timeout ; -M: decoder set-timeout decoder-stream set-timeout ; - -M: encoder set-timeout encoder-stream set-timeout ; +M: encoder set-timeout stream>> set-timeout ; GENERIC: timed-out ( obj -- ) @@ -29,3 +25,7 @@ M: object timed-out drop ; ] [ 2drop call ] if ; inline + +: timeouts ( dt -- ) + [ input-stream get set-timeout ] + [ output-stream get set-timeout ] bi ; diff --git a/extra/io/unix/backend/backend.factor b/extra/io/unix/backend/backend.factor index ba4e587d13..08ff526f14 100644 --- a/extra/io/unix/backend/backend.factor +++ b/extra/io/unix/backend/backend.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: alien generic assocs kernel kernel.private math -io.nonblocking sequences strings structs sbufs -threads unix vectors io.buffers io.backend io.encodings -io.streams.duplex math.parser continuations system libc -qualified namespaces io.timeouts io.encodings.utf8 accessors ; +io.nonblocking sequences strings structs sbufs threads unix +vectors io.buffers io.backend io.encodings math.parser +continuations system libc qualified namespaces io.timeouts +io.encodings.utf8 accessors ; QUALIFIED: io IN: io.unix.backend @@ -78,7 +78,8 @@ M: integer init-handle ( fd -- ) #! since on OS X 10.3, this operation fails from init-io #! when running the Factor.app (presumably because fd 0 and #! 1 are closed). - F_SETFL O_NONBLOCK fcntl drop ; + [ F_SETFL O_NONBLOCK fcntl drop ] + [ F_SETFD FD_CLOEXEC fcntl drop ] bi ; M: integer close-handle ( fd -- ) close ; diff --git a/extra/io/unix/launcher/launcher-tests.factor b/extra/io/unix/launcher/launcher-tests.factor index 7e527196be..97ffc5287f 100755 --- a/extra/io/unix/launcher/launcher-tests.factor +++ b/extra/io/unix/launcher/launcher-tests.factor @@ -31,16 +31,7 @@ accessors kernel sequences io.encodings.utf8 ; "cat" "launcher-test-1" temp-file 2array - ascii contents -] unit-test - -[ f ] [ - - "cat" - "launcher-test-1" temp-file - 2array >>command - +inherit+ >>stdout - ascii contents + ascii contents ] unit-test [ ] [ @@ -59,7 +50,7 @@ accessors kernel sequences io.encodings.utf8 ; "cat" "launcher-test-1" temp-file 2array - ascii contents + ascii contents ] unit-test [ ] [ @@ -77,14 +68,14 @@ accessors kernel sequences io.encodings.utf8 ; "cat" "launcher-test-1" temp-file 2array - ascii contents + ascii contents ] unit-test [ t ] [ "env" >>command { { "A" "B" } } >>environment - ascii lines + ascii lines "A=B" swap member? ] unit-test @@ -93,7 +84,7 @@ accessors kernel sequences io.encodings.utf8 ; "env" >>command { { "A" "B" } } >>environment +replace-environment+ >>environment-mode - ascii lines + ascii lines ] unit-test [ "hi\n" ] [ @@ -107,3 +98,15 @@ accessors kernel sequences io.encodings.utf8 ; temp-directory "aloha" append-path utf8 file-contents ] unit-test + +[ ] [ "append-test" temp-file delete-file ] unit-test + +[ "hi\nhi\n" ] [ + 2 [ + + "echo hi" >>command + "append-test" temp-file >>stdout + try-process + ] times + "append-test" temp-file utf8 file-contents +] unit-test diff --git a/extra/io/unix/launcher/launcher.factor b/extra/io/unix/launcher/launcher.factor index 2c1e6261c0..043b2bd73e 100755 --- a/extra/io/unix/launcher/launcher.factor +++ b/extra/io/unix/launcher/launcher.factor @@ -1,10 +1,12 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io io.backend io.launcher io.nonblocking io.unix.backend -io.unix.files io.nonblocking sequences kernel namespaces math -system alien.c-types debugger continuations arrays assocs -combinators unix.process strings threads unix -io.unix.launcher.parser accessors io.files io.files.private ; +USING: kernel namespaces math system sequences debugger +continuations arrays assocs combinators alien.c-types strings +threads accessors +io io.backend io.launcher io.nonblocking io.files +io.files.private io.unix.files io.unix.backend +io.unix.launcher.parser +unix unix.process ; IN: io.unix.launcher ! Search unix first @@ -34,7 +36,8 @@ USE: unix : reset-fd ( fd -- ) #! We drop the error code because on *BSD, fcntl of #! /dev/null fails. - F_SETFL 0 fcntl drop ; + [ F_SETFL 0 fcntl drop ] + [ F_SETFD 0 fcntl drop ] bi ; : redirect-inherit ( obj mode fd -- ) 2nip reset-fd ; @@ -43,19 +46,20 @@ USE: unix >r >r normalize-path r> file-mode open dup io-error r> redirect-fd ; +: redirect-file-append ( obj mode fd -- ) + >r drop path>> normalize-path open-append r> redirect-fd ; + : redirect-closed ( obj mode fd -- ) >r >r drop "/dev/null" r> r> redirect-file ; -: redirect-stream ( obj mode fd -- ) - >r drop underlying-handle dup reset-fd r> redirect-fd ; - : redirect ( obj mode fd -- ) { { [ pick not ] [ redirect-inherit ] } { [ pick string? ] [ redirect-file ] } + { [ pick appender? ] [ redirect-file-append ] } { [ pick +closed+ eq? ] [ redirect-closed ] } - { [ pick +inherit+ eq? ] [ redirect-closed ] } - [ redirect-stream ] + { [ pick integer? ] [ >r drop dup reset-fd r> redirect-fd ] } + [ >r >r underlying-handle r> r> redirect ] } cond ; : ?closed dup +closed+ eq? [ drop "/dev/null" ] when ; @@ -90,27 +94,10 @@ M: unix run-process* ( process -- pid ) M: unix kill-process* ( pid -- ) SIGTERM kill io-error ; -: open-pipe ( -- pair ) - 2 "int" dup pipe zero? - [ 2 c-int-array> ] [ drop f ] if ; - -: setup-stdio-pipe ( stdin stdout -- ) - 2dup first close second close - >r first 0 dup2 drop r> second 1 dup2 drop ; - -M: unix (process-stream) - >r open-pipe open-pipe r> - [ >r setup-stdio-pipe r> spawn-process ] curry - [ -rot 2dup second close first close ] - with-fork - first swap second ; - : find-process ( handle -- process ) processes get swap [ nip swap handle>> = ] curry assoc-find 2drop ; -! Inefficient process wait polling, used on Linux and Solaris. -! On BSD and Mac OS X, we use kqueue() which scales better. M: unix wait-for-processes ( -- ? ) -1 0 tuck WNOHANG waitpid dup 0 <= [ diff --git a/extra/io/unix/pipes/pipes-tests.factor b/extra/io/unix/pipes/pipes-tests.factor new file mode 100644 index 0000000000..8ff9ba61c8 --- /dev/null +++ b/extra/io/unix/pipes/pipes-tests.factor @@ -0,0 +1,16 @@ +USING: tools.test io.pipes io.unix.pipes io.encodings.utf8 +io.encodings io namespaces sequences ; +IN: io.unix.pipes.tests + +[ { 0 0 } ] [ { "ls" "grep x" } run-pipeline ] unit-test + +[ { 0 f 0 } ] [ + { + "ls" + [ + input-stream [ utf8 ] change + input-stream get lines reverse [ print ] each f + ] + "grep x" + } run-pipeline +] unit-test diff --git a/extra/io/unix/pipes/pipes.factor b/extra/io/unix/pipes/pipes.factor new file mode 100644 index 0000000000..4fc5acf634 --- /dev/null +++ b/extra/io/unix/pipes/pipes.factor @@ -0,0 +1,12 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: system alien.c-types kernel unix math sequences +qualified io.unix.backend io.nonblocking ; +IN: io.unix.pipes +QUALIFIED: io.pipes + +M: unix io.pipes:(pipe) ( -- pair ) + 2 "int" + dup pipe io-error + 2 c-int-array> first2 + [ [ init-handle ] bi@ ] [ io.pipes:pipe boa ] 2bi ; diff --git a/extra/io/unix/unix-tests.factor b/extra/io/unix/unix-tests.factor index ff315bc529..61a667b70f 100755 --- a/extra/io/unix/unix-tests.factor +++ b/extra/io/unix/unix-tests.factor @@ -1,6 +1,7 @@ USING: io.files io.sockets io kernel threads namespaces tools.test continuations strings byte-arrays -sequences prettyprint system io.encodings.binary io.encodings.ascii ; +sequences prettyprint system io.encodings.binary io.encodings.ascii +io.streams.duplex ; IN: io.unix.tests ! Unix domain stream sockets @@ -24,12 +25,11 @@ yield [ { "Hello world" "FOO" } ] [ [ - socket-server ascii - [ + socket-server ascii [ readln , "XYZ" print flush readln , - ] with-stream + ] with-client ] { } make ] unit-test @@ -125,16 +125,16 @@ datagram-client delete-file ! Invalid parameter tests [ - image binary [ stdio get accept ] with-file-reader + image binary [ input-stream get accept ] with-file-reader ] must-fail [ - image binary [ stdio get receive ] with-file-reader + image binary [ input-stream get receive ] with-file-reader ] must-fail [ image binary [ B{ 1 2 } datagram-server - stdio get send + input-stream get send ] with-file-reader ] must-fail diff --git a/extra/io/unix/unix.factor b/extra/io/unix/unix.factor index 1e5638fb4a..e8e7135e1a 100755 --- a/extra/io/unix/unix.factor +++ b/extra/io/unix/unix.factor @@ -1,5 +1,6 @@ -USING: io.unix.backend io.unix.files io.unix.sockets io.timeouts -io.unix.launcher io.unix.mmap io.backend combinators namespaces -system vocabs.loader sequences words init ; +USING: io.unix.backend io.unix.files io.unix.sockets +io.unix.launcher io.unix.mmap io.unix.pipes io.timeouts +io.backend combinators namespaces system vocabs.loader +sequences words init ; "io.unix." os word-name append require diff --git a/extra/io/windows/launcher/launcher.factor b/extra/io/windows/launcher/launcher.factor index 670ea18f5e..a5d7338cd6 100755 --- a/extra/io/windows/launcher/launcher.factor +++ b/extra/io/windows/launcher/launcher.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types arrays continuations io io.windows io.windows.nt.pipes libc io.nonblocking -io.streams.duplex windows.types math windows.kernel32 +windows.types math windows.kernel32 namespaces io.launcher kernel sequences windows.errors splitting system threads init strings combinators io.backend accessors concurrency.flags io.files assocs diff --git a/extra/io/windows/nt/launcher/launcher-tests.factor b/extra/io/windows/nt/launcher/launcher-tests.factor index 8b13b9b3b9..f4901fa90f 100755 --- a/extra/io/windows/nt/launcher/launcher-tests.factor +++ b/extra/io/windows/nt/launcher/launcher-tests.factor @@ -77,7 +77,7 @@ sequences parser assocs hashtables math ; vm "-script" "stderr.factor" 3array >>command "err2.txt" temp-file >>stderr - ascii lines first + ascii lines first ] with-directory ] unit-test @@ -89,7 +89,7 @@ sequences parser assocs hashtables math ; "extra/io/windows/nt/launcher/test" resource-path [ vm "-script" "env.factor" 3array >>command - ascii contents + ascii contents ] with-directory eval os-envs = @@ -101,7 +101,7 @@ sequences parser assocs hashtables math ; vm "-script" "env.factor" 3array >>command +replace-environment+ >>environment-mode os-envs >>environment - ascii contents + ascii contents ] with-directory eval os-envs = @@ -112,7 +112,7 @@ sequences parser assocs hashtables math ; vm "-script" "env.factor" 3array >>command { { "A" "B" } } >>environment - ascii contents + ascii contents ] with-directory eval "A" swap at @@ -124,7 +124,7 @@ sequences parser assocs hashtables math ; vm "-script" "env.factor" 3array >>command { { "HOME" "XXX" } } >>environment +prepend-environment+ >>environment-mode - ascii contents + ascii contents ] with-directory eval "HOME" swap at "XXX" = diff --git a/extra/io/windows/nt/launcher/launcher.factor b/extra/io/windows/nt/launcher/launcher.factor index f57902608f..d74bf8ab95 100755 --- a/extra/io/windows/nt/launcher/launcher.factor +++ b/extra/io/windows/nt/launcher/launcher.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types arrays continuations destructors io -io.windows libc io.nonblocking io.streams.duplex windows.types +io.windows libc io.nonblocking windows.types math windows.kernel32 windows namespaces io.launcher kernel sequences windows.errors assocs splitting system strings io.windows.launcher io.windows.nt.pipes io.backend io.files @@ -52,7 +52,6 @@ IN: io.windows.nt.launcher : redirect ( default obj access-mode create-mode -- handle ) { { [ pick not ] [ redirect-default ] } - { [ pick +inherit+ eq? ] [ redirect-inherit ] } { [ pick +closed+ eq? ] [ redirect-closed ] } { [ pick string? ] [ redirect-file ] } [ redirect-stream ] diff --git a/extra/io/windows/nt/pipes/pipes.factor b/extra/io/windows/nt/pipes/pipes.factor index b164d5872b..8ed16bbd65 100755 --- a/extra/io/windows/nt/pipes/pipes.factor +++ b/extra/io/windows/nt/pipes/pipes.factor @@ -3,13 +3,13 @@ USING: alien alien.c-types arrays destructors io io.windows libc windows.types math windows.kernel32 windows namespaces kernel sequences windows.errors assocs math.parser system random -combinators accessors ; +combinators accessors io.pipes ; IN: io.windows.nt.pipes ! This code is based on ! http://twistedmatrix.com/trac/browser/trunk/twisted/internet/iocpreactor/process.py -: create-named-pipe ( name mode -- handle ) +: create-named-pipe ( name in-mode -- handle ) FILE_FLAG_OVERLAPPED bitor PIPE_TYPE_BYTE 1 @@ -21,7 +21,7 @@ IN: io.windows.nt.pipes dup win32-error=0/f dup add-completion ; -: open-other-end ( name mode -- handle ) +: open-other-end ( name out-mode -- handle ) FILE_SHARE_READ FILE_SHARE_WRITE bitor security-attributes-inherit OPEN_EXISTING @@ -31,8 +31,6 @@ IN: io.windows.nt.pipes dup win32-error=0/f dup add-completion ; -TUPLE: pipe in out ; - : ( name in-mode out-mode -- pipe ) [ >r over >r create-named-pipe dup close-later @@ -40,16 +38,11 @@ TUPLE: pipe in out ; pipe boa ] with-destructors ; -: close-pipe ( pipe -- ) - dup - in>> CloseHandle drop - out>> CloseHandle drop ; - : ( name -- pipe ) PIPE_ACCESS_INBOUND GENERIC_WRITE ; : ( name -- pipe ) - PIPE_ACCESS_DUPLEX GENERIC_READ ; + PIPE_ACCESS_OUTBOUND GENERIC_READ ; : unique-pipe-name ( -- string ) [ @@ -70,16 +63,14 @@ TUPLE: pipe in out ; ! /dev/null simulation : null-input ( -- pipe ) - dup out>> CloseHandle drop - in>> ; + [ in>> ] [ out>> CloseHandle drop ] bi ; : null-output ( -- pipe ) - dup in>> CloseHandle drop - out>> ; + [ in>> CloseHandle drop ] [ out>> ] bi ; : null-pipe ( mode -- pipe ) { - { [ dup GENERIC_READ = ] [ drop null-input ] } - { [ dup GENERIC_WRITE = ] [ drop null-output ] } - } cond ; + { GENERIC_READ [ null-input ] } + { GENERIC_WRITE [ null-output ] } + } case ; diff --git a/extra/io/windows/windows.factor b/extra/io/windows/windows.factor index 772ad9124f..acc3e28543 100755 --- a/extra/io/windows/windows.factor +++ b/extra/io/windows/windows.factor @@ -2,14 +2,12 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types arrays destructors io io.backend io.buffers io.files io.nonblocking io.sockets io.binary -io.sockets.impl windows.errors strings io.streams.duplex +io.sockets.impl windows.errors strings kernel math namespaces sequences windows windows.kernel32 windows.shell32 windows.types windows.winsock splitting continuations math.bitfields system accessors ; IN: io.windows -M: windows destruct-handle CloseHandle drop ; - M: windows destruct-socket closesocket drop ; TUPLE: win32-file handle ptr ; @@ -43,7 +41,10 @@ M: win32-file init-handle ( handle -- ) drop ; M: win32-file close-handle ( handle -- ) - win32-file-handle CloseHandle drop ; + win32-file-handle close-handle ; + +M: alien close-handle ( handle -- ) + CloseHandle drop ; ! Clean up resources (open handle) if add-completion fails : open-file ( path access-mode create-mode flags -- handle ) diff --git a/extra/logging/server/server.factor b/extra/logging/server/server.factor index 7601d1cc2e..3bc8637f90 100755 --- a/extra/logging/server/server.factor +++ b/extra/logging/server/server.factor @@ -48,7 +48,7 @@ SYMBOL: log-files : (log-message) ( msg -- ) #! msg: { msg word-name level service } - first4 log-stream [ write-message flush ] with-stream* ; + first4 log-stream [ write-message flush ] with-output-stream* ; : try-dispose ( stream -- ) [ dispose ] curry [ error. ] recover ; diff --git a/extra/morse/morse-docs.factor b/extra/morse/morse-docs.factor index f31b741c85..e35967d3e9 100644 --- a/extra/morse/morse-docs.factor +++ b/extra/morse/morse-docs.factor @@ -24,6 +24,10 @@ HELP: morse> { $description "Translates morse code into ASCII text" } { $see-also >morse morse>ch } ; -HELP: play-as-morse +HELP: play-as-morse* { $values { "str" "A string of ascii characters which can be translated into morse code" } { "unit-length" "The length of a dot" } } { $description "Plays a string as morse code" } ; + +HELP: play-as-morse +{ $values { "str" "A string of ascii characters which can be translated into morse code" } } +{ $description "Plays a string as morse code" } ; diff --git a/extra/morse/morse-tests.factor b/extra/morse/morse-tests.factor index dabb93579d..9bfdc6b50c 100644 --- a/extra/morse/morse-tests.factor +++ b/extra/morse/morse-tests.factor @@ -9,5 +9,5 @@ USING: arrays morse strings tools.test ; [ "-- --- .-. ... . / -.-. --- -.. ." ] [ "morse code" >morse ] unit-test [ "morse code" ] [ "-- --- .-. ... . / -.-. --- -.. ." morse> ] unit-test [ "hello, world!" ] [ "Hello, World!" >morse morse> ] unit-test -[ ] [ "sos" 0.075 play-as-morse ] unit-test +[ ] [ "sos" 0.075 play-as-morse* ] unit-test [ ] [ "Factor rocks!" play-as-morse ] unit-test diff --git a/extra/opengl/opengl-docs.factor b/extra/opengl/opengl-docs.factor index 2788ebdfc2..b168f4cad1 100644 --- a/extra/opengl/opengl-docs.factor +++ b/extra/opengl/opengl-docs.factor @@ -7,7 +7,7 @@ HELP: gl-color { $description "Wrapper for " { $link glColor4d } " taking a color specifier." } ; HELP: gl-error -{ $description "If the most recent OpenGL call resulted in an error, print the error to the " { $link stdio } " stream." } ; +{ $description "If the most recent OpenGL call resulted in an error, print the error to " { $link output-stream } "." } ; HELP: do-state { diff --git a/extra/pack/pack-tests.factor b/extra/pack/pack-tests.factor index 510e44d34e..d58ccbd0f2 100755 --- a/extra/pack/pack-tests.factor +++ b/extra/pack/pack-tests.factor @@ -38,7 +38,7 @@ USING: io io.streams.string kernel namespaces pack strings tools.test ; [ 2 ] [ [ 2 "int" b, ] B{ } make - [ "int" read-native ] with-stream + [ "int" read-native ] with-input-stream ] unit-test [ "FRAM" ] [ "FRAM\0" [ read-c-string ] with-string-reader ] unit-test diff --git a/extra/pack/pack.factor b/extra/pack/pack.factor index 65912244dd..5320583df0 100755 --- a/extra/pack/pack.factor +++ b/extra/pack/pack.factor @@ -154,13 +154,12 @@ MACRO: (pack) ( seq str -- quot ) MACRO: (unpack) ( str -- quot ) [ - \ , [ [ unpack-table at , \ , , ] each ] [ ] make 1quotation [ { } make ] append 1quotation % - \ with-stream , + \ with-string-reader , ] [ ] make ; : unpack-native ( seq str -- seq ) diff --git a/extra/random/unix/unix.factor b/extra/random/unix/unix.factor index 6016a6e9cb..7fda7c5d1d 100644 --- a/extra/random/unix/unix.factor +++ b/extra/random/unix/unix.factor @@ -9,7 +9,7 @@ C: unix-random : file-read-unbuffered ( n path -- bytes ) over default-buffer-size [ - binary [ read ] with-stream + binary [ read ] with-file-reader ] with-variable ; M: unix-random random-bytes* ( n tuple -- byte-array ) diff --git a/extra/size-of/size-of.factor b/extra/size-of/size-of.factor index 5b6f26acea..a2b47fc0aa 100644 --- a/extra/size-of/size-of.factor +++ b/extra/size-of/size-of.factor @@ -36,4 +36,4 @@ VAR: headers { "gcc" c-file "-o" exe } to-strings [ "Error compiling generated C program" print ] run-or-bail - exe ascii contents string>number ; \ No newline at end of file + exe ascii contents string>number ; \ No newline at end of file diff --git a/extra/smtp/server/server.factor b/extra/smtp/server/server.factor index 737a887f9f..f23ee138d5 100755 --- a/extra/smtp/server/server.factor +++ b/extra/smtp/server/server.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2007 Elie CHAFTARI ! See http://factorcode.org/license.txt for BSD license. USING: combinators kernel prettyprint io io.timeouts io.server -sequences namespaces io.sockets continuations calendar io.encodings.ascii ; +sequences namespaces io.sockets continuations calendar +io.encodings.ascii io.streams.duplex ; IN: smtp.server ! Mock SMTP server for testing purposes. @@ -65,7 +66,7 @@ SYMBOL: data-mode "Starting SMTP server on port " write dup . flush "127.0.0.1" swap ascii [ accept drop [ - 1 minutes stdio get set-timeout + 1 minutes timeouts "220 hello\r\n" write flush process global [ flush ] bind diff --git a/extra/smtp/smtp.factor b/extra/smtp/smtp.factor index 4d548738d2..8fdc0e07a4 100755 --- a/extra/smtp/smtp.factor +++ b/extra/smtp/smtp.factor @@ -17,11 +17,11 @@ LOG: log-smtp-connection NOTICE ( addrspec -- ) : with-smtp-connection ( quot -- ) smtp-server get dup log-smtp-connection - ascii [ + ascii [ smtp-domain [ host-name or ] change - read-timeout get stdio get set-timeout + read-timeout get timeouts call - ] with-stream ; inline + ] with-client ; inline : crlf "\r\n" write ; diff --git a/extra/state-parser/state-parser.factor b/extra/state-parser/state-parser.factor index 96ad4ca0b4..6fdc6d9d32 100644 --- a/extra/state-parser/state-parser.factor +++ b/extra/state-parser/state-parser.factor @@ -133,8 +133,8 @@ SYMBOL: prolog-data read1 set-next next ; : state-parse ( stream quot -- ) - ! with-stream implicitly creates a new scope which we use - swap [ init-parser call ] with-stream ; inline + ! with-input-stream implicitly creates a new scope which we use + swap [ init-parser call ] with-input-stream ; inline : string-parse ( input quot -- ) >r r> state-parse ; inline diff --git a/extra/tar/tar.factor b/extra/tar/tar.factor index 9b3d2ae79f..b5d01b6ed2 100755 --- a/extra/tar/tar.factor +++ b/extra/tar/tar.factor @@ -1,7 +1,6 @@ -USING: combinators io io.files io.streams.duplex -io.streams.string kernel math math.parser continuations -namespaces pack prettyprint sequences strings system -hexdump io.encodings.binary inspector accessors ; +USING: combinators io io.files io.streams.string kernel math +math.parser continuations namespaces pack prettyprint sequences +strings system hexdump io.encodings.binary inspector accessors ; IN: tar : zero-checksum 256 ; @@ -61,9 +60,7 @@ SYMBOL: filename ] if* ; : read-data-blocks ( tar-header out -- ) - >r stdio get r> [ - (read-data-blocks) - ] with-stream* ; + [ (read-data-blocks) ] with-output-stream* ; : parse-tar-header ( seq -- obj ) [ header-checksum ] keep over zero-checksum = [ diff --git a/extra/tools/deploy/backend/backend.factor b/extra/tools/deploy/backend/backend.factor index d4fbf1de78..ed466b6965 100755 --- a/extra/tools/deploy/backend/backend.factor +++ b/extra/tools/deploy/backend/backend.factor @@ -4,7 +4,7 @@ USING: namespaces continuations.private kernel.private init assocs kernel vocabs words sequences memory io system arrays continuations math definitions mirrors splitting parser classes inspector layouts vocabs.loader prettyprint.config prettyprint -debugger io.streams.c io.streams.duplex io.files io.backend +debugger io.streams.c io.files io.backend quotations io.launcher words.private tools.deploy.config bootstrap.image io.encodings.utf8 accessors ; IN: tools.deploy.backend @@ -31,10 +31,9 @@ IN: tools.deploy.backend +stdout+ >>stderr +closed+ >>stdin +low-priority+ >>priority - utf8 - >r copy-lines r> wait-for-process zero? [ - "Deployment failed" throw - ] unless ; + utf8 + copy-lines + wait-for-process zero? [ "Deployment failed" throw ] unless ; : make-boot-image ( -- ) #! If stage1 image doesn't exist, create one. diff --git a/extra/tools/deploy/shaker/shaker.factor b/extra/tools/deploy/shaker/shaker.factor index d507357590..86c50387b5 100755 --- a/extra/tools/deploy/shaker/shaker.factor +++ b/extra/tools/deploy/shaker/shaker.factor @@ -120,8 +120,9 @@ IN: tools.deploy.shaker io.thread:io-thread libc.private:mallocs source-files:source-files - stderr - stdio + input-stream + output-stream + error-stream } % deploy-threads? [ diff --git a/extra/tools/profiler/profiler-docs.factor b/extra/tools/profiler/profiler-docs.factor index 89e84bbc86..50bbc527d1 100755 --- a/extra/tools/profiler/profiler-docs.factor +++ b/extra/tools/profiler/profiler-docs.factor @@ -27,7 +27,7 @@ HELP: counters HELP: counters. { $values { "assoc" "an association list mapping words to integers" } } -{ $description "Prints an association list of call counts to the " { $link stdio } " stream." } ; +{ $description "Prints an association list of call counts to " { $link output-stream } "." } ; HELP: profile { $values { "quot" quotation } } diff --git a/extra/tools/test/test-docs.factor b/extra/tools/test/test-docs.factor index a605543bda..4b2521d19c 100755 --- a/extra/tools/test/test-docs.factor +++ b/extra/tools/test/test-docs.factor @@ -91,4 +91,4 @@ HELP: run-all-tests HELP: test-failures. { $values { "assoc" "an association list of unit test failures" } } -{ $description "Prints unit test failures output by " { $link run-tests } " or " { $link run-all-tests } " to the " { $link stdio } " stream." } ; +{ $description "Prints unit test failures output by " { $link run-tests } " or " { $link run-all-tests } " to " { $link output-stream } "." } ; diff --git a/extra/tools/test/ui/ui.factor b/extra/tools/test/ui/ui.factor index 9b32bc9e10..8825cffa4d 100755 --- a/extra/tools/test/ui/ui.factor +++ b/extra/tools/test/ui/ui.factor @@ -2,7 +2,7 @@ USING: dlists ui.gadgets kernel ui namespaces io.streams.string io ; IN: tools.test.ui -! We can't print to stdio here because that might be a pane +! We can't print to output-stream here because that might be a pane ! stream, and our graft-queue rebinding here would be captured ! by code adding children to the pane... : with-grafted-gadget ( gadget quot -- ) diff --git a/extra/trees/avl/avl-tests.factor b/extra/trees/avl/avl-tests.factor old mode 100644 new mode 100755 index 570125cb45..5cb6606ce4 --- a/extra/trees/avl/avl-tests.factor +++ b/extra/trees/avl/avl-tests.factor @@ -2,85 +2,79 @@ USING: kernel tools.test trees trees.avl math random sequences assocs ; IN: trees.avl.tests [ "key1" 0 "key2" 0 ] [ - T{ avl-node T{ node f "key1" f f T{ avl-node T{ node f "key2" } 1 } } 2 } + T{ avl-node f "key1" f f T{ avl-node f "key2" f f 1 } 2 } [ single-rotate ] go-left [ node-left dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" 0 ] [ - T{ avl-node T{ node f "key1" f f T{ avl-node T{ node f "key2" } 1 } } 2 } + T{ avl-node f "key1" f f T{ avl-node f "key2" f f f 1 } 2 } [ select-rotate ] go-left [ node-left dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" 0 ] [ - T{ avl-node T{ node f "key1" f T{ avl-node T{ node f "key2" } -1 } } -2 } + T{ avl-node f "key1" f T{ avl-node f "key2" f f f -1 } f -2 } [ single-rotate ] go-right [ node-right dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" 0 ] [ - T{ avl-node T{ node f "key1" f T{ avl-node T{ node f "key2" } -1 } } -2 } + T{ avl-node f "key1" f T{ avl-node f "key2" f f f -1 } f -2 } [ select-rotate ] go-right [ node-right dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" -1 "key2" 0 "key3" 0 ] -[ T{ avl-node T{ node f "key1" f f - T{ avl-node T{ node f "key2" f - T{ avl-node T{ node f "key3" } 1 } } - -1 } } - 2 } [ double-rotate ] go-left +[ T{ avl-node f "key1" f f + T{ avl-node f "key2" f + T{ avl-node f "key3" f f f 1 } f -1 } 2 } + [ double-rotate ] go-left [ node-left dup node-key swap avl-node-balance ] keep [ node-right dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" 0 "key3" 0 ] -[ T{ avl-node T{ node f "key1" f f - T{ avl-node T{ node f "key2" f - T{ avl-node T{ node f "key3" } 0 } } - -1 } } - 2 } [ double-rotate ] go-left +[ T{ avl-node f "key1" f f + T{ avl-node f "key2" f + T{ avl-node f "key3" f f f 0 } f -1 } 2 } + [ double-rotate ] go-left [ node-left dup node-key swap avl-node-balance ] keep [ node-right dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" 1 "key3" 0 ] -[ T{ avl-node T{ node f "key1" f f - T{ avl-node T{ node f "key2" f - T{ avl-node T{ node f "key3" } -1 } } - -1 } } - 2 } [ double-rotate ] go-left +[ T{ avl-node f "key1" f f + T{ avl-node f "key2" f + T{ avl-node f "key3" f f f -1 } f -1 } 2 } + [ double-rotate ] go-left [ node-left dup node-key swap avl-node-balance ] keep [ node-right dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 1 "key2" 0 "key3" 0 ] -[ T{ avl-node T{ node f "key1" f - T{ avl-node T{ node f "key2" f f - T{ avl-node T{ node f "key3" } -1 } } - 1 } } - -2 } [ double-rotate ] go-right +[ T{ avl-node f "key1" f + T{ avl-node f "key2" f f + T{ avl-node f "key3" f f f -1 } 1 } f -2 } + [ double-rotate ] go-right [ node-right dup node-key swap avl-node-balance ] keep [ node-left dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" 0 "key3" 0 ] -[ T{ avl-node T{ node f "key1" f - T{ avl-node T{ node f "key2" f f - T{ avl-node T{ node f "key3" } 0 } } - 1 } } - -2 } [ double-rotate ] go-right +[ T{ avl-node f "key1" f + T{ avl-node f "key2" f f + T{ avl-node f "key3" f f f 0 } 1 } f -2 } + [ double-rotate ] go-right [ node-right dup node-key swap avl-node-balance ] keep [ node-left dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test [ "key1" 0 "key2" -1 "key3" 0 ] -[ T{ avl-node T{ node f "key1" f - T{ avl-node T{ node f "key2" f f - T{ avl-node T{ node f "key3" } 1 } } - 1 } } - -2 } [ double-rotate ] go-right +[ T{ avl-node f "key1" f + T{ avl-node f "key2" f f + T{ avl-node f "key3" f f f 1 } 1 } f -2 } + [ double-rotate ] go-right [ node-right dup node-key swap avl-node-balance ] keep [ node-left dup node-key swap avl-node-balance ] keep dup node-key swap avl-node-balance ] unit-test diff --git a/extra/trees/avl/avl.factor b/extra/trees/avl/avl.factor index 3a37ec5fc7..866e035a21 100755 --- a/extra/trees/avl/avl.factor +++ b/extra/trees/avl/avl.factor @@ -1,33 +1,34 @@ ! Copyright (C) 2007 Alex Chapman ! See http://factorcode.org/license.txt for BSD license. -USING: combinators kernel generic math math.functions math.parser -namespaces io prettyprint.backend sequences trees assocs parser -math.order ; +USING: combinators kernel generic math math.functions +math.parser namespaces io prettyprint.backend sequences trees +assocs parser accessors math.order ; IN: trees.avl -TUPLE: avl ; - -INSTANCE: avl tree-mixin +TUPLE: avl < tree ; : ( -- tree ) - avl construct-tree ; + avl new-tree ; -TUPLE: avl-node balance ; +TUPLE: avl-node < node balance ; : ( key value -- node ) - swap 0 avl-node boa tuck set-delegate ; + avl-node new-node + 0 >>balance ; -: change-balance ( node amount -- ) - over avl-node-balance + swap set-avl-node-balance ; +: increase-balance ( node amount -- ) + swap [ + ] change-balance drop ; : rotate ( node -- node ) - dup node+link dup node-link pick set-node+link tuck set-node-link ; + dup node+link dup node-link pick set-node+link + tuck set-node-link ; : single-rotate ( node -- node ) - 0 over set-avl-node-balance 0 over node+link set-avl-node-balance rotate ; + 0 over (>>balance) 0 over node+link + (>>balance) rotate ; : pick-balances ( a node -- balance balance ) - avl-node-balance { + balance>> { { [ dup zero? ] [ 2drop 0 0 ] } { [ over = ] [ neg 0 ] } [ 0 swap ] @@ -36,18 +37,22 @@ TUPLE: avl-node balance ; : double-rotate ( node -- node ) [ node+link [ - node-link current-side get neg over pick-balances rot 0 swap set-avl-node-balance - ] keep set-avl-node-balance - ] keep tuck set-avl-node-balance - dup node+link [ rotate ] with-other-side over set-node+link rotate ; + node-link current-side get neg + over pick-balances rot 0 swap (>>balance) + ] keep (>>balance) + ] keep swap >>balance + dup node+link [ rotate ] with-other-side + over set-node+link rotate ; : select-rotate ( node -- node ) - dup node+link avl-node-balance current-side get = [ double-rotate ] [ single-rotate ] if ; + dup node+link balance>> current-side get = + [ double-rotate ] [ single-rotate ] if ; : balance-insert ( node -- node taller? ) dup avl-node-balance { { [ dup zero? ] [ drop f ] } - { [ dup abs 2 = ] [ sgn neg [ select-rotate ] with-side f ] } + { [ dup abs 2 = ] + [ sgn neg [ select-rotate ] with-side f ] } { [ drop t ] [ t ] } ! balance is -1 or 1, tree is taller } cond ; @@ -57,7 +62,8 @@ DEFER: avl-set 2dup node-key before? left right ? [ [ node-link avl-set ] keep swap >r tuck set-node-link r> - [ dup current-side get change-balance balance-insert ] [ f ] if + [ dup current-side get increase-balance balance-insert ] + [ f ] if ] with-side ; : (avl-set) ( value key node -- node taller? ) @@ -66,10 +72,10 @@ DEFER: avl-set ] [ avl-insert ] if ; : avl-set ( value key node -- node taller? ) - [ (avl-set) ] [ t ] if* ; + [ (avl-set) ] [ swap t ] if* ; M: avl set-at ( value key node -- node ) - [ avl-set drop ] change-root ; + [ avl-set drop ] change-root drop ; : delete-select-rotate ( node -- node shorter? ) dup node+link avl-node-balance zero? [ @@ -87,10 +93,10 @@ M: avl set-at ( value key node -- node ) } cond ; : balance-delete ( node -- node shorter? ) - current-side get over avl-node-balance { + current-side get over balance>> { { [ dup zero? ] [ drop neg over set-avl-node-balance f ] } - { [ dupd = ] [ drop 0 over set-avl-node-balance t ] } - [ dupd neg change-balance rebalance-delete ] + { [ dupd = ] [ drop 0 >>balance t ] } + [ dupd neg increase-balance rebalance-delete ] } cond ; : avl-replace-with-extremity ( to-replace node -- node shorter? ) @@ -135,12 +141,12 @@ M: avl-node avl-delete ( key node -- node shorter? deleted? ) ] if ; M: avl delete-at ( key node -- ) - [ avl-delete 2drop ] change-root ; + [ avl-delete 2drop ] change-root drop ; M: avl new-assoc 2drop ; : >avl ( assoc -- avl ) - T{ avl T{ tree f f 0 } } assoc-clone-like ; + T{ avl f f 0 } assoc-clone-like ; M: avl assoc-like drop dup avl? [ >avl ] unless ; diff --git a/extra/trees/splay/splay.factor b/extra/trees/splay/splay.factor old mode 100644 new mode 100755 index 8931db3a10..ef5fcf8ca6 --- a/extra/trees/splay/splay.factor +++ b/extra/trees/splay/splay.factor @@ -4,12 +4,10 @@ USING: arrays kernel math namespaces sequences assocs parser prettyprint.backend trees generic math.order ; IN: trees.splay -TUPLE: splay ; +TUPLE: splay < tree ; : ( -- tree ) - \ splay construct-tree ; - -INSTANCE: splay tree-mixin + \ splay new-tree ; : rotate-right ( node -- node ) dup node-left @@ -131,7 +129,7 @@ M: splay new-assoc 2drop ; : >splay ( assoc -- tree ) - T{ splay T{ tree f f 0 } } assoc-clone-like ; + T{ splay f f 0 } assoc-clone-like ; : SPLAY{ \ } [ >splay ] parse-literal ; parsing diff --git a/extra/trees/trees.factor b/extra/trees/trees.factor index 3cad81e447..3b0ab01666 100755 --- a/extra/trees/trees.factor +++ b/extra/trees/trees.factor @@ -5,23 +5,25 @@ prettyprint.private kernel.private assocs random combinators parser prettyprint.backend math.order accessors ; IN: trees -MIXIN: tree-mixin - TUPLE: tree root count ; +: new-tree ( class -- tree ) + new + f >>root + 0 >>count ; inline + : ( -- tree ) - f 0 tree boa ; + tree new-tree ; -: construct-tree ( class -- tree ) - new over set-delegate ; inline - -INSTANCE: tree tree-mixin - -INSTANCE: tree-mixin assoc +INSTANCE: tree assoc TUPLE: node key value left right ; + +: new-node ( key value class -- node ) + new swap >>value swap >>key ; + : ( key value -- node ) - f f node boa ; + node new-node ; SYMBOL: current-side @@ -57,9 +59,6 @@ SYMBOL: current-side : go-left ( quot -- ) left swap with-side ; inline : go-right ( quot -- ) right swap with-side ; inline -: change-root ( tree quot -- ) - swap [ root>> swap call ] keep set-tree-root ; inline - : leaf? ( node -- ? ) [ left>> ] [ right>> ] bi or not ; @@ -91,7 +90,7 @@ M: tree at* ( key tree -- value ? ) ] if ; M: tree set-at ( value key tree -- ) - [ [ node-set ] [ swap ] if* ] change-root ; + [ [ node-set ] [ swap ] if* ] change-root drop ; : valid-node? ( node -- ? ) [ @@ -117,10 +116,10 @@ M: tree set-at ( value key tree -- ) [ >r right>> r> find-node ] } cond ; inline -M: tree-mixin assoc-find ( tree quot -- key value ? ) +M: tree assoc-find ( tree quot -- key value ? ) >r root>> r> find-node ; -M: tree-mixin clear-assoc +M: tree clear-assoc 0 >>count f >>root drop ; @@ -182,7 +181,7 @@ DEFER: delete-node ] if ; M: tree delete-at - [ delete-bst-node ] change-root ; + [ delete-bst-node ] change-root drop ; M: tree new-assoc 2drop ; @@ -192,14 +191,12 @@ M: tree clone dup assoc-clone-like ; : >tree ( assoc -- tree ) T{ tree f f 0 } assoc-clone-like ; -M: tree-mixin assoc-like drop dup tree? [ >tree ] unless ; +M: tree assoc-like drop dup tree? [ >tree ] unless ; : TREE{ \ } [ >tree ] parse-literal ; parsing - + M: tree pprint-delims drop \ TREE{ \ } ; - -M: tree-mixin assoc-size count>> ; -M: tree-mixin clone dup assoc-clone-like ; -M: tree-mixin >pprint-sequence >alist ; -M: tree-mixin pprint-narrow? drop t ; +M: tree assoc-size count>> ; +M: tree >pprint-sequence >alist ; +M: tree pprint-narrow? drop t ; diff --git a/extra/ui/gadgets/gadgets-tests.factor b/extra/ui/gadgets/gadgets-tests.factor index dbe06ec8cd..f88b207603 100755 --- a/extra/ui/gadgets/gadgets-tests.factor +++ b/extra/ui/gadgets/gadgets-tests.factor @@ -124,7 +124,7 @@ M: mock-gadget ungraft* dup mock-gadget-ungraft-called 1+ swap set-mock-gadget-ungraft-called ; -! We can't print to stdio here because that might be a pane +! We can't print to output-stream here because that might be a pane ! stream, and our graft-queue rebinding here would be captured ! by code adding children to the pane... [ diff --git a/extra/ui/gadgets/panes/panes-docs.factor b/extra/ui/gadgets/panes/panes-docs.factor index a684153b98..99f8b2e82a 100755 --- a/extra/ui/gadgets/panes/panes-docs.factor +++ b/extra/ui/gadgets/panes/panes-docs.factor @@ -23,7 +23,7 @@ HELP: print-gadget HELP: gadget. { $values { "gadget" gadget } } -{ $description "Writes a gadget followed by a newline to the " { $link stdio } " stream." } +{ $description "Writes a gadget followed by a newline to " { $link output-stream } "." } { $notes "Not all streams support this operation." } ; HELP: ?nl @@ -32,11 +32,11 @@ HELP: ?nl HELP: with-pane { $values { "pane" pane } { "quot" quotation } } -{ $description "Clears the pane and calls the quotation in a new scope where " { $link stdio } " is rebound to a " { $link pane-stream } " writing to the pane." } ; +{ $description "Clears the pane and calls the quotation in a new scope where " { $link output-stream } " is rebound to a " { $link pane-stream } " writing to the pane." } ; HELP: make-pane { $values { "quot" quotation } { "gadget" "a new " { $link gadget } } } -{ $description "Calls the quotation in a new scope where " { $link stdio } " is rebound to a " { $link pane-stream } " writing to a new pane. The output area of the new pane is output on the stack after the quotation returns. The pane itself is not output." } ; +{ $description "Calls the quotation in a new scope where " { $link output-stream } " is rebound to a " { $link pane-stream } " writing to a new pane. The output area of the new pane is output on the stack after the quotation returns. The pane itself is not output." } ; HELP: { $values { "pane" "a new " { $link pane } } } diff --git a/extra/ui/gadgets/panes/panes-tests.factor b/extra/ui/gadgets/panes/panes-tests.factor index 0263b15d71..31bb4233bf 100755 --- a/extra/ui/gadgets/panes/panes-tests.factor +++ b/extra/ui/gadgets/panes/panes-tests.factor @@ -11,7 +11,7 @@ help.stylesheet splitting tools.test.ui models math inspector ; [ ] [ #children "num-children" set ] unit-test [ ] [ - "pane" get [ 10000 [ . ] each ] with-stream* + "pane" get [ 10000 [ . ] each ] with-output-stream* ] unit-test [ t ] [ #children "num-children" get = ] unit-test diff --git a/extra/ui/gadgets/panes/panes.factor b/extra/ui/gadgets/panes/panes.factor index bff0ca10ad..533a6c42b7 100755 --- a/extra/ui/gadgets/panes/panes.factor +++ b/extra/ui/gadgets/panes/panes.factor @@ -6,7 +6,7 @@ ui.gadgets.paragraphs ui.gadgets.incremental ui.gadgets.packs ui.gadgets.theme ui.clipboards ui.gestures ui.traverse ui.render hashtables io kernel namespaces sequences io.styles strings quotations math opengl combinators math.vectors -io.streams.duplex sorting splitting io.streams.nested assocs +sorting splitting io.streams.nested assocs ui.gadgets.presentations ui.gadgets.slots ui.gadgets.grids ui.gadgets.grid-lines classes.tuple models continuations ; IN: ui.gadgets.panes @@ -113,14 +113,11 @@ GENERIC: write-gadget ( gadget stream -- ) M: pane-stream write-gadget pane-stream-pane pane-current add-gadget ; -M: duplex-stream write-gadget - duplex-stream-out write-gadget ; - : print-gadget ( gadget stream -- ) tuck write-gadget stream-nl ; : gadget. ( gadget -- ) - stdio get print-gadget ; + output-stream get print-gadget ; : ?nl ( stream -- ) dup pane-stream-pane pane-current gadget-children empty? @@ -129,7 +126,7 @@ M: duplex-stream write-gadget : with-pane ( pane quot -- ) over scroll>top over pane-clear >r r> - over >r with-stream* r> ?nl ; inline + over >r with-output-stream* r> ?nl ; inline : make-pane ( quot -- gadget ) [ swap with-pane ] keep smash-pane ; inline diff --git a/extra/ui/tools/interactor/interactor.factor b/extra/ui/tools/interactor/interactor.factor index 6c8b77d1f2..4f5090fda2 100755 --- a/extra/ui/tools/interactor/interactor.factor +++ b/extra/ui/tools/interactor/interactor.factor @@ -71,7 +71,7 @@ M: interactor model-changed : interactor-input. ( string interactor -- ) interactor-output [ dup string? [ dup write-input nl ] [ short. ] if - ] with-stream* ; + ] with-output-stream* ; : add-interactor-history ( str interactor -- ) over empty? [ 2drop ] [ interactor-history push-new ] if ; diff --git a/extra/ui/tools/listener/listener.factor b/extra/ui/tools/listener/listener.factor index d96270075f..8fed776d5b 100755 --- a/extra/ui/tools/listener/listener.factor +++ b/extra/ui/tools/listener/listener.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: inspector ui.tools.interactor ui.tools.inspector -ui.tools.workspace help.markup io io.streams.duplex io.styles +ui.tools.workspace help.markup io io.styles kernel models namespaces parser quotations sequences ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.labelled ui.gadgets.panes ui.gadgets.buttons ui.gadgets.scrollers @@ -16,10 +16,8 @@ TUPLE: listener-gadget input output stack ; g-> set-listener-gadget-output "Output" 1 track, ; -: listener-stream ( listener -- stream ) - dup listener-gadget-input - swap listener-gadget-output - ; +: listener-streams ( listener -- input output ) + [ input>> ] [ output>> ] bi ; : ( listener -- gadget ) listener-gadget-output ; @@ -148,13 +146,15 @@ M: stack-display tool-scroller swap show-tool inspect-object ; : listener-thread ( listener -- ) - dup listener-stream [ - dup [ ui-listener-hook ] curry listener-hook set - dup [ ui-error-hook ] curry error-hook set - [ ui-inspector-hook ] curry inspector-hook set - welcome. - listener - ] with-stream* ; + dup listener-streams [ + [ + [ [ ui-listener-hook ] curry listener-hook set ] + [ [ ui-error-hook ] curry error-hook set ] + [ [ ui-inspector-hook ] curry inspector-hook set ] tri + welcome. + listener + ] with-input-stream* + ] with-output-stream* ; : start-listener-thread ( listener -- ) [ listener-thread ] curry "Listener" spawn drop ; diff --git a/extra/unicode/breaks/breaks.factor b/extra/unicode/breaks/breaks.factor index d8e4f8c24e..9ee65c0018 100644 --- a/extra/unicode/breaks/breaks.factor +++ b/extra/unicode/breaks/breaks.factor @@ -105,9 +105,6 @@ VALUE: grapheme-table : string-reverse ( str -- rts ) >graphemes reverse concat ; -: unclip-last-slice ( seq -- beginning last ) - dup 1 head-slice* swap peek ; - : last-grapheme ( str -- i ) unclip-last-slice grapheme-class swap [ grapheme-class dup rot grapheme-break? ] find-last-index ?1+ nip ; diff --git a/extra/unicode/script/Scripts.txt b/extra/unicode/script/Scripts.txt new file mode 100755 index 0000000000..7065486d3a --- /dev/null +++ b/extra/unicode/script/Scripts.txt @@ -0,0 +1,1747 @@ +# Scripts-5.1.0.txt +# Date: 2008-03-20, 17:55:33 GMT [MD] +# +# Unicode Character Database +# Copyright (c) 1991-2008 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# For documentation, see UCD.html + +# ================================================ + +# Property: Script + +# All code points not explicitly listed for Script +# have the value Unknown (Zzzz). + +# @missing: 0000..10FFFF; Unknown + +# ================================================ + +0000..001F ; Common # Cc [32] .. +0020 ; Common # Zs SPACE +0021..0023 ; Common # Po [3] EXCLAMATION MARK..NUMBER SIGN +0024 ; Common # Sc DOLLAR SIGN +0025..0027 ; Common # Po [3] PERCENT SIGN..APOSTROPHE +0028 ; Common # Ps LEFT PARENTHESIS +0029 ; Common # Pe RIGHT PARENTHESIS +002A ; Common # Po ASTERISK +002B ; Common # Sm PLUS SIGN +002C ; Common # Po COMMA +002D ; Common # Pd HYPHEN-MINUS +002E..002F ; Common # Po [2] FULL STOP..SOLIDUS +0030..0039 ; Common # Nd [10] DIGIT ZERO..DIGIT NINE +003A..003B ; Common # Po [2] COLON..SEMICOLON +003C..003E ; Common # Sm [3] LESS-THAN SIGN..GREATER-THAN SIGN +003F..0040 ; Common # Po [2] QUESTION MARK..COMMERCIAL AT +005B ; Common # Ps LEFT SQUARE BRACKET +005C ; Common # Po REVERSE SOLIDUS +005D ; Common # Pe RIGHT SQUARE BRACKET +005E ; Common # Sk CIRCUMFLEX ACCENT +005F ; Common # Pc LOW LINE +0060 ; Common # Sk GRAVE ACCENT +007B ; Common # Ps LEFT CURLY BRACKET +007C ; Common # Sm VERTICAL LINE +007D ; Common # Pe RIGHT CURLY BRACKET +007E ; Common # Sm TILDE +007F..009F ; Common # Cc [33] .. +00A0 ; Common # Zs NO-BREAK SPACE +00A1 ; Common # Po INVERTED EXCLAMATION MARK +00A2..00A5 ; Common # Sc [4] CENT SIGN..YEN SIGN +00A6..00A7 ; Common # So [2] BROKEN BAR..SECTION SIGN +00A8 ; Common # Sk DIAERESIS +00A9 ; Common # So COPYRIGHT SIGN +00AB ; Common # Pi LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00AC ; Common # Sm NOT SIGN +00AD ; Common # Cf SOFT HYPHEN +00AE ; Common # So REGISTERED SIGN +00AF ; Common # Sk MACRON +00B0 ; Common # So DEGREE SIGN +00B1 ; Common # Sm PLUS-MINUS SIGN +00B2..00B3 ; Common # No [2] SUPERSCRIPT TWO..SUPERSCRIPT THREE +00B4 ; Common # Sk ACUTE ACCENT +00B5 ; Common # L& MICRO SIGN +00B6 ; Common # So PILCROW SIGN +00B7 ; Common # Po MIDDLE DOT +00B8 ; Common # Sk CEDILLA +00B9 ; Common # No SUPERSCRIPT ONE +00BB ; Common # Pf RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +00BC..00BE ; Common # No [3] VULGAR FRACTION ONE QUARTER..VULGAR FRACTION THREE QUARTERS +00BF ; Common # Po INVERTED QUESTION MARK +00D7 ; Common # Sm MULTIPLICATION SIGN +00F7 ; Common # Sm DIVISION SIGN +02B9..02C1 ; Common # Lm [9] MODIFIER LETTER PRIME..MODIFIER LETTER REVERSED GLOTTAL STOP +02C2..02C5 ; Common # Sk [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD +02C6..02D1 ; Common # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON +02D2..02DF ; Common # Sk [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT +02E5..02EB ; Common # Sk [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK +02EC ; Common # Lm MODIFIER LETTER VOICING +02ED ; Common # Sk MODIFIER LETTER UNASPIRATED +02EE ; Common # Lm MODIFIER LETTER DOUBLE APOSTROPHE +02EF..02FF ; Common # Sk [17] MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW +0374 ; Common # Lm GREEK NUMERAL SIGN +037E ; Common # Po GREEK QUESTION MARK +0385 ; Common # Sk GREEK DIALYTIKA TONOS +0387 ; Common # Po GREEK ANO TELEIA +0589 ; Common # Po ARMENIAN FULL STOP +0600..0603 ; Common # Cf [4] ARABIC NUMBER SIGN..ARABIC SIGN SAFHA +060C ; Common # Po ARABIC COMMA +061B ; Common # Po ARABIC SEMICOLON +061F ; Common # Po ARABIC QUESTION MARK +0640 ; Common # Lm ARABIC TATWEEL +0660..0669 ; Common # Nd [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE +06DD ; Common # Cf ARABIC END OF AYAH +0964..0965 ; Common # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA +0970 ; Common # Po DEVANAGARI ABBREVIATION SIGN +0CF1..0CF2 ; Common # So [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA +0E3F ; Common # Sc THAI CURRENCY SYMBOL BAHT +10FB ; Common # Po GEORGIAN PARAGRAPH SEPARATOR +16EB..16ED ; Common # Po [3] RUNIC SINGLE PUNCTUATION..RUNIC CROSS PUNCTUATION +1735..1736 ; Common # Po [2] PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION +1802..1803 ; Common # Po [2] MONGOLIAN COMMA..MONGOLIAN FULL STOP +1805 ; Common # Po MONGOLIAN FOUR DOTS +2000..200A ; Common # Zs [11] EN QUAD..HAIR SPACE +200B ; Common # Cf ZERO WIDTH SPACE +200E..200F ; Common # Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +2010..2015 ; Common # Pd [6] HYPHEN..HORIZONTAL BAR +2016..2017 ; Common # Po [2] DOUBLE VERTICAL LINE..DOUBLE LOW LINE +2018 ; Common # Pi LEFT SINGLE QUOTATION MARK +2019 ; Common # Pf RIGHT SINGLE QUOTATION MARK +201A ; Common # Ps SINGLE LOW-9 QUOTATION MARK +201B..201C ; Common # Pi [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK +201D ; Common # Pf RIGHT DOUBLE QUOTATION MARK +201E ; Common # Ps DOUBLE LOW-9 QUOTATION MARK +201F ; Common # Pi DOUBLE HIGH-REVERSED-9 QUOTATION MARK +2020..2027 ; Common # Po [8] DAGGER..HYPHENATION POINT +2028 ; Common # Zl LINE SEPARATOR +2029 ; Common # Zp PARAGRAPH SEPARATOR +202A..202E ; Common # Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE +202F ; Common # Zs NARROW NO-BREAK SPACE +2030..2038 ; Common # Po [9] PER MILLE SIGN..CARET +2039 ; Common # Pi SINGLE LEFT-POINTING ANGLE QUOTATION MARK +203A ; Common # Pf SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +203B..203E ; Common # Po [4] REFERENCE MARK..OVERLINE +203F..2040 ; Common # Pc [2] UNDERTIE..CHARACTER TIE +2041..2043 ; Common # Po [3] CARET INSERTION POINT..HYPHEN BULLET +2044 ; Common # Sm FRACTION SLASH +2045 ; Common # Ps LEFT SQUARE BRACKET WITH QUILL +2046 ; Common # Pe RIGHT SQUARE BRACKET WITH QUILL +2047..2051 ; Common # Po [11] DOUBLE QUESTION MARK..TWO ASTERISKS ALIGNED VERTICALLY +2052 ; Common # Sm COMMERCIAL MINUS SIGN +2053 ; Common # Po SWUNG DASH +2054 ; Common # Pc INVERTED UNDERTIE +2055..205E ; Common # Po [10] FLOWER PUNCTUATION MARK..VERTICAL FOUR DOTS +205F ; Common # Zs MEDIUM MATHEMATICAL SPACE +2060..2064 ; Common # Cf [5] WORD JOINER..INVISIBLE PLUS +206A..206F ; Common # Cf [6] INHIBIT SYMMETRIC SWAPPING..NOMINAL DIGIT SHAPES +2070 ; Common # No SUPERSCRIPT ZERO +2074..2079 ; Common # No [6] SUPERSCRIPT FOUR..SUPERSCRIPT NINE +207A..207C ; Common # Sm [3] SUPERSCRIPT PLUS SIGN..SUPERSCRIPT EQUALS SIGN +207D ; Common # Ps SUPERSCRIPT LEFT PARENTHESIS +207E ; Common # Pe SUPERSCRIPT RIGHT PARENTHESIS +2080..2089 ; Common # No [10] SUBSCRIPT ZERO..SUBSCRIPT NINE +208A..208C ; Common # Sm [3] SUBSCRIPT PLUS SIGN..SUBSCRIPT EQUALS SIGN +208D ; Common # Ps SUBSCRIPT LEFT PARENTHESIS +208E ; Common # Pe SUBSCRIPT RIGHT PARENTHESIS +20A0..20B5 ; Common # Sc [22] EURO-CURRENCY SIGN..CEDI SIGN +2100..2101 ; Common # So [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT +2102 ; Common # L& DOUBLE-STRUCK CAPITAL C +2103..2106 ; Common # So [4] DEGREE CELSIUS..CADA UNA +2107 ; Common # L& EULER CONSTANT +2108..2109 ; Common # So [2] SCRUPLE..DEGREE FAHRENHEIT +210A..2113 ; Common # L& [10] SCRIPT SMALL G..SCRIPT SMALL L +2114 ; Common # So L B BAR SYMBOL +2115 ; Common # L& DOUBLE-STRUCK CAPITAL N +2116..2118 ; Common # So [3] NUMERO SIGN..SCRIPT CAPITAL P +2119..211D ; Common # L& [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R +211E..2123 ; Common # So [6] PRESCRIPTION TAKE..VERSICLE +2124 ; Common # L& DOUBLE-STRUCK CAPITAL Z +2125 ; Common # So OUNCE SIGN +2127 ; Common # So INVERTED OHM SIGN +2128 ; Common # L& BLACK-LETTER CAPITAL Z +2129 ; Common # So TURNED GREEK SMALL LETTER IOTA +212C..212D ; Common # L& [2] SCRIPT CAPITAL B..BLACK-LETTER CAPITAL C +212E ; Common # So ESTIMATED SYMBOL +212F..2131 ; Common # L& [3] SCRIPT SMALL E..SCRIPT CAPITAL F +2133..2134 ; Common # L& [2] SCRIPT CAPITAL M..SCRIPT SMALL O +2135..2138 ; Common # Lo [4] ALEF SYMBOL..DALET SYMBOL +2139 ; Common # L& INFORMATION SOURCE +213A..213B ; Common # So [2] ROTATED CAPITAL Q..FACSIMILE SIGN +213C..213F ; Common # L& [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STRUCK CAPITAL PI +2140..2144 ; Common # Sm [5] DOUBLE-STRUCK N-ARY SUMMATION..TURNED SANS-SERIF CAPITAL Y +2145..2149 ; Common # L& [5] DOUBLE-STRUCK ITALIC CAPITAL D..DOUBLE-STRUCK ITALIC SMALL J +214A ; Common # So PROPERTY LINE +214B ; Common # Sm TURNED AMPERSAND +214C..214D ; Common # So [2] PER SIGN..AKTIESELSKAB +214F ; Common # So SYMBOL FOR SAMARITAN SOURCE +2153..215F ; Common # No [13] VULGAR FRACTION ONE THIRD..FRACTION NUMERATOR ONE +2190..2194 ; Common # Sm [5] LEFTWARDS ARROW..LEFT RIGHT ARROW +2195..2199 ; Common # So [5] UP DOWN ARROW..SOUTH WEST ARROW +219A..219B ; Common # Sm [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE +219C..219F ; Common # So [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW +21A0 ; Common # Sm RIGHTWARDS TWO HEADED ARROW +21A1..21A2 ; Common # So [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL +21A3 ; Common # Sm RIGHTWARDS ARROW WITH TAIL +21A4..21A5 ; Common # So [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR +21A6 ; Common # Sm RIGHTWARDS ARROW FROM BAR +21A7..21AD ; Common # So [7] DOWNWARDS ARROW FROM BAR..LEFT RIGHT WAVE ARROW +21AE ; Common # Sm LEFT RIGHT ARROW WITH STROKE +21AF..21CD ; Common # So [31] DOWNWARDS ZIGZAG ARROW..LEFTWARDS DOUBLE ARROW WITH STROKE +21CE..21CF ; Common # Sm [2] LEFT RIGHT DOUBLE ARROW WITH STROKE..RIGHTWARDS DOUBLE ARROW WITH STROKE +21D0..21D1 ; Common # So [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW +21D2 ; Common # Sm RIGHTWARDS DOUBLE ARROW +21D3 ; Common # So DOWNWARDS DOUBLE ARROW +21D4 ; Common # Sm LEFT RIGHT DOUBLE ARROW +21D5..21F3 ; Common # So [31] UP DOWN DOUBLE ARROW..UP DOWN WHITE ARROW +21F4..22FF ; Common # Sm [268] RIGHT ARROW WITH SMALL CIRCLE..Z NOTATION BAG MEMBERSHIP +2300..2307 ; Common # So [8] DIAMETER SIGN..WAVY LINE +2308..230B ; Common # Sm [4] LEFT CEILING..RIGHT FLOOR +230C..231F ; Common # So [20] BOTTOM RIGHT CROP..BOTTOM RIGHT CORNER +2320..2321 ; Common # Sm [2] TOP HALF INTEGRAL..BOTTOM HALF INTEGRAL +2322..2328 ; Common # So [7] FROWN..KEYBOARD +2329 ; Common # Ps LEFT-POINTING ANGLE BRACKET +232A ; Common # Pe RIGHT-POINTING ANGLE BRACKET +232B..237B ; Common # So [81] ERASE TO THE LEFT..NOT CHECK MARK +237C ; Common # Sm RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW +237D..239A ; Common # So [30] SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL +239B..23B3 ; Common # Sm [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM +23B4..23DB ; Common # So [40] TOP SQUARE BRACKET..FUSE +23DC..23E1 ; Common # Sm [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET +23E2..23E7 ; Common # So [6] WHITE TRAPEZIUM..ELECTRICAL INTERSECTION +2400..2426 ; Common # So [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO +2440..244A ; Common # So [11] OCR HOOK..OCR DOUBLE BACKSLASH +2460..249B ; Common # No [60] CIRCLED DIGIT ONE..NUMBER TWENTY FULL STOP +249C..24E9 ; Common # So [78] PARENTHESIZED LATIN SMALL LETTER A..CIRCLED LATIN SMALL LETTER Z +24EA..24FF ; Common # No [22] CIRCLED DIGIT ZERO..NEGATIVE CIRCLED DIGIT ZERO +2500..25B6 ; Common # So [183] BOX DRAWINGS LIGHT HORIZONTAL..BLACK RIGHT-POINTING TRIANGLE +25B7 ; Common # Sm WHITE RIGHT-POINTING TRIANGLE +25B8..25C0 ; Common # So [9] BLACK RIGHT-POINTING SMALL TRIANGLE..BLACK LEFT-POINTING TRIANGLE +25C1 ; Common # Sm WHITE LEFT-POINTING TRIANGLE +25C2..25F7 ; Common # So [54] BLACK LEFT-POINTING SMALL TRIANGLE..WHITE CIRCLE WITH UPPER RIGHT QUADRANT +25F8..25FF ; Common # Sm [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE +2600..266E ; Common # So [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN +266F ; Common # Sm MUSIC SHARP SIGN +2670..269D ; Common # So [46] WEST SYRIAC CROSS..OUTLINED WHITE STAR +26A0..26BC ; Common # So [29] WARNING SIGN..SESQUIQUADRATE +26C0..26C3 ; Common # So [4] WHITE DRAUGHTS MAN..BLACK DRAUGHTS KING +2701..2704 ; Common # So [4] UPPER BLADE SCISSORS..WHITE SCISSORS +2706..2709 ; Common # So [4] TELEPHONE LOCATION SIGN..ENVELOPE +270C..2727 ; Common # So [28] VICTORY HAND..WHITE FOUR POINTED STAR +2729..274B ; Common # So [35] STRESS OUTLINED WHITE STAR..HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK +274D ; Common # So SHADOWED WHITE CIRCLE +274F..2752 ; Common # So [4] LOWER RIGHT DROP-SHADOWED WHITE SQUARE..UPPER RIGHT SHADOWED WHITE SQUARE +2756 ; Common # So BLACK DIAMOND MINUS WHITE X +2758..275E ; Common # So [7] LIGHT VERTICAL BAR..HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT +2761..2767 ; Common # So [7] CURVED STEM PARAGRAPH SIGN ORNAMENT..ROTATED FLORAL HEART BULLET +2768 ; Common # Ps MEDIUM LEFT PARENTHESIS ORNAMENT +2769 ; Common # Pe MEDIUM RIGHT PARENTHESIS ORNAMENT +276A ; Common # Ps MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT +276B ; Common # Pe MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT +276C ; Common # Ps MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT +276D ; Common # Pe MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT +276E ; Common # Ps HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT +276F ; Common # Pe HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT +2770 ; Common # Ps HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT +2771 ; Common # Pe HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT +2772 ; Common # Ps LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT +2773 ; Common # Pe LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT +2774 ; Common # Ps MEDIUM LEFT CURLY BRACKET ORNAMENT +2775 ; Common # Pe MEDIUM RIGHT CURLY BRACKET ORNAMENT +2776..2793 ; Common # No [30] DINGBAT NEGATIVE CIRCLED DIGIT ONE..DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN +2794 ; Common # So HEAVY WIDE-HEADED RIGHTWARDS ARROW +2798..27AF ; Common # So [24] HEAVY SOUTH EAST ARROW..NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW +27B1..27BE ; Common # So [14] NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW..OPEN-OUTLINED RIGHTWARDS ARROW +27C0..27C4 ; Common # Sm [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET +27C5 ; Common # Ps LEFT S-SHAPED BAG DELIMITER +27C6 ; Common # Pe RIGHT S-SHAPED BAG DELIMITER +27C7..27CA ; Common # Sm [4] OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE +27CC ; Common # Sm LONG DIVISION +27D0..27E5 ; Common # Sm [22] WHITE DIAMOND WITH CENTRED DOT..WHITE SQUARE WITH RIGHTWARDS TICK +27E6 ; Common # Ps MATHEMATICAL LEFT WHITE SQUARE BRACKET +27E7 ; Common # Pe MATHEMATICAL RIGHT WHITE SQUARE BRACKET +27E8 ; Common # Ps MATHEMATICAL LEFT ANGLE BRACKET +27E9 ; Common # Pe MATHEMATICAL RIGHT ANGLE BRACKET +27EA ; Common # Ps MATHEMATICAL LEFT DOUBLE ANGLE BRACKET +27EB ; Common # Pe MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET +27EC ; Common # Ps MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET +27ED ; Common # Pe MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET +27EE ; Common # Ps MATHEMATICAL LEFT FLATTENED PARENTHESIS +27EF ; Common # Pe MATHEMATICAL RIGHT FLATTENED PARENTHESIS +27F0..27FF ; Common # Sm [16] UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW +2900..2982 ; Common # Sm [131] RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..Z NOTATION TYPE COLON +2983 ; Common # Ps LEFT WHITE CURLY BRACKET +2984 ; Common # Pe RIGHT WHITE CURLY BRACKET +2985 ; Common # Ps LEFT WHITE PARENTHESIS +2986 ; Common # Pe RIGHT WHITE PARENTHESIS +2987 ; Common # Ps Z NOTATION LEFT IMAGE BRACKET +2988 ; Common # Pe Z NOTATION RIGHT IMAGE BRACKET +2989 ; Common # Ps Z NOTATION LEFT BINDING BRACKET +298A ; Common # Pe Z NOTATION RIGHT BINDING BRACKET +298B ; Common # Ps LEFT SQUARE BRACKET WITH UNDERBAR +298C ; Common # Pe RIGHT SQUARE BRACKET WITH UNDERBAR +298D ; Common # Ps LEFT SQUARE BRACKET WITH TICK IN TOP CORNER +298E ; Common # Pe RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +298F ; Common # Ps LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +2990 ; Common # Pe RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER +2991 ; Common # Ps LEFT ANGLE BRACKET WITH DOT +2992 ; Common # Pe RIGHT ANGLE BRACKET WITH DOT +2993 ; Common # Ps LEFT ARC LESS-THAN BRACKET +2994 ; Common # Pe RIGHT ARC GREATER-THAN BRACKET +2995 ; Common # Ps DOUBLE LEFT ARC GREATER-THAN BRACKET +2996 ; Common # Pe DOUBLE RIGHT ARC LESS-THAN BRACKET +2997 ; Common # Ps LEFT BLACK TORTOISE SHELL BRACKET +2998 ; Common # Pe RIGHT BLACK TORTOISE SHELL BRACKET +2999..29D7 ; Common # Sm [63] DOTTED FENCE..BLACK HOURGLASS +29D8 ; Common # Ps LEFT WIGGLY FENCE +29D9 ; Common # Pe RIGHT WIGGLY FENCE +29DA ; Common # Ps LEFT DOUBLE WIGGLY FENCE +29DB ; Common # Pe RIGHT DOUBLE WIGGLY FENCE +29DC..29FB ; Common # Sm [32] INCOMPLETE INFINITY..TRIPLE PLUS +29FC ; Common # Ps LEFT-POINTING CURVED ANGLE BRACKET +29FD ; Common # Pe RIGHT-POINTING CURVED ANGLE BRACKET +29FE..2AFF ; Common # Sm [258] TINY..N-ARY WHITE VERTICAL BAR +2B00..2B2F ; Common # So [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE +2B30..2B44 ; Common # Sm [21] LEFT ARROW WITH SMALL CIRCLE..RIGHTWARDS ARROW THROUGH SUPERSET +2B45..2B46 ; Common # So [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW +2B47..2B4C ; Common # Sm [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR +2B50..2B54 ; Common # So [5] WHITE MEDIUM STAR..WHITE RIGHT-POINTING PENTAGON +2E00..2E01 ; Common # Po [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER +2E02 ; Common # Pi LEFT SUBSTITUTION BRACKET +2E03 ; Common # Pf RIGHT SUBSTITUTION BRACKET +2E04 ; Common # Pi LEFT DOTTED SUBSTITUTION BRACKET +2E05 ; Common # Pf RIGHT DOTTED SUBSTITUTION BRACKET +2E06..2E08 ; Common # Po [3] RAISED INTERPOLATION MARKER..DOTTED TRANSPOSITION MARKER +2E09 ; Common # Pi LEFT TRANSPOSITION BRACKET +2E0A ; Common # Pf RIGHT TRANSPOSITION BRACKET +2E0B ; Common # Po RAISED SQUARE +2E0C ; Common # Pi LEFT RAISED OMISSION BRACKET +2E0D ; Common # Pf RIGHT RAISED OMISSION BRACKET +2E0E..2E16 ; Common # Po [9] EDITORIAL CORONIS..DOTTED RIGHT-POINTING ANGLE +2E17 ; Common # Pd DOUBLE OBLIQUE HYPHEN +2E18..2E19 ; Common # Po [2] INVERTED INTERROBANG..PALM BRANCH +2E1A ; Common # Pd HYPHEN WITH DIAERESIS +2E1B ; Common # Po TILDE WITH RING ABOVE +2E1C ; Common # Pi LEFT LOW PARAPHRASE BRACKET +2E1D ; Common # Pf RIGHT LOW PARAPHRASE BRACKET +2E1E..2E1F ; Common # Po [2] TILDE WITH DOT ABOVE..TILDE WITH DOT BELOW +2E20 ; Common # Pi LEFT VERTICAL BAR WITH QUILL +2E21 ; Common # Pf RIGHT VERTICAL BAR WITH QUILL +2E22 ; Common # Ps TOP LEFT HALF BRACKET +2E23 ; Common # Pe TOP RIGHT HALF BRACKET +2E24 ; Common # Ps BOTTOM LEFT HALF BRACKET +2E25 ; Common # Pe BOTTOM RIGHT HALF BRACKET +2E26 ; Common # Ps LEFT SIDEWAYS U BRACKET +2E27 ; Common # Pe RIGHT SIDEWAYS U BRACKET +2E28 ; Common # Ps LEFT DOUBLE PARENTHESIS +2E29 ; Common # Pe RIGHT DOUBLE PARENTHESIS +2E2A..2E2E ; Common # Po [5] TWO DOTS OVER ONE DOT PUNCTUATION..REVERSED QUESTION MARK +2E2F ; Common # Lm VERTICAL TILDE +2E30 ; Common # Po RING POINT +2FF0..2FFB ; Common # So [12] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID +3000 ; Common # Zs IDEOGRAPHIC SPACE +3001..3003 ; Common # Po [3] IDEOGRAPHIC COMMA..DITTO MARK +3004 ; Common # So JAPANESE INDUSTRIAL STANDARD SYMBOL +3006 ; Common # Lo IDEOGRAPHIC CLOSING MARK +3008 ; Common # Ps LEFT ANGLE BRACKET +3009 ; Common # Pe RIGHT ANGLE BRACKET +300A ; Common # Ps LEFT DOUBLE ANGLE BRACKET +300B ; Common # Pe RIGHT DOUBLE ANGLE BRACKET +300C ; Common # Ps LEFT CORNER BRACKET +300D ; Common # Pe RIGHT CORNER BRACKET +300E ; Common # Ps LEFT WHITE CORNER BRACKET +300F ; Common # Pe RIGHT WHITE CORNER BRACKET +3010 ; Common # Ps LEFT BLACK LENTICULAR BRACKET +3011 ; Common # Pe RIGHT BLACK LENTICULAR BRACKET +3012..3013 ; Common # So [2] POSTAL MARK..GETA MARK +3014 ; Common # Ps LEFT TORTOISE SHELL BRACKET +3015 ; Common # Pe RIGHT TORTOISE SHELL BRACKET +3016 ; Common # Ps LEFT WHITE LENTICULAR BRACKET +3017 ; Common # Pe RIGHT WHITE LENTICULAR BRACKET +3018 ; Common # Ps LEFT WHITE TORTOISE SHELL BRACKET +3019 ; Common # Pe RIGHT WHITE TORTOISE SHELL BRACKET +301A ; Common # Ps LEFT WHITE SQUARE BRACKET +301B ; Common # Pe RIGHT WHITE SQUARE BRACKET +301C ; Common # Pd WAVE DASH +301D ; Common # Ps REVERSED DOUBLE PRIME QUOTATION MARK +301E..301F ; Common # Pe [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK +3020 ; Common # So POSTAL MARK FACE +3030 ; Common # Pd WAVY DASH +3031..3035 ; Common # Lm [5] VERTICAL KANA REPEAT MARK..VERTICAL KANA REPEAT MARK LOWER HALF +3036..3037 ; Common # So [2] CIRCLED POSTAL MARK..IDEOGRAPHIC TELEGRAPH LINE FEED SEPARATOR SYMBOL +303C ; Common # Lo MASU MARK +303D ; Common # Po PART ALTERNATION MARK +303E..303F ; Common # So [2] IDEOGRAPHIC VARIATION INDICATOR..IDEOGRAPHIC HALF FILL SPACE +309B..309C ; Common # Sk [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +30A0 ; Common # Pd KATAKANA-HIRAGANA DOUBLE HYPHEN +30FB ; Common # Po KATAKANA MIDDLE DOT +30FC ; Common # Lm KATAKANA-HIRAGANA PROLONGED SOUND MARK +3190..3191 ; Common # So [2] IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRAPHIC ANNOTATION REVERSE MARK +3192..3195 ; Common # No [4] IDEOGRAPHIC ANNOTATION ONE MARK..IDEOGRAPHIC ANNOTATION FOUR MARK +3196..319F ; Common # So [10] IDEOGRAPHIC ANNOTATION TOP MARK..IDEOGRAPHIC ANNOTATION MAN MARK +31C0..31E3 ; Common # So [36] CJK STROKE T..CJK STROKE Q +3220..3229 ; Common # No [10] PARENTHESIZED IDEOGRAPH ONE..PARENTHESIZED IDEOGRAPH TEN +322A..3243 ; Common # So [26] PARENTHESIZED IDEOGRAPH MOON..PARENTHESIZED IDEOGRAPH REACH +3250 ; Common # So PARTNERSHIP SIGN +3251..325F ; Common # No [15] CIRCLED NUMBER TWENTY ONE..CIRCLED NUMBER THIRTY FIVE +327F ; Common # So KOREAN STANDARD SYMBOL +3280..3289 ; Common # No [10] CIRCLED IDEOGRAPH ONE..CIRCLED IDEOGRAPH TEN +328A..32B0 ; Common # So [39] CIRCLED IDEOGRAPH MOON..CIRCLED IDEOGRAPH NIGHT +32B1..32BF ; Common # No [15] CIRCLED NUMBER THIRTY SIX..CIRCLED NUMBER FIFTY +32C0..32CF ; Common # So [16] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..LIMITED LIABILITY SIGN +3358..33FF ; Common # So [168] IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO..SQUARE GAL +4DC0..4DFF ; Common # So [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION +A700..A716 ; Common # Sk [23] MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR +A717..A71F ; Common # Lm [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK +A720..A721 ; Common # Sk [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE +A788 ; Common # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT +A789..A78A ; Common # Sk [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN +FD3E ; Common # Ps ORNATE LEFT PARENTHESIS +FD3F ; Common # Pe ORNATE RIGHT PARENTHESIS +FDFD ; Common # So ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM +FE10..FE16 ; Common # Po [7] PRESENTATION FORM FOR VERTICAL COMMA..PRESENTATION FORM FOR VERTICAL QUESTION MARK +FE17 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET +FE18 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET +FE19 ; Common # Po PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS +FE30 ; Common # Po PRESENTATION FORM FOR VERTICAL TWO DOT LEADER +FE31..FE32 ; Common # Pd [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH +FE33..FE34 ; Common # Pc [2] PRESENTATION FORM FOR VERTICAL LOW LINE..PRESENTATION FORM FOR VERTICAL WAVY LOW LINE +FE35 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS +FE36 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS +FE37 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET +FE38 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET +FE39 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET +FE3A ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET +FE3B ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET +FE3C ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET +FE3D ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET +FE3E ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET +FE3F ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET +FE40 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET +FE41 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET +FE42 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET +FE43 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET +FE44 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET +FE45..FE46 ; Common # Po [2] SESAME DOT..WHITE SESAME DOT +FE47 ; Common # Ps PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET +FE48 ; Common # Pe PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET +FE49..FE4C ; Common # Po [4] DASHED OVERLINE..DOUBLE WAVY OVERLINE +FE4D..FE4F ; Common # Pc [3] DASHED LOW LINE..WAVY LOW LINE +FE50..FE52 ; Common # Po [3] SMALL COMMA..SMALL FULL STOP +FE54..FE57 ; Common # Po [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK +FE58 ; Common # Pd SMALL EM DASH +FE59 ; Common # Ps SMALL LEFT PARENTHESIS +FE5A ; Common # Pe SMALL RIGHT PARENTHESIS +FE5B ; Common # Ps SMALL LEFT CURLY BRACKET +FE5C ; Common # Pe SMALL RIGHT CURLY BRACKET +FE5D ; Common # Ps SMALL LEFT TORTOISE SHELL BRACKET +FE5E ; Common # Pe SMALL RIGHT TORTOISE SHELL BRACKET +FE5F..FE61 ; Common # Po [3] SMALL NUMBER SIGN..SMALL ASTERISK +FE62 ; Common # Sm SMALL PLUS SIGN +FE63 ; Common # Pd SMALL HYPHEN-MINUS +FE64..FE66 ; Common # Sm [3] SMALL LESS-THAN SIGN..SMALL EQUALS SIGN +FE68 ; Common # Po SMALL REVERSE SOLIDUS +FE69 ; Common # Sc SMALL DOLLAR SIGN +FE6A..FE6B ; Common # Po [2] SMALL PERCENT SIGN..SMALL COMMERCIAL AT +FEFF ; Common # Cf ZERO WIDTH NO-BREAK SPACE +FF01..FF03 ; Common # Po [3] FULLWIDTH EXCLAMATION MARK..FULLWIDTH NUMBER SIGN +FF04 ; Common # Sc FULLWIDTH DOLLAR SIGN +FF05..FF07 ; Common # Po [3] FULLWIDTH PERCENT SIGN..FULLWIDTH APOSTROPHE +FF08 ; Common # Ps FULLWIDTH LEFT PARENTHESIS +FF09 ; Common # Pe FULLWIDTH RIGHT PARENTHESIS +FF0A ; Common # Po FULLWIDTH ASTERISK +FF0B ; Common # Sm FULLWIDTH PLUS SIGN +FF0C ; Common # Po FULLWIDTH COMMA +FF0D ; Common # Pd FULLWIDTH HYPHEN-MINUS +FF0E..FF0F ; Common # Po [2] FULLWIDTH FULL STOP..FULLWIDTH SOLIDUS +FF10..FF19 ; Common # Nd [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE +FF1A..FF1B ; Common # Po [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON +FF1C..FF1E ; Common # Sm [3] FULLWIDTH LESS-THAN SIGN..FULLWIDTH GREATER-THAN SIGN +FF1F..FF20 ; Common # Po [2] FULLWIDTH QUESTION MARK..FULLWIDTH COMMERCIAL AT +FF3B ; Common # Ps FULLWIDTH LEFT SQUARE BRACKET +FF3C ; Common # Po FULLWIDTH REVERSE SOLIDUS +FF3D ; Common # Pe FULLWIDTH RIGHT SQUARE BRACKET +FF3E ; Common # Sk FULLWIDTH CIRCUMFLEX ACCENT +FF3F ; Common # Pc FULLWIDTH LOW LINE +FF40 ; Common # Sk FULLWIDTH GRAVE ACCENT +FF5B ; Common # Ps FULLWIDTH LEFT CURLY BRACKET +FF5C ; Common # Sm FULLWIDTH VERTICAL LINE +FF5D ; Common # Pe FULLWIDTH RIGHT CURLY BRACKET +FF5E ; Common # Sm FULLWIDTH TILDE +FF5F ; Common # Ps FULLWIDTH LEFT WHITE PARENTHESIS +FF60 ; Common # Pe FULLWIDTH RIGHT WHITE PARENTHESIS +FF61 ; Common # Po HALFWIDTH IDEOGRAPHIC FULL STOP +FF62 ; Common # Ps HALFWIDTH LEFT CORNER BRACKET +FF63 ; Common # Pe HALFWIDTH RIGHT CORNER BRACKET +FF64..FF65 ; Common # Po [2] HALFWIDTH IDEOGRAPHIC COMMA..HALFWIDTH KATAKANA MIDDLE DOT +FF70 ; Common # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK +FF9E..FF9F ; Common # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +FFE0..FFE1 ; Common # Sc [2] FULLWIDTH CENT SIGN..FULLWIDTH POUND SIGN +FFE2 ; Common # Sm FULLWIDTH NOT SIGN +FFE3 ; Common # Sk FULLWIDTH MACRON +FFE4 ; Common # So FULLWIDTH BROKEN BAR +FFE5..FFE6 ; Common # Sc [2] FULLWIDTH YEN SIGN..FULLWIDTH WON SIGN +FFE8 ; Common # So HALFWIDTH FORMS LIGHT VERTICAL +FFE9..FFEC ; Common # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW +FFED..FFEE ; Common # So [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CIRCLE +FFF9..FFFB ; Common # Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR +FFFC..FFFD ; Common # So [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER +10100..10101 ; Common # Po [2] AEGEAN WORD SEPARATOR LINE..AEGEAN WORD SEPARATOR DOT +10102 ; Common # So AEGEAN CHECK MARK +10107..10133 ; Common # No [45] AEGEAN NUMBER ONE..AEGEAN NUMBER NINETY THOUSAND +10137..1013F ; Common # So [9] AEGEAN WEIGHT BASE UNIT..AEGEAN MEASURE THIRD SUBUNIT +10190..1019B ; Common # So [12] ROMAN SEXTANS SIGN..ROMAN CENTURIAL SIGN +101D0..101FC ; Common # So [45] PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC SIGN WAVY BAND +1D000..1D0F5 ; Common # So [246] BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MUSICAL SYMBOL GORGON NEO KATO +1D100..1D126 ; Common # So [39] MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBOL DRUM CLEF-2 +1D129..1D164 ; Common # So [60] MUSICAL SYMBOL MULTIPLE MEASURE REST..MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE +1D165..1D166 ; Common # Mc [2] MUSICAL SYMBOL COMBINING STEM..MUSICAL SYMBOL COMBINING SPRECHGESANG STEM +1D16A..1D16C ; Common # So [3] MUSICAL SYMBOL FINGERED TREMOLO-1..MUSICAL SYMBOL FINGERED TREMOLO-3 +1D16D..1D172 ; Common # Mc [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5 +1D173..1D17A ; Common # Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE +1D183..1D184 ; Common # So [2] MUSICAL SYMBOL ARPEGGIATO UP..MUSICAL SYMBOL ARPEGGIATO DOWN +1D18C..1D1A9 ; Common # So [30] MUSICAL SYMBOL RINFORZANDO..MUSICAL SYMBOL DEGREE SLASH +1D1AE..1D1DD ; Common # So [48] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL PES SUBPUNCTIS +1D300..1D356 ; Common # So [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING +1D360..1D371 ; Common # No [18] COUNTING ROD UNIT DIGIT ONE..COUNTING ROD TENS DIGIT NINE +1D400..1D454 ; Common # L& [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G +1D456..1D49C ; Common # L& [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A +1D49E..1D49F ; Common # L& [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D +1D4A2 ; Common # L& MATHEMATICAL SCRIPT CAPITAL G +1D4A5..1D4A6 ; Common # L& [2] MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL SCRIPT CAPITAL K +1D4A9..1D4AC ; Common # L& [4] MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL SCRIPT CAPITAL Q +1D4AE..1D4B9 ; Common # L& [12] MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL SCRIPT SMALL D +1D4BB ; Common # L& MATHEMATICAL SCRIPT SMALL F +1D4BD..1D4C3 ; Common # L& [7] MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SCRIPT SMALL N +1D4C5..1D505 ; Common # L& [65] MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL FRAKTUR CAPITAL B +1D507..1D50A ; Common # L& [4] MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL FRAKTUR CAPITAL G +1D50D..1D514 ; Common # L& [8] MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL FRAKTUR CAPITAL Q +1D516..1D51C ; Common # L& [7] MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL FRAKTUR CAPITAL Y +1D51E..1D539 ; Common # L& [28] MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL DOUBLE-STRUCK CAPITAL B +1D53B..1D53E ; Common # L& [4] MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEMATICAL DOUBLE-STRUCK CAPITAL G +1D540..1D544 ; Common # L& [5] MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEMATICAL DOUBLE-STRUCK CAPITAL M +1D546 ; Common # L& MATHEMATICAL DOUBLE-STRUCK CAPITAL O +1D54A..1D550 ; Common # L& [7] MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEMATICAL DOUBLE-STRUCK CAPITAL Y +1D552..1D6A5 ; Common # L& [340] MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMATICAL ITALIC SMALL DOTLESS J +1D6A8..1D6C0 ; Common # L& [25] MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICAL BOLD CAPITAL OMEGA +1D6C1 ; Common # Sm MATHEMATICAL BOLD NABLA +1D6C2..1D6DA ; Common # L& [25] MATHEMATICAL BOLD SMALL ALPHA..MATHEMATICAL BOLD SMALL OMEGA +1D6DB ; Common # Sm MATHEMATICAL BOLD PARTIAL DIFFERENTIAL +1D6DC..1D6FA ; Common # L& [31] MATHEMATICAL BOLD EPSILON SYMBOL..MATHEMATICAL ITALIC CAPITAL OMEGA +1D6FB ; Common # Sm MATHEMATICAL ITALIC NABLA +1D6FC..1D714 ; Common # L& [25] MATHEMATICAL ITALIC SMALL ALPHA..MATHEMATICAL ITALIC SMALL OMEGA +1D715 ; Common # Sm MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL +1D716..1D734 ; Common # L& [31] MATHEMATICAL ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD ITALIC CAPITAL OMEGA +1D735 ; Common # Sm MATHEMATICAL BOLD ITALIC NABLA +1D736..1D74E ; Common # L& [25] MATHEMATICAL BOLD ITALIC SMALL ALPHA..MATHEMATICAL BOLD ITALIC SMALL OMEGA +1D74F ; Common # Sm MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL +1D750..1D76E ; Common # L& [31] MATHEMATICAL BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA +1D76F ; Common # Sm MATHEMATICAL SANS-SERIF BOLD NABLA +1D770..1D788 ; Common # L& [25] MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA +1D789 ; Common # Sm MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL +1D78A..1D7A8 ; Common # L& [31] MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA +1D7A9 ; Common # Sm MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA +1D7AA..1D7C2 ; Common # L& [25] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA +1D7C3 ; Common # Sm MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL +1D7C4..1D7CB ; Common # L& [8] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD SMALL DIGAMMA +1D7CE..1D7FF ; Common # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE +1F000..1F02B ; Common # So [44] MAHJONG TILE EAST WIND..MAHJONG TILE BACK +1F030..1F093 ; Common # So [100] DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06 +E0001 ; Common # Cf LANGUAGE TAG +E0020..E007F ; Common # Cf [96] TAG SPACE..CANCEL TAG + +# Total code points: 5178 + +# ================================================ + +0041..005A ; Latin # L& [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z +0061..007A ; Latin # L& [26] LATIN SMALL LETTER A..LATIN SMALL LETTER Z +00AA ; Latin # L& FEMININE ORDINAL INDICATOR +00BA ; Latin # L& MASCULINE ORDINAL INDICATOR +00C0..00D6 ; Latin # L& [23] LATIN CAPITAL LETTER A WITH GRAVE..LATIN CAPITAL LETTER O WITH DIAERESIS +00D8..00F6 ; Latin # L& [31] LATIN CAPITAL LETTER O WITH STROKE..LATIN SMALL LETTER O WITH DIAERESIS +00F8..01BA ; Latin # L& [195] LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER EZH WITH TAIL +01BB ; Latin # Lo LATIN LETTER TWO WITH STROKE +01BC..01BF ; Latin # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN +01C0..01C3 ; Latin # Lo [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK +01C4..0293 ; Latin # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL +0294 ; Latin # Lo LATIN LETTER GLOTTAL STOP +0295..02AF ; Latin # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +02B0..02B8 ; Latin # Lm [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y +02E0..02E4 ; Latin # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +1D00..1D25 ; Latin # L& [38] LATIN LETTER SMALL CAPITAL A..LATIN LETTER AIN +1D2C..1D5C ; Latin # Lm [49] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL AIN +1D62..1D65 ; Latin # L& [4] LATIN SUBSCRIPT SMALL LETTER I..LATIN SUBSCRIPT SMALL LETTER V +1D6B..1D77 ; Latin # L& [13] LATIN SMALL LETTER UE..LATIN SMALL LETTER TURNED G +1D79..1D9A ; Latin # L& [34] LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK +1D9B..1DBE ; Latin # Lm [36] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL EZH +1E00..1EFF ; Latin # L& [256] LATIN CAPITAL LETTER A WITH RING BELOW..LATIN SMALL LETTER Y WITH LOOP +2071 ; Latin # L& SUPERSCRIPT LATIN SMALL LETTER I +207F ; Latin # L& SUPERSCRIPT LATIN SMALL LETTER N +2090..2094 ; Latin # Lm [5] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER SCHWA +212A..212B ; Latin # L& [2] KELVIN SIGN..ANGSTROM SIGN +2132 ; Latin # L& TURNED CAPITAL F +214E ; Latin # L& TURNED SMALL F +2160..2182 ; Latin # Nl [35] ROMAN NUMERAL ONE..ROMAN NUMERAL TEN THOUSAND +2183..2184 ; Latin # L& [2] ROMAN NUMERAL REVERSED ONE HUNDRED..LATIN SMALL LETTER REVERSED C +2185..2188 ; Latin # Nl [4] ROMAN NUMERAL SIX LATE FORM..ROMAN NUMERAL ONE HUNDRED THOUSAND +2C60..2C6F ; Latin # L& [16] LATIN CAPITAL LETTER L WITH DOUBLE BAR..LATIN CAPITAL LETTER TURNED A +2C71..2C7C ; Latin # L& [12] LATIN SMALL LETTER V WITH RIGHT HOOK..LATIN SUBSCRIPT SMALL LETTER J +2C7D ; Latin # Lm MODIFIER LETTER CAPITAL V +A722..A76F ; Latin # L& [78] LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF..LATIN SMALL LETTER CON +A770 ; Latin # Lm MODIFIER LETTER US +A771..A787 ; Latin # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T +A78B..A78C ; Latin # L& [2] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER SALTILLO +A7FB..A7FF ; Latin # Lo [5] LATIN EPIGRAPHIC LETTER REVERSED F..LATIN EPIGRAPHIC LETTER ARCHAIC M +FB00..FB06 ; Latin # L& [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST +FF21..FF3A ; Latin # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z +FF41..FF5A ; Latin # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z + +# Total code points: 1241 + +# ================================================ + +0370..0373 ; Greek # L& [4] GREEK CAPITAL LETTER HETA..GREEK SMALL LETTER ARCHAIC SAMPI +0375 ; Greek # Sk GREEK LOWER NUMERAL SIGN +0376..0377 ; Greek # L& [2] GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA..GREEK SMALL LETTER PAMPHYLIAN DIGAMMA +037A ; Greek # Lm GREEK YPOGEGRAMMENI +037B..037D ; Greek # L& [3] GREEK SMALL REVERSED LUNATE SIGMA SYMBOL..GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL +0384 ; Greek # Sk GREEK TONOS +0386 ; Greek # L& GREEK CAPITAL LETTER ALPHA WITH TONOS +0388..038A ; Greek # L& [3] GREEK CAPITAL LETTER EPSILON WITH TONOS..GREEK CAPITAL LETTER IOTA WITH TONOS +038C ; Greek # L& GREEK CAPITAL LETTER OMICRON WITH TONOS +038E..03A1 ; Greek # L& [20] GREEK CAPITAL LETTER UPSILON WITH TONOS..GREEK CAPITAL LETTER RHO +03A3..03E1 ; Greek # L& [63] GREEK CAPITAL LETTER SIGMA..GREEK SMALL LETTER SAMPI +03F0..03F5 ; Greek # L& [6] GREEK KAPPA SYMBOL..GREEK LUNATE EPSILON SYMBOL +03F6 ; Greek # Sm GREEK REVERSED LUNATE EPSILON SYMBOL +03F7..03FF ; Greek # L& [9] GREEK CAPITAL LETTER SHO..GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL +1D26..1D2A ; Greek # L& [5] GREEK LETTER SMALL CAPITAL GAMMA..GREEK LETTER SMALL CAPITAL PSI +1D5D..1D61 ; Greek # Lm [5] MODIFIER LETTER SMALL BETA..MODIFIER LETTER SMALL CHI +1D66..1D6A ; Greek # L& [5] GREEK SUBSCRIPT SMALL LETTER BETA..GREEK SUBSCRIPT SMALL LETTER CHI +1DBF ; Greek # Lm MODIFIER LETTER SMALL THETA +1F00..1F15 ; Greek # L& [22] GREEK SMALL LETTER ALPHA WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA +1F18..1F1D ; Greek # L& [6] GREEK CAPITAL LETTER EPSILON WITH PSILI..GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA +1F20..1F45 ; Greek # L& [38] GREEK SMALL LETTER ETA WITH PSILI..GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA +1F48..1F4D ; Greek # L& [6] GREEK CAPITAL LETTER OMICRON WITH PSILI..GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA +1F50..1F57 ; Greek # L& [8] GREEK SMALL LETTER UPSILON WITH PSILI..GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI +1F59 ; Greek # L& GREEK CAPITAL LETTER UPSILON WITH DASIA +1F5B ; Greek # L& GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA +1F5D ; Greek # L& GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA +1F5F..1F7D ; Greek # L& [31] GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI..GREEK SMALL LETTER OMEGA WITH OXIA +1F80..1FB4 ; Greek # L& [53] GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI..GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI +1FB6..1FBC ; Greek # L& [7] GREEK SMALL LETTER ALPHA WITH PERISPOMENI..GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI +1FBD ; Greek # Sk GREEK KORONIS +1FBE ; Greek # L& GREEK PROSGEGRAMMENI +1FBF..1FC1 ; Greek # Sk [3] GREEK PSILI..GREEK DIALYTIKA AND PERISPOMENI +1FC2..1FC4 ; Greek # L& [3] GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI +1FC6..1FCC ; Greek # L& [7] GREEK SMALL LETTER ETA WITH PERISPOMENI..GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI +1FCD..1FCF ; Greek # Sk [3] GREEK PSILI AND VARIA..GREEK PSILI AND PERISPOMENI +1FD0..1FD3 ; Greek # L& [4] GREEK SMALL LETTER IOTA WITH VRACHY..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA +1FD6..1FDB ; Greek # L& [6] GREEK SMALL LETTER IOTA WITH PERISPOMENI..GREEK CAPITAL LETTER IOTA WITH OXIA +1FDD..1FDF ; Greek # Sk [3] GREEK DASIA AND VARIA..GREEK DASIA AND PERISPOMENI +1FE0..1FEC ; Greek # L& [13] GREEK SMALL LETTER UPSILON WITH VRACHY..GREEK CAPITAL LETTER RHO WITH DASIA +1FED..1FEF ; Greek # Sk [3] GREEK DIALYTIKA AND VARIA..GREEK VARIA +1FF2..1FF4 ; Greek # L& [3] GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI +1FF6..1FFC ; Greek # L& [7] GREEK SMALL LETTER OMEGA WITH PERISPOMENI..GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI +1FFD..1FFE ; Greek # Sk [2] GREEK OXIA..GREEK DASIA +2126 ; Greek # L& OHM SIGN +10140..10174 ; Greek # Nl [53] GREEK ACROPHONIC ATTIC ONE QUARTER..GREEK ACROPHONIC STRATIAN FIFTY MNAS +10175..10178 ; Greek # No [4] GREEK ONE HALF SIGN..GREEK THREE QUARTERS SIGN +10179..10189 ; Greek # So [17] GREEK YEAR SIGN..GREEK TRYBLION BASE SIGN +1018A ; Greek # No GREEK ZERO SIGN +1D200..1D241 ; Greek # So [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54 +1D242..1D244 ; Greek # Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME +1D245 ; Greek # So GREEK MUSICAL LEIMMA + +# Total code points: 511 + +# ================================================ + +0400..0481 ; Cyrillic # L& [130] CYRILLIC CAPITAL LETTER IE WITH GRAVE..CYRILLIC SMALL LETTER KOPPA +0482 ; Cyrillic # So CYRILLIC THOUSANDS SIGN +0483..0487 ; Cyrillic # Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE +0488..0489 ; Cyrillic # Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN +048A..0523 ; Cyrillic # L& [154] CYRILLIC CAPITAL LETTER SHORT I WITH TAIL..CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK +1D2B ; Cyrillic # L& CYRILLIC LETTER SMALL CAPITAL EL +1D78 ; Cyrillic # Lm MODIFIER LETTER CYRILLIC EN +2DE0..2DFF ; Cyrillic # Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS +A640..A65F ; Cyrillic # L& [32] CYRILLIC CAPITAL LETTER ZEMLYA..CYRILLIC SMALL LETTER YN +A662..A66D ; Cyrillic # L& [12] CYRILLIC CAPITAL LETTER SOFT DE..CYRILLIC SMALL LETTER DOUBLE MONOCULAR O +A66E ; Cyrillic # Lo CYRILLIC LETTER MULTIOCULAR O +A66F ; Cyrillic # Mn COMBINING CYRILLIC VZMET +A670..A672 ; Cyrillic # Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN +A673 ; Cyrillic # Po SLAVONIC ASTERISK +A67C..A67D ; Cyrillic # Mn [2] COMBINING CYRILLIC KAVYKA..COMBINING CYRILLIC PAYEROK +A67E ; Cyrillic # Po CYRILLIC KAVYKA +A67F ; Cyrillic # Lm CYRILLIC PAYEROK +A680..A697 ; Cyrillic # L& [24] CYRILLIC CAPITAL LETTER DWE..CYRILLIC SMALL LETTER SHWE + +# Total code points: 404 + +# ================================================ + +0531..0556 ; Armenian # L& [38] ARMENIAN CAPITAL LETTER AYB..ARMENIAN CAPITAL LETTER FEH +0559 ; Armenian # Lm ARMENIAN MODIFIER LETTER LEFT HALF RING +055A..055F ; Armenian # Po [6] ARMENIAN APOSTROPHE..ARMENIAN ABBREVIATION MARK +0561..0587 ; Armenian # L& [39] ARMENIAN SMALL LETTER AYB..ARMENIAN SMALL LIGATURE ECH YIWN +058A ; Armenian # Pd ARMENIAN HYPHEN +FB13..FB17 ; Armenian # L& [5] ARMENIAN SMALL LIGATURE MEN NOW..ARMENIAN SMALL LIGATURE MEN XEH + +# Total code points: 90 + +# ================================================ + +0591..05BD ; Hebrew # Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG +05BE ; Hebrew # Pd HEBREW PUNCTUATION MAQAF +05BF ; Hebrew # Mn HEBREW POINT RAFE +05C0 ; Hebrew # Po HEBREW PUNCTUATION PASEQ +05C1..05C2 ; Hebrew # Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +05C3 ; Hebrew # Po HEBREW PUNCTUATION SOF PASUQ +05C4..05C5 ; Hebrew # Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT +05C6 ; Hebrew # Po HEBREW PUNCTUATION NUN HAFUKHA +05C7 ; Hebrew # Mn HEBREW POINT QAMATS QATAN +05D0..05EA ; Hebrew # Lo [27] HEBREW LETTER ALEF..HEBREW LETTER TAV +05F0..05F2 ; Hebrew # Lo [3] HEBREW LIGATURE YIDDISH DOUBLE VAV..HEBREW LIGATURE YIDDISH DOUBLE YOD +05F3..05F4 ; Hebrew # Po [2] HEBREW PUNCTUATION GERESH..HEBREW PUNCTUATION GERSHAYIM +FB1D ; Hebrew # Lo HEBREW LETTER YOD WITH HIRIQ +FB1E ; Hebrew # Mn HEBREW POINT JUDEO-SPANISH VARIKA +FB1F..FB28 ; Hebrew # Lo [10] HEBREW LIGATURE YIDDISH YOD YOD PATAH..HEBREW LETTER WIDE TAV +FB29 ; Hebrew # Sm HEBREW LETTER ALTERNATIVE PLUS SIGN +FB2A..FB36 ; Hebrew # Lo [13] HEBREW LETTER SHIN WITH SHIN DOT..HEBREW LETTER ZAYIN WITH DAGESH +FB38..FB3C ; Hebrew # Lo [5] HEBREW LETTER TET WITH DAGESH..HEBREW LETTER LAMED WITH DAGESH +FB3E ; Hebrew # Lo HEBREW LETTER MEM WITH DAGESH +FB40..FB41 ; Hebrew # Lo [2] HEBREW LETTER NUN WITH DAGESH..HEBREW LETTER SAMEKH WITH DAGESH +FB43..FB44 ; Hebrew # Lo [2] HEBREW LETTER FINAL PE WITH DAGESH..HEBREW LETTER PE WITH DAGESH +FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATURE ALEF LAMED + +# Total code points: 133 + +# ================================================ + +0606..0608 ; Arabic # Sm [3] ARABIC-INDIC CUBE ROOT..ARABIC RAY +0609..060A ; Arabic # Po [2] ARABIC-INDIC PER MILLE SIGN..ARABIC-INDIC PER TEN THOUSAND SIGN +060B ; Arabic # Sc AFGHANI SIGN +060D ; Arabic # Po ARABIC DATE SEPARATOR +060E..060F ; Arabic # So [2] ARABIC POETIC VERSE SIGN..ARABIC SIGN MISRA +0610..061A ; Arabic # Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA +061E ; Arabic # Po ARABIC TRIPLE DOT PUNCTUATION MARK +0621..063F ; Arabic # Lo [31] ARABIC LETTER HAMZA..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE +0641..064A ; Arabic # Lo [10] ARABIC LETTER FEH..ARABIC LETTER YEH +0656..065E ; Arabic # Mn [9] ARABIC SUBSCRIPT ALEF..ARABIC FATHA WITH TWO DOTS +066A..066D ; Arabic # Po [4] ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR +066E..066F ; Arabic # Lo [2] ARABIC LETTER DOTLESS BEH..ARABIC LETTER DOTLESS QAF +0671..06D3 ; Arabic # Lo [99] ARABIC LETTER ALEF WASLA..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE +06D4 ; Arabic # Po ARABIC FULL STOP +06D5 ; Arabic # Lo ARABIC LETTER AE +06D6..06DC ; Arabic # Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN +06DE ; Arabic # Me ARABIC START OF RUB EL HIZB +06DF..06E4 ; Arabic # Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA +06E5..06E6 ; Arabic # Lm [2] ARABIC SMALL WAW..ARABIC SMALL YEH +06E7..06E8 ; Arabic # Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON +06E9 ; Arabic # So ARABIC PLACE OF SAJDAH +06EA..06ED ; Arabic # Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM +06EE..06EF ; Arabic # Lo [2] ARABIC LETTER DAL WITH INVERTED V..ARABIC LETTER REH WITH INVERTED V +06F0..06F9 ; Arabic # Nd [10] EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED ARABIC-INDIC DIGIT NINE +06FA..06FC ; Arabic # Lo [3] ARABIC LETTER SHEEN WITH DOT BELOW..ARABIC LETTER GHAIN WITH DOT BELOW +06FD..06FE ; Arabic # So [2] ARABIC SIGN SINDHI AMPERSAND..ARABIC SIGN SINDHI POSTPOSITION MEN +06FF ; Arabic # Lo ARABIC LETTER HEH WITH INVERTED V +0750..077F ; Arabic # Lo [48] ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS ABOVE +FB50..FBB1 ; Arabic # Lo [98] ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM +FBD3..FD3D ; Arabic # Lo [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM +FD50..FD8F ; Arabic # Lo [64] ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM..ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM +FD92..FDC7 ; Arabic # Lo [54] ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM +FDF0..FDFB ; Arabic # Lo [12] ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM..ARABIC LIGATURE JALLAJALALOUHOU +FDFC ; Arabic # Sc RIAL SIGN +FE70..FE74 ; Arabic # Lo [5] ARABIC FATHATAN ISOLATED FORM..ARABIC KASRATAN ISOLATED FORM +FE76..FEFC ; Arabic # Lo [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF FINAL FORM + +# Total code points: 999 + +# ================================================ + +0700..070D ; Syriac # Po [14] SYRIAC END OF PARAGRAPH..SYRIAC HARKLEAN ASTERISCUS +070F ; Syriac # Cf SYRIAC ABBREVIATION MARK +0710 ; Syriac # Lo SYRIAC LETTER ALAPH +0711 ; Syriac # Mn SYRIAC LETTER SUPERSCRIPT ALAPH +0712..072F ; Syriac # Lo [30] SYRIAC LETTER BETH..SYRIAC LETTER PERSIAN DHALATH +0730..074A ; Syriac # Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH +074D..074F ; Syriac # Lo [3] SYRIAC LETTER SOGDIAN ZHAIN..SYRIAC LETTER SOGDIAN FE + +# Total code points: 77 + +# ================================================ + +0780..07A5 ; Thaana # Lo [38] THAANA LETTER HAA..THAANA LETTER WAAVU +07A6..07B0 ; Thaana # Mn [11] THAANA ABAFILI..THAANA SUKUN +07B1 ; Thaana # Lo THAANA LETTER NAA + +# Total code points: 50 + +# ================================================ + +0901..0902 ; Devanagari # Mn [2] DEVANAGARI SIGN CANDRABINDU..DEVANAGARI SIGN ANUSVARA +0903 ; Devanagari # Mc DEVANAGARI SIGN VISARGA +0904..0939 ; Devanagari # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA +093C ; Devanagari # Mn DEVANAGARI SIGN NUKTA +093D ; Devanagari # Lo DEVANAGARI SIGN AVAGRAHA +093E..0940 ; Devanagari # Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II +0941..0948 ; Devanagari # Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI +0949..094C ; Devanagari # Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU +094D ; Devanagari # Mn DEVANAGARI SIGN VIRAMA +0950 ; Devanagari # Lo DEVANAGARI OM +0953..0954 ; Devanagari # Mn [2] DEVANAGARI GRAVE ACCENT..DEVANAGARI ACUTE ACCENT +0958..0961 ; Devanagari # Lo [10] DEVANAGARI LETTER QA..DEVANAGARI LETTER VOCALIC LL +0962..0963 ; Devanagari # Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL +0966..096F ; Devanagari # Nd [10] DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE +0971 ; Devanagari # Lm DEVANAGARI SIGN HIGH SPACING DOT +0972 ; Devanagari # Lo DEVANAGARI LETTER CANDRA A +097B..097F ; Devanagari # Lo [5] DEVANAGARI LETTER GGA..DEVANAGARI LETTER BBA + +# Total code points: 107 + +# ================================================ + +0981 ; Bengali # Mn BENGALI SIGN CANDRABINDU +0982..0983 ; Bengali # Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA +0985..098C ; Bengali # Lo [8] BENGALI LETTER A..BENGALI LETTER VOCALIC L +098F..0990 ; Bengali # Lo [2] BENGALI LETTER E..BENGALI LETTER AI +0993..09A8 ; Bengali # Lo [22] BENGALI LETTER O..BENGALI LETTER NA +09AA..09B0 ; Bengali # Lo [7] BENGALI LETTER PA..BENGALI LETTER RA +09B2 ; Bengali # Lo BENGALI LETTER LA +09B6..09B9 ; Bengali # Lo [4] BENGALI LETTER SHA..BENGALI LETTER HA +09BC ; Bengali # Mn BENGALI SIGN NUKTA +09BD ; Bengali # Lo BENGALI SIGN AVAGRAHA +09BE..09C0 ; Bengali # Mc [3] BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN II +09C1..09C4 ; Bengali # Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR +09C7..09C8 ; Bengali # Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI +09CB..09CC ; Bengali # Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU +09CD ; Bengali # Mn BENGALI SIGN VIRAMA +09CE ; Bengali # Lo BENGALI LETTER KHANDA TA +09D7 ; Bengali # Mc BENGALI AU LENGTH MARK +09DC..09DD ; Bengali # Lo [2] BENGALI LETTER RRA..BENGALI LETTER RHA +09DF..09E1 ; Bengali # Lo [3] BENGALI LETTER YYA..BENGALI LETTER VOCALIC LL +09E2..09E3 ; Bengali # Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL +09E6..09EF ; Bengali # Nd [10] BENGALI DIGIT ZERO..BENGALI DIGIT NINE +09F0..09F1 ; Bengali # Lo [2] BENGALI LETTER RA WITH MIDDLE DIAGONAL..BENGALI LETTER RA WITH LOWER DIAGONAL +09F2..09F3 ; Bengali # Sc [2] BENGALI RUPEE MARK..BENGALI RUPEE SIGN +09F4..09F9 ; Bengali # No [6] BENGALI CURRENCY NUMERATOR ONE..BENGALI CURRENCY DENOMINATOR SIXTEEN +09FA ; Bengali # So BENGALI ISSHAR + +# Total code points: 91 + +# ================================================ + +0A01..0A02 ; Gurmukhi # Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI +0A03 ; Gurmukhi # Mc GURMUKHI SIGN VISARGA +0A05..0A0A ; Gurmukhi # Lo [6] GURMUKHI LETTER A..GURMUKHI LETTER UU +0A0F..0A10 ; Gurmukhi # Lo [2] GURMUKHI LETTER EE..GURMUKHI LETTER AI +0A13..0A28 ; Gurmukhi # Lo [22] GURMUKHI LETTER OO..GURMUKHI LETTER NA +0A2A..0A30 ; Gurmukhi # Lo [7] GURMUKHI LETTER PA..GURMUKHI LETTER RA +0A32..0A33 ; Gurmukhi # Lo [2] GURMUKHI LETTER LA..GURMUKHI LETTER LLA +0A35..0A36 ; Gurmukhi # Lo [2] GURMUKHI LETTER VA..GURMUKHI LETTER SHA +0A38..0A39 ; Gurmukhi # Lo [2] GURMUKHI LETTER SA..GURMUKHI LETTER HA +0A3C ; Gurmukhi # Mn GURMUKHI SIGN NUKTA +0A3E..0A40 ; Gurmukhi # Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II +0A41..0A42 ; Gurmukhi # Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU +0A47..0A48 ; Gurmukhi # Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI +0A4B..0A4D ; Gurmukhi # Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA +0A51 ; Gurmukhi # Mn GURMUKHI SIGN UDAAT +0A59..0A5C ; Gurmukhi # Lo [4] GURMUKHI LETTER KHHA..GURMUKHI LETTER RRA +0A5E ; Gurmukhi # Lo GURMUKHI LETTER FA +0A66..0A6F ; Gurmukhi # Nd [10] GURMUKHI DIGIT ZERO..GURMUKHI DIGIT NINE +0A70..0A71 ; Gurmukhi # Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK +0A72..0A74 ; Gurmukhi # Lo [3] GURMUKHI IRI..GURMUKHI EK ONKAR +0A75 ; Gurmukhi # Mn GURMUKHI SIGN YAKASH + +# Total code points: 79 + +# ================================================ + +0A81..0A82 ; Gujarati # Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA +0A83 ; Gujarati # Mc GUJARATI SIGN VISARGA +0A85..0A8D ; Gujarati # Lo [9] GUJARATI LETTER A..GUJARATI VOWEL CANDRA E +0A8F..0A91 ; Gujarati # Lo [3] GUJARATI LETTER E..GUJARATI VOWEL CANDRA O +0A93..0AA8 ; Gujarati # Lo [22] GUJARATI LETTER O..GUJARATI LETTER NA +0AAA..0AB0 ; Gujarati # Lo [7] GUJARATI LETTER PA..GUJARATI LETTER RA +0AB2..0AB3 ; Gujarati # Lo [2] GUJARATI LETTER LA..GUJARATI LETTER LLA +0AB5..0AB9 ; Gujarati # Lo [5] GUJARATI LETTER VA..GUJARATI LETTER HA +0ABC ; Gujarati # Mn GUJARATI SIGN NUKTA +0ABD ; Gujarati # Lo GUJARATI SIGN AVAGRAHA +0ABE..0AC0 ; Gujarati # Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II +0AC1..0AC5 ; Gujarati # Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E +0AC7..0AC8 ; Gujarati # Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI +0AC9 ; Gujarati # Mc GUJARATI VOWEL SIGN CANDRA O +0ACB..0ACC ; Gujarati # Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU +0ACD ; Gujarati # Mn GUJARATI SIGN VIRAMA +0AD0 ; Gujarati # Lo GUJARATI OM +0AE0..0AE1 ; Gujarati # Lo [2] GUJARATI LETTER VOCALIC RR..GUJARATI LETTER VOCALIC LL +0AE2..0AE3 ; Gujarati # Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL +0AE6..0AEF ; Gujarati # Nd [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE +0AF1 ; Gujarati # Sc GUJARATI RUPEE SIGN + +# Total code points: 83 + +# ================================================ + +0B01 ; Oriya # Mn ORIYA SIGN CANDRABINDU +0B02..0B03 ; Oriya # Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA +0B05..0B0C ; Oriya # Lo [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L +0B0F..0B10 ; Oriya # Lo [2] ORIYA LETTER E..ORIYA LETTER AI +0B13..0B28 ; Oriya # Lo [22] ORIYA LETTER O..ORIYA LETTER NA +0B2A..0B30 ; Oriya # Lo [7] ORIYA LETTER PA..ORIYA LETTER RA +0B32..0B33 ; Oriya # Lo [2] ORIYA LETTER LA..ORIYA LETTER LLA +0B35..0B39 ; Oriya # Lo [5] ORIYA LETTER VA..ORIYA LETTER HA +0B3C ; Oriya # Mn ORIYA SIGN NUKTA +0B3D ; Oriya # Lo ORIYA SIGN AVAGRAHA +0B3E ; Oriya # Mc ORIYA VOWEL SIGN AA +0B3F ; Oriya # Mn ORIYA VOWEL SIGN I +0B40 ; Oriya # Mc ORIYA VOWEL SIGN II +0B41..0B44 ; Oriya # Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR +0B47..0B48 ; Oriya # Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI +0B4B..0B4C ; Oriya # Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU +0B4D ; Oriya # Mn ORIYA SIGN VIRAMA +0B56 ; Oriya # Mn ORIYA AI LENGTH MARK +0B57 ; Oriya # Mc ORIYA AU LENGTH MARK +0B5C..0B5D ; Oriya # Lo [2] ORIYA LETTER RRA..ORIYA LETTER RHA +0B5F..0B61 ; Oriya # Lo [3] ORIYA LETTER YYA..ORIYA LETTER VOCALIC LL +0B62..0B63 ; Oriya # Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL +0B66..0B6F ; Oriya # Nd [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE +0B70 ; Oriya # So ORIYA ISSHAR +0B71 ; Oriya # Lo ORIYA LETTER WA + +# Total code points: 84 + +# ================================================ + +0B82 ; Tamil # Mn TAMIL SIGN ANUSVARA +0B83 ; Tamil # Lo TAMIL SIGN VISARGA +0B85..0B8A ; Tamil # Lo [6] TAMIL LETTER A..TAMIL LETTER UU +0B8E..0B90 ; Tamil # Lo [3] TAMIL LETTER E..TAMIL LETTER AI +0B92..0B95 ; Tamil # Lo [4] TAMIL LETTER O..TAMIL LETTER KA +0B99..0B9A ; Tamil # Lo [2] TAMIL LETTER NGA..TAMIL LETTER CA +0B9C ; Tamil # Lo TAMIL LETTER JA +0B9E..0B9F ; Tamil # Lo [2] TAMIL LETTER NYA..TAMIL LETTER TTA +0BA3..0BA4 ; Tamil # Lo [2] TAMIL LETTER NNA..TAMIL LETTER TA +0BA8..0BAA ; Tamil # Lo [3] TAMIL LETTER NA..TAMIL LETTER PA +0BAE..0BB9 ; Tamil # Lo [12] TAMIL LETTER MA..TAMIL LETTER HA +0BBE..0BBF ; Tamil # Mc [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN I +0BC0 ; Tamil # Mn TAMIL VOWEL SIGN II +0BC1..0BC2 ; Tamil # Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU +0BC6..0BC8 ; Tamil # Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI +0BCA..0BCC ; Tamil # Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU +0BCD ; Tamil # Mn TAMIL SIGN VIRAMA +0BD0 ; Tamil # Lo TAMIL OM +0BD7 ; Tamil # Mc TAMIL AU LENGTH MARK +0BE6..0BEF ; Tamil # Nd [10] TAMIL DIGIT ZERO..TAMIL DIGIT NINE +0BF0..0BF2 ; Tamil # No [3] TAMIL NUMBER TEN..TAMIL NUMBER ONE THOUSAND +0BF3..0BF8 ; Tamil # So [6] TAMIL DAY SIGN..TAMIL AS ABOVE SIGN +0BF9 ; Tamil # Sc TAMIL RUPEE SIGN +0BFA ; Tamil # So TAMIL NUMBER SIGN + +# Total code points: 72 + +# ================================================ + +0C01..0C03 ; Telugu # Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA +0C05..0C0C ; Telugu # Lo [8] TELUGU LETTER A..TELUGU LETTER VOCALIC L +0C0E..0C10 ; Telugu # Lo [3] TELUGU LETTER E..TELUGU LETTER AI +0C12..0C28 ; Telugu # Lo [23] TELUGU LETTER O..TELUGU LETTER NA +0C2A..0C33 ; Telugu # Lo [10] TELUGU LETTER PA..TELUGU LETTER LLA +0C35..0C39 ; Telugu # Lo [5] TELUGU LETTER VA..TELUGU LETTER HA +0C3D ; Telugu # Lo TELUGU SIGN AVAGRAHA +0C3E..0C40 ; Telugu # Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II +0C41..0C44 ; Telugu # Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR +0C46..0C48 ; Telugu # Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI +0C4A..0C4D ; Telugu # Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA +0C55..0C56 ; Telugu # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK +0C58..0C59 ; Telugu # Lo [2] TELUGU LETTER TSA..TELUGU LETTER DZA +0C60..0C61 ; Telugu # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL +0C62..0C63 ; Telugu # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL +0C66..0C6F ; Telugu # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE +0C78..0C7E ; Telugu # No [7] TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR..TELUGU FRACTION DIGIT THREE FOR EVEN POWERS OF FOUR +0C7F ; Telugu # So TELUGU SIGN TUUMU + +# Total code points: 93 + +# ================================================ + +0C82..0C83 ; Kannada # Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA +0C85..0C8C ; Kannada # Lo [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L +0C8E..0C90 ; Kannada # Lo [3] KANNADA LETTER E..KANNADA LETTER AI +0C92..0CA8 ; Kannada # Lo [23] KANNADA LETTER O..KANNADA LETTER NA +0CAA..0CB3 ; Kannada # Lo [10] KANNADA LETTER PA..KANNADA LETTER LLA +0CB5..0CB9 ; Kannada # Lo [5] KANNADA LETTER VA..KANNADA LETTER HA +0CBC ; Kannada # Mn KANNADA SIGN NUKTA +0CBD ; Kannada # Lo KANNADA SIGN AVAGRAHA +0CBE ; Kannada # Mc KANNADA VOWEL SIGN AA +0CBF ; Kannada # Mn KANNADA VOWEL SIGN I +0CC0..0CC4 ; Kannada # Mc [5] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN VOCALIC RR +0CC6 ; Kannada # Mn KANNADA VOWEL SIGN E +0CC7..0CC8 ; Kannada # Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI +0CCA..0CCB ; Kannada # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO +0CCC..0CCD ; Kannada # Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA +0CD5..0CD6 ; Kannada # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +0CDE ; Kannada # Lo KANNADA LETTER FA +0CE0..0CE1 ; Kannada # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL +0CE2..0CE3 ; Kannada # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL +0CE6..0CEF ; Kannada # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE + +# Total code points: 84 + +# ================================================ + +0D02..0D03 ; Malayalam # Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA +0D05..0D0C ; Malayalam # Lo [8] MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC L +0D0E..0D10 ; Malayalam # Lo [3] MALAYALAM LETTER E..MALAYALAM LETTER AI +0D12..0D28 ; Malayalam # Lo [23] MALAYALAM LETTER O..MALAYALAM LETTER NA +0D2A..0D39 ; Malayalam # Lo [16] MALAYALAM LETTER PA..MALAYALAM LETTER HA +0D3D ; Malayalam # Lo MALAYALAM SIGN AVAGRAHA +0D3E..0D40 ; Malayalam # Mc [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II +0D41..0D44 ; Malayalam # Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR +0D46..0D48 ; Malayalam # Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI +0D4A..0D4C ; Malayalam # Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU +0D4D ; Malayalam # Mn MALAYALAM SIGN VIRAMA +0D57 ; Malayalam # Mc MALAYALAM AU LENGTH MARK +0D60..0D61 ; Malayalam # Lo [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL +0D62..0D63 ; Malayalam # Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL +0D66..0D6F ; Malayalam # Nd [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE +0D70..0D75 ; Malayalam # No [6] MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE QUARTERS +0D79 ; Malayalam # So MALAYALAM DATE MARK +0D7A..0D7F ; Malayalam # Lo [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K + +# Total code points: 95 + +# ================================================ + +0D82..0D83 ; Sinhala # Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA +0D85..0D96 ; Sinhala # Lo [18] SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA +0D9A..0DB1 ; Sinhala # Lo [24] SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA +0DB3..0DBB ; Sinhala # Lo [9] SINHALA LETTER SANYAKA DAYANNA..SINHALA LETTER RAYANNA +0DBD ; Sinhala # Lo SINHALA LETTER DANTAJA LAYANNA +0DC0..0DC6 ; Sinhala # Lo [7] SINHALA LETTER VAYANNA..SINHALA LETTER FAYANNA +0DCA ; Sinhala # Mn SINHALA SIGN AL-LAKUNA +0DCF..0DD1 ; Sinhala # Mc [3] SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA +0DD2..0DD4 ; Sinhala # Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA +0DD6 ; Sinhala # Mn SINHALA VOWEL SIGN DIGA PAA-PILLA +0DD8..0DDF ; Sinhala # Mc [8] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA +0DF2..0DF3 ; Sinhala # Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA +0DF4 ; Sinhala # Po SINHALA PUNCTUATION KUNDDALIYA + +# Total code points: 80 + +# ================================================ + +0E01..0E30 ; Thai # Lo [48] THAI CHARACTER KO KAI..THAI CHARACTER SARA A +0E31 ; Thai # Mn THAI CHARACTER MAI HAN-AKAT +0E32..0E33 ; Thai # Lo [2] THAI CHARACTER SARA AA..THAI CHARACTER SARA AM +0E34..0E3A ; Thai # Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU +0E40..0E45 ; Thai # Lo [6] THAI CHARACTER SARA E..THAI CHARACTER LAKKHANGYAO +0E46 ; Thai # Lm THAI CHARACTER MAIYAMOK +0E47..0E4E ; Thai # Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN +0E4F ; Thai # Po THAI CHARACTER FONGMAN +0E50..0E59 ; Thai # Nd [10] THAI DIGIT ZERO..THAI DIGIT NINE +0E5A..0E5B ; Thai # Po [2] THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT + +# Total code points: 86 + +# ================================================ + +0E81..0E82 ; Lao # Lo [2] LAO LETTER KO..LAO LETTER KHO SUNG +0E84 ; Lao # Lo LAO LETTER KHO TAM +0E87..0E88 ; Lao # Lo [2] LAO LETTER NGO..LAO LETTER CO +0E8A ; Lao # Lo LAO LETTER SO TAM +0E8D ; Lao # Lo LAO LETTER NYO +0E94..0E97 ; Lao # Lo [4] LAO LETTER DO..LAO LETTER THO TAM +0E99..0E9F ; Lao # Lo [7] LAO LETTER NO..LAO LETTER FO SUNG +0EA1..0EA3 ; Lao # Lo [3] LAO LETTER MO..LAO LETTER LO LING +0EA5 ; Lao # Lo LAO LETTER LO LOOT +0EA7 ; Lao # Lo LAO LETTER WO +0EAA..0EAB ; Lao # Lo [2] LAO LETTER SO SUNG..LAO LETTER HO SUNG +0EAD..0EB0 ; Lao # Lo [4] LAO LETTER O..LAO VOWEL SIGN A +0EB1 ; Lao # Mn LAO VOWEL SIGN MAI KAN +0EB2..0EB3 ; Lao # Lo [2] LAO VOWEL SIGN AA..LAO VOWEL SIGN AM +0EB4..0EB9 ; Lao # Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU +0EBB..0EBC ; Lao # Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO +0EBD ; Lao # Lo LAO SEMIVOWEL SIGN NYO +0EC0..0EC4 ; Lao # Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI +0EC6 ; Lao # Lm LAO KO LA +0EC8..0ECD ; Lao # Mn [6] LAO TONE MAI EK..LAO NIGGAHITA +0ED0..0ED9 ; Lao # Nd [10] LAO DIGIT ZERO..LAO DIGIT NINE +0EDC..0EDD ; Lao # Lo [2] LAO HO NO..LAO HO MO + +# Total code points: 65 + +# ================================================ + +0F00 ; Tibetan # Lo TIBETAN SYLLABLE OM +0F01..0F03 ; Tibetan # So [3] TIBETAN MARK GTER YIG MGO TRUNCATED A..TIBETAN MARK GTER YIG MGO -UM GTER TSHEG MA +0F04..0F12 ; Tibetan # Po [15] TIBETAN MARK INITIAL YIG MGO MDUN MA..TIBETAN MARK RGYA GRAM SHAD +0F13..0F17 ; Tibetan # So [5] TIBETAN MARK CARET -DZUD RTAGS ME LONG CAN..TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS +0F18..0F19 ; Tibetan # Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS +0F1A..0F1F ; Tibetan # So [6] TIBETAN SIGN RDEL DKAR GCIG..TIBETAN SIGN RDEL DKAR RDEL NAG +0F20..0F29 ; Tibetan # Nd [10] TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE +0F2A..0F33 ; Tibetan # No [10] TIBETAN DIGIT HALF ONE..TIBETAN DIGIT HALF ZERO +0F34 ; Tibetan # So TIBETAN MARK BSDUS RTAGS +0F35 ; Tibetan # Mn TIBETAN MARK NGAS BZUNG NYI ZLA +0F36 ; Tibetan # So TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN +0F37 ; Tibetan # Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS +0F38 ; Tibetan # So TIBETAN MARK CHE MGO +0F39 ; Tibetan # Mn TIBETAN MARK TSA -PHRU +0F3A ; Tibetan # Ps TIBETAN MARK GUG RTAGS GYON +0F3B ; Tibetan # Pe TIBETAN MARK GUG RTAGS GYAS +0F3C ; Tibetan # Ps TIBETAN MARK ANG KHANG GYON +0F3D ; Tibetan # Pe TIBETAN MARK ANG KHANG GYAS +0F3E..0F3F ; Tibetan # Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES +0F40..0F47 ; Tibetan # Lo [8] TIBETAN LETTER KA..TIBETAN LETTER JA +0F49..0F6C ; Tibetan # Lo [36] TIBETAN LETTER NYA..TIBETAN LETTER RRA +0F71..0F7E ; Tibetan # Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO +0F7F ; Tibetan # Mc TIBETAN SIGN RNAM BCAD +0F80..0F84 ; Tibetan # Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA +0F85 ; Tibetan # Po TIBETAN MARK PALUTA +0F86..0F87 ; Tibetan # Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS +0F88..0F8B ; Tibetan # Lo [4] TIBETAN SIGN LCE TSA CAN..TIBETAN SIGN GRU MED RGYINGS +0F90..0F97 ; Tibetan # Mn [8] TIBETAN SUBJOINED LETTER KA..TIBETAN SUBJOINED LETTER JA +0F99..0FBC ; Tibetan # Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA +0FBE..0FC5 ; Tibetan # So [8] TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE +0FC6 ; Tibetan # Mn TIBETAN SYMBOL PADMA GDAN +0FC7..0FCC ; Tibetan # So [6] TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SYMBOL NOR BU BZHI -KHYIL +0FCE..0FCF ; Tibetan # So [2] TIBETAN SIGN RDEL NAG RDEL DKAR..TIBETAN SIGN RDEL NAG GSUM +0FD0..0FD4 ; Tibetan # Po [5] TIBETAN MARK BSKA- SHOG GI MGO RGYAN..TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA + +# Total code points: 201 + +# ================================================ + +1000..102A ; Myanmar # Lo [43] MYANMAR LETTER KA..MYANMAR LETTER AU +102B..102C ; Myanmar # Mc [2] MYANMAR VOWEL SIGN TALL AA..MYANMAR VOWEL SIGN AA +102D..1030 ; Myanmar # Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU +1031 ; Myanmar # Mc MYANMAR VOWEL SIGN E +1032..1037 ; Myanmar # Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW +1038 ; Myanmar # Mc MYANMAR SIGN VISARGA +1039..103A ; Myanmar # Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT +103B..103C ; Myanmar # Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA +103D..103E ; Myanmar # Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA +103F ; Myanmar # Lo MYANMAR LETTER GREAT SA +1040..1049 ; Myanmar # Nd [10] MYANMAR DIGIT ZERO..MYANMAR DIGIT NINE +104A..104F ; Myanmar # Po [6] MYANMAR SIGN LITTLE SECTION..MYANMAR SYMBOL GENITIVE +1050..1055 ; Myanmar # Lo [6] MYANMAR LETTER SHA..MYANMAR LETTER VOCALIC LL +1056..1057 ; Myanmar # Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR +1058..1059 ; Myanmar # Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL +105A..105D ; Myanmar # Lo [4] MYANMAR LETTER MON NGA..MYANMAR LETTER MON BBE +105E..1060 ; Myanmar # Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA +1061 ; Myanmar # Lo MYANMAR LETTER SGAW KAREN SHA +1062..1064 ; Myanmar # Mc [3] MYANMAR VOWEL SIGN SGAW KAREN EU..MYANMAR TONE MARK SGAW KAREN KE PHO +1065..1066 ; Myanmar # Lo [2] MYANMAR LETTER WESTERN PWO KAREN THA..MYANMAR LETTER WESTERN PWO KAREN PWA +1067..106D ; Myanmar # Mc [7] MYANMAR VOWEL SIGN WESTERN PWO KAREN EU..MYANMAR SIGN WESTERN PWO KAREN TONE-5 +106E..1070 ; Myanmar # Lo [3] MYANMAR LETTER EASTERN PWO KAREN NNA..MYANMAR LETTER EASTERN PWO KAREN GHWA +1071..1074 ; Myanmar # Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE +1075..1081 ; Myanmar # Lo [13] MYANMAR LETTER SHAN KA..MYANMAR LETTER SHAN HA +1082 ; Myanmar # Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA +1083..1084 ; Myanmar # Mc [2] MYANMAR VOWEL SIGN SHAN AA..MYANMAR VOWEL SIGN SHAN E +1085..1086 ; Myanmar # Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y +1087..108C ; Myanmar # Mc [6] MYANMAR SIGN SHAN TONE-2..MYANMAR SIGN SHAN COUNCIL TONE-3 +108D ; Myanmar # Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE +108E ; Myanmar # Lo MYANMAR LETTER RUMAI PALAUNG FA +108F ; Myanmar # Mc MYANMAR SIGN RUMAI PALAUNG TONE-5 +1090..1099 ; Myanmar # Nd [10] MYANMAR SHAN DIGIT ZERO..MYANMAR SHAN DIGIT NINE +109E..109F ; Myanmar # So [2] MYANMAR SYMBOL SHAN ONE..MYANMAR SYMBOL SHAN EXCLAMATION + +# Total code points: 156 + +# ================================================ + +10A0..10C5 ; Georgian # L& [38] GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE +10D0..10FA ; Georgian # Lo [43] GEORGIAN LETTER AN..GEORGIAN LETTER AIN +10FC ; Georgian # Lm MODIFIER LETTER GEORGIAN NAR +2D00..2D25 ; Georgian # L& [38] GEORGIAN SMALL LETTER AN..GEORGIAN SMALL LETTER HOE + +# Total code points: 120 + +# ================================================ + +1100..1159 ; Hangul # Lo [90] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG YEORINHIEUH +115F..11A2 ; Hangul # Lo [68] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG SSANGARAEA +11A8..11F9 ; Hangul # Lo [82] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG YEORINHIEUH +3131..318E ; Hangul # Lo [94] HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE +3200..321E ; Hangul # So [31] PARENTHESIZED HANGUL KIYEOK..PARENTHESIZED KOREAN CHARACTER O HU +3260..327E ; Hangul # So [31] CIRCLED HANGUL KIYEOK..CIRCLED HANGUL IEUNG U +AC00..D7A3 ; Hangul # Lo [11172] HANGUL SYLLABLE GA..HANGUL SYLLABLE HIH +FFA0..FFBE ; Hangul # Lo [31] HALFWIDTH HANGUL FILLER..HALFWIDTH HANGUL LETTER HIEUH +FFC2..FFC7 ; Hangul # Lo [6] HALFWIDTH HANGUL LETTER A..HALFWIDTH HANGUL LETTER E +FFCA..FFCF ; Hangul # Lo [6] HALFWIDTH HANGUL LETTER YEO..HALFWIDTH HANGUL LETTER OE +FFD2..FFD7 ; Hangul # Lo [6] HALFWIDTH HANGUL LETTER YO..HALFWIDTH HANGUL LETTER YU +FFDA..FFDC ; Hangul # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I + +# Total code points: 11620 + +# ================================================ + +1200..1248 ; Ethiopic # Lo [73] ETHIOPIC SYLLABLE HA..ETHIOPIC SYLLABLE QWA +124A..124D ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE +1250..1256 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE QHA..ETHIOPIC SYLLABLE QHO +1258 ; Ethiopic # Lo ETHIOPIC SYLLABLE QHWA +125A..125D ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE QHWI..ETHIOPIC SYLLABLE QHWE +1260..1288 ; Ethiopic # Lo [41] ETHIOPIC SYLLABLE BA..ETHIOPIC SYLLABLE XWA +128A..128D ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE XWI..ETHIOPIC SYLLABLE XWE +1290..12B0 ; Ethiopic # Lo [33] ETHIOPIC SYLLABLE NA..ETHIOPIC SYLLABLE KWA +12B2..12B5 ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE KWI..ETHIOPIC SYLLABLE KWE +12B8..12BE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE KXA..ETHIOPIC SYLLABLE KXO +12C0 ; Ethiopic # Lo ETHIOPIC SYLLABLE KXWA +12C2..12C5 ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE KXWI..ETHIOPIC SYLLABLE KXWE +12C8..12D6 ; Ethiopic # Lo [15] ETHIOPIC SYLLABLE WA..ETHIOPIC SYLLABLE PHARYNGEAL O +12D8..1310 ; Ethiopic # Lo [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE GWA +1312..1315 ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE +1318..135A ; Ethiopic # Lo [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA +135F ; Ethiopic # Mn ETHIOPIC COMBINING GEMINATION MARK +1360 ; Ethiopic # So ETHIOPIC SECTION MARK +1361..1368 ; Ethiopic # Po [8] ETHIOPIC WORDSPACE..ETHIOPIC PARAGRAPH SEPARATOR +1369..137C ; Ethiopic # No [20] ETHIOPIC DIGIT ONE..ETHIOPIC NUMBER TEN THOUSAND +1380..138F ; Ethiopic # Lo [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE +1390..1399 ; Ethiopic # So [10] ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MARK KURT +2D80..2D96 ; Ethiopic # Lo [23] ETHIOPIC SYLLABLE LOA..ETHIOPIC SYLLABLE GGWE +2DA0..2DA6 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE SSA..ETHIOPIC SYLLABLE SSO +2DA8..2DAE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE CCA..ETHIOPIC SYLLABLE CCO +2DB0..2DB6 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE ZZA..ETHIOPIC SYLLABLE ZZO +2DB8..2DBE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE CCHA..ETHIOPIC SYLLABLE CCHO +2DC0..2DC6 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE QYA..ETHIOPIC SYLLABLE QYO +2DC8..2DCE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO +2DD0..2DD6 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO +2DD8..2DDE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO + +# Total code points: 461 + +# ================================================ + +13A0..13F4 ; Cherokee # Lo [85] CHEROKEE LETTER A..CHEROKEE LETTER YV + +# Total code points: 85 + +# ================================================ + +1401..166C ; Canadian_Aboriginal # Lo [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA +166D..166E ; Canadian_Aboriginal # Po [2] CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP +166F..1676 ; Canadian_Aboriginal # Lo [8] CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS NNGAA + +# Total code points: 630 + +# ================================================ + +1680 ; Ogham # Zs OGHAM SPACE MARK +1681..169A ; Ogham # Lo [26] OGHAM LETTER BEITH..OGHAM LETTER PEITH +169B ; Ogham # Ps OGHAM FEATHER MARK +169C ; Ogham # Pe OGHAM REVERSED FEATHER MARK + +# Total code points: 29 + +# ================================================ + +16A0..16EA ; Runic # Lo [75] RUNIC LETTER FEHU FEOH FE F..RUNIC LETTER X +16EE..16F0 ; Runic # Nl [3] RUNIC ARLAUG SYMBOL..RUNIC BELGTHOR SYMBOL + +# Total code points: 78 + +# ================================================ + +1780..17B3 ; Khmer # Lo [52] KHMER LETTER KA..KHMER INDEPENDENT VOWEL QAU +17B4..17B5 ; Khmer # Cf [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA +17B6 ; Khmer # Mc KHMER VOWEL SIGN AA +17B7..17BD ; Khmer # Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA +17BE..17C5 ; Khmer # Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU +17C6 ; Khmer # Mn KHMER SIGN NIKAHIT +17C7..17C8 ; Khmer # Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU +17C9..17D3 ; Khmer # Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT +17D4..17D6 ; Khmer # Po [3] KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH +17D7 ; Khmer # Lm KHMER SIGN LEK TOO +17D8..17DA ; Khmer # Po [3] KHMER SIGN BEYYAL..KHMER SIGN KOOMUUT +17DB ; Khmer # Sc KHMER CURRENCY SYMBOL RIEL +17DC ; Khmer # Lo KHMER SIGN AVAKRAHASANYA +17DD ; Khmer # Mn KHMER SIGN ATTHACAN +17E0..17E9 ; Khmer # Nd [10] KHMER DIGIT ZERO..KHMER DIGIT NINE +17F0..17F9 ; Khmer # No [10] KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK ATTAK PRAM-BUON +19E0..19FF ; Khmer # So [32] KHMER SYMBOL PATHAMASAT..KHMER SYMBOL DAP-PRAM ROC + +# Total code points: 146 + +# ================================================ + +1800..1801 ; Mongolian # Po [2] MONGOLIAN BIRGA..MONGOLIAN ELLIPSIS +1804 ; Mongolian # Po MONGOLIAN COLON +1806 ; Mongolian # Pd MONGOLIAN TODO SOFT HYPHEN +1807..180A ; Mongolian # Po [4] MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER..MONGOLIAN NIRUGU +180B..180D ; Mongolian # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE +180E ; Mongolian # Zs MONGOLIAN VOWEL SEPARATOR +1810..1819 ; Mongolian # Nd [10] MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE +1820..1842 ; Mongolian # Lo [35] MONGOLIAN LETTER A..MONGOLIAN LETTER CHI +1843 ; Mongolian # Lm MONGOLIAN LETTER TODO LONG VOWEL SIGN +1844..1877 ; Mongolian # Lo [52] MONGOLIAN LETTER TODO E..MONGOLIAN LETTER MANCHU ZHA +1880..18A8 ; Mongolian # Lo [41] MONGOLIAN LETTER ALI GALI ANUSVARA ONE..MONGOLIAN LETTER MANCHU ALI GALI BHA +18A9 ; Mongolian # Mn MONGOLIAN LETTER ALI GALI DAGALGA +18AA ; Mongolian # Lo MONGOLIAN LETTER MANCHU ALI GALI LHA + +# Total code points: 153 + +# ================================================ + +3041..3096 ; Hiragana # Lo [86] HIRAGANA LETTER SMALL A..HIRAGANA LETTER SMALL KE +309D..309E ; Hiragana # Lm [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK +309F ; Hiragana # Lo HIRAGANA DIGRAPH YORI + +# Total code points: 89 + +# ================================================ + +30A1..30FA ; Katakana # Lo [90] KATAKANA LETTER SMALL A..KATAKANA LETTER VO +30FD..30FE ; Katakana # Lm [2] KATAKANA ITERATION MARK..KATAKANA VOICED ITERATION MARK +30FF ; Katakana # Lo KATAKANA DIGRAPH KOTO +31F0..31FF ; Katakana # Lo [16] KATAKANA LETTER SMALL KU..KATAKANA LETTER SMALL RO +32D0..32FE ; Katakana # So [47] CIRCLED KATAKANA A..CIRCLED KATAKANA WO +3300..3357 ; Katakana # So [88] SQUARE APAATO..SQUARE WATTO +FF66..FF6F ; Katakana # Lo [10] HALFWIDTH KATAKANA LETTER WO..HALFWIDTH KATAKANA LETTER SMALL TU +FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAKANA LETTER N + +# Total code points: 299 + +# ================================================ + +3105..312D ; Bopomofo # Lo [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH +31A0..31B7 ; Bopomofo # Lo [24] BOPOMOFO LETTER BU..BOPOMOFO FINAL LETTER H + +# Total code points: 65 + +# ================================================ + +2E80..2E99 ; Han # So [26] CJK RADICAL REPEAT..CJK RADICAL RAP +2E9B..2EF3 ; Han # So [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE +2F00..2FD5 ; Han # So [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE +3005 ; Han # Lm IDEOGRAPHIC ITERATION MARK +3007 ; Han # Nl IDEOGRAPHIC NUMBER ZERO +3021..3029 ; Han # Nl [9] HANGZHOU NUMERAL ONE..HANGZHOU NUMERAL NINE +3038..303A ; Han # Nl [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY +303B ; Han # Lm VERTICAL IDEOGRAPHIC ITERATION MARK +3400..4DB5 ; Han # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 +4E00..9FC3 ; Han # Lo [20932] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FC3 +F900..FA2D ; Han # Lo [302] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA2D +FA30..FA6A ; Han # Lo [59] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILITY IDEOGRAPH-FA6A +FA70..FAD9 ; Han # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9 +20000..2A6D6 ; Han # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 +2F800..2FA1D ; Han # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D + +# Total code points: 71578 + +# ================================================ + +A000..A014 ; Yi # Lo [21] YI SYLLABLE IT..YI SYLLABLE E +A015 ; Yi # Lm YI SYLLABLE WU +A016..A48C ; Yi # Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR +A490..A4C6 ; Yi # So [55] YI RADICAL QOT..YI RADICAL KE + +# Total code points: 1220 + +# ================================================ + +10300..1031E ; Old_Italic # Lo [31] OLD ITALIC LETTER A..OLD ITALIC LETTER UU +10320..10323 ; Old_Italic # No [4] OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL FIFTY + +# Total code points: 35 + +# ================================================ + +10330..10340 ; Gothic # Lo [17] GOTHIC LETTER AHSA..GOTHIC LETTER PAIRTHRA +10341 ; Gothic # Nl GOTHIC LETTER NINETY +10342..10349 ; Gothic # Lo [8] GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL +1034A ; Gothic # Nl GOTHIC LETTER NINE HUNDRED + +# Total code points: 27 + +# ================================================ + +10400..1044F ; Deseret # L& [80] DESERET CAPITAL LETTER LONG I..DESERET SMALL LETTER EW + +# Total code points: 80 + +# ================================================ + +0300..036F ; Inherited # Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X +064B..0655 ; Inherited # Mn [11] ARABIC FATHATAN..ARABIC HAMZA BELOW +0670 ; Inherited # Mn ARABIC LETTER SUPERSCRIPT ALEF +0951..0952 ; Inherited # Mn [2] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI STRESS SIGN ANUDATTA +1DC0..1DE6 ; Inherited # Mn [39] COMBINING DOTTED GRAVE ACCENT..COMBINING LATIN SMALL LETTER Z +1DFE..1DFF ; Inherited # Mn [2] COMBINING LEFT ARROWHEAD ABOVE..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW +200C..200D ; Inherited # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER +20D0..20DC ; Inherited # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE +20DD..20E0 ; Inherited # Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH +20E1 ; Inherited # Mn COMBINING LEFT RIGHT ARROW ABOVE +20E2..20E4 ; Inherited # Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE +20E5..20F0 ; Inherited # Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE +302A..302F ; Inherited # Mn [6] IDEOGRAPHIC LEVEL TONE MARK..HANGUL DOUBLE DOT TONE MARK +3099..309A ; Inherited # Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +FE00..FE0F ; Inherited # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 +FE20..FE26 ; Inherited # Mn [7] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON +101FD ; Inherited # Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE +1D167..1D169 ; Inherited # Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 +1D17B..1D182 ; Inherited # Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE +1D185..1D18B ; Inherited # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE +1D1AA..1D1AD ; Inherited # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO +E0100..E01EF ; Inherited # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + +# Total code points: 496 + +# ================================================ + +1700..170C ; Tagalog # Lo [13] TAGALOG LETTER A..TAGALOG LETTER YA +170E..1711 ; Tagalog # Lo [4] TAGALOG LETTER LA..TAGALOG LETTER HA +1712..1714 ; Tagalog # Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + +# Total code points: 20 + +# ================================================ + +1720..1731 ; Hanunoo # Lo [18] HANUNOO LETTER A..HANUNOO LETTER HA +1732..1734 ; Hanunoo # Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD + +# Total code points: 21 + +# ================================================ + +1740..1751 ; Buhid # Lo [18] BUHID LETTER A..BUHID LETTER HA +1752..1753 ; Buhid # Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + +# Total code points: 20 + +# ================================================ + +1760..176C ; Tagbanwa # Lo [13] TAGBANWA LETTER A..TAGBANWA LETTER YA +176E..1770 ; Tagbanwa # Lo [3] TAGBANWA LETTER LA..TAGBANWA LETTER SA +1772..1773 ; Tagbanwa # Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + +# Total code points: 18 + +# ================================================ + +1900..191C ; Limbu # Lo [29] LIMBU VOWEL-CARRIER LETTER..LIMBU LETTER HA +1920..1922 ; Limbu # Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U +1923..1926 ; Limbu # Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU +1927..1928 ; Limbu # Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O +1929..192B ; Limbu # Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA +1930..1931 ; Limbu # Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA +1932 ; Limbu # Mn LIMBU SMALL LETTER ANUSVARA +1933..1938 ; Limbu # Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA +1939..193B ; Limbu # Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I +1940 ; Limbu # So LIMBU SIGN LOO +1944..1945 ; Limbu # Po [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK +1946..194F ; Limbu # Nd [10] LIMBU DIGIT ZERO..LIMBU DIGIT NINE + +# Total code points: 66 + +# ================================================ + +1950..196D ; Tai_Le # Lo [30] TAI LE LETTER KA..TAI LE LETTER AI +1970..1974 ; Tai_Le # Lo [5] TAI LE LETTER TONE-2..TAI LE LETTER TONE-6 + +# Total code points: 35 + +# ================================================ + +10000..1000B ; Linear_B # Lo [12] LINEAR B SYLLABLE B008 A..LINEAR B SYLLABLE B046 JE +1000D..10026 ; Linear_B # Lo [26] LINEAR B SYLLABLE B036 JO..LINEAR B SYLLABLE B032 QO +10028..1003A ; Linear_B # Lo [19] LINEAR B SYLLABLE B060 RA..LINEAR B SYLLABLE B042 WO +1003C..1003D ; Linear_B # Lo [2] LINEAR B SYLLABLE B017 ZA..LINEAR B SYLLABLE B074 ZE +1003F..1004D ; Linear_B # Lo [15] LINEAR B SYLLABLE B020 ZO..LINEAR B SYLLABLE B091 TWO +10050..1005D ; Linear_B # Lo [14] LINEAR B SYMBOL B018..LINEAR B SYMBOL B089 +10080..100FA ; Linear_B # Lo [123] LINEAR B IDEOGRAM B100 MAN..LINEAR B IDEOGRAM VESSEL B305 + +# Total code points: 211 + +# ================================================ + +10380..1039D ; Ugaritic # Lo [30] UGARITIC LETTER ALPA..UGARITIC LETTER SSU +1039F ; Ugaritic # Po UGARITIC WORD DIVIDER + +# Total code points: 31 + +# ================================================ + +10450..1047F ; Shavian # Lo [48] SHAVIAN LETTER PEEP..SHAVIAN LETTER YEW + +# Total code points: 48 + +# ================================================ + +10480..1049D ; Osmanya # Lo [30] OSMANYA LETTER ALEF..OSMANYA LETTER OO +104A0..104A9 ; Osmanya # Nd [10] OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE + +# Total code points: 40 + +# ================================================ + +10800..10805 ; Cypriot # Lo [6] CYPRIOT SYLLABLE A..CYPRIOT SYLLABLE JA +10808 ; Cypriot # Lo CYPRIOT SYLLABLE JO +1080A..10835 ; Cypriot # Lo [44] CYPRIOT SYLLABLE KA..CYPRIOT SYLLABLE WO +10837..10838 ; Cypriot # Lo [2] CYPRIOT SYLLABLE XA..CYPRIOT SYLLABLE XE +1083C ; Cypriot # Lo CYPRIOT SYLLABLE ZA +1083F ; Cypriot # Lo CYPRIOT SYLLABLE ZO + +# Total code points: 55 + +# ================================================ + +2800..28FF ; Braille # So [256] BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678 + +# Total code points: 256 + +# ================================================ + +1A00..1A16 ; Buginese # Lo [23] BUGINESE LETTER KA..BUGINESE LETTER HA +1A17..1A18 ; Buginese # Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U +1A19..1A1B ; Buginese # Mc [3] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN AE +1A1E..1A1F ; Buginese # Po [2] BUGINESE PALLAWA..BUGINESE END OF SECTION + +# Total code points: 30 + +# ================================================ + +03E2..03EF ; Coptic # L& [14] COPTIC CAPITAL LETTER SHEI..COPTIC SMALL LETTER DEI +2C80..2CE4 ; Coptic # L& [101] COPTIC CAPITAL LETTER ALFA..COPTIC SYMBOL KAI +2CE5..2CEA ; Coptic # So [6] COPTIC SYMBOL MI RO..COPTIC SYMBOL SHIMA SIMA +2CF9..2CFC ; Coptic # Po [4] COPTIC OLD NUBIAN FULL STOP..COPTIC OLD NUBIAN VERSE DIVIDER +2CFD ; Coptic # No COPTIC FRACTION ONE HALF +2CFE..2CFF ; Coptic # Po [2] COPTIC FULL STOP..COPTIC MORPHOLOGICAL DIVIDER + +# Total code points: 128 + +# ================================================ + +1980..19A9 ; New_Tai_Lue # Lo [42] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW XVA +19B0..19C0 ; New_Tai_Lue # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY +19C1..19C7 ; New_Tai_Lue # Lo [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B +19C8..19C9 ; New_Tai_Lue # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2 +19D0..19D9 ; New_Tai_Lue # Nd [10] NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE +19DE..19DF ; New_Tai_Lue # Po [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV + +# Total code points: 80 + +# ================================================ + +2C00..2C2E ; Glagolitic # L& [47] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE +2C30..2C5E ; Glagolitic # L& [47] GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER LATINATE MYSLITE + +# Total code points: 94 + +# ================================================ + +2D30..2D65 ; Tifinagh # Lo [54] TIFINAGH LETTER YA..TIFINAGH LETTER YAZZ +2D6F ; Tifinagh # Lm TIFINAGH MODIFIER LETTER LABIALIZATION MARK + +# Total code points: 55 + +# ================================================ + +A800..A801 ; Syloti_Nagri # Lo [2] SYLOTI NAGRI LETTER A..SYLOTI NAGRI LETTER I +A802 ; Syloti_Nagri # Mn SYLOTI NAGRI SIGN DVISVARA +A803..A805 ; Syloti_Nagri # Lo [3] SYLOTI NAGRI LETTER U..SYLOTI NAGRI LETTER O +A806 ; Syloti_Nagri # Mn SYLOTI NAGRI SIGN HASANTA +A807..A80A ; Syloti_Nagri # Lo [4] SYLOTI NAGRI LETTER KO..SYLOTI NAGRI LETTER GHO +A80B ; Syloti_Nagri # Mn SYLOTI NAGRI SIGN ANUSVARA +A80C..A822 ; Syloti_Nagri # Lo [23] SYLOTI NAGRI LETTER CO..SYLOTI NAGRI LETTER HO +A823..A824 ; Syloti_Nagri # Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I +A825..A826 ; Syloti_Nagri # Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E +A827 ; Syloti_Nagri # Mc SYLOTI NAGRI VOWEL SIGN OO +A828..A82B ; Syloti_Nagri # So [4] SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POETRY MARK-4 + +# Total code points: 44 + +# ================================================ + +103A0..103C3 ; Old_Persian # Lo [36] OLD PERSIAN SIGN A..OLD PERSIAN SIGN HA +103C8..103CF ; Old_Persian # Lo [8] OLD PERSIAN SIGN AURAMAZDAA..OLD PERSIAN SIGN BUUMISH +103D0 ; Old_Persian # Po OLD PERSIAN WORD DIVIDER +103D1..103D5 ; Old_Persian # Nl [5] OLD PERSIAN NUMBER ONE..OLD PERSIAN NUMBER HUNDRED + +# Total code points: 50 + +# ================================================ + +10A00 ; Kharoshthi # Lo KHAROSHTHI LETTER A +10A01..10A03 ; Kharoshthi # Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R +10A05..10A06 ; Kharoshthi # Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O +10A0C..10A0F ; Kharoshthi # Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA +10A10..10A13 ; Kharoshthi # Lo [4] KHAROSHTHI LETTER KA..KHAROSHTHI LETTER GHA +10A15..10A17 ; Kharoshthi # Lo [3] KHAROSHTHI LETTER CA..KHAROSHTHI LETTER JA +10A19..10A33 ; Kharoshthi # Lo [27] KHAROSHTHI LETTER NYA..KHAROSHTHI LETTER TTTHA +10A38..10A3A ; Kharoshthi # Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW +10A3F ; Kharoshthi # Mn KHAROSHTHI VIRAMA +10A40..10A47 ; Kharoshthi # No [8] KHAROSHTHI DIGIT ONE..KHAROSHTHI NUMBER ONE THOUSAND +10A50..10A58 ; Kharoshthi # Po [9] KHAROSHTHI PUNCTUATION DOT..KHAROSHTHI PUNCTUATION LINES + +# Total code points: 65 + +# ================================================ + +1B00..1B03 ; Balinese # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG +1B04 ; Balinese # Mc BALINESE SIGN BISAH +1B05..1B33 ; Balinese # Lo [47] BALINESE LETTER AKARA..BALINESE LETTER HA +1B34 ; Balinese # Mn BALINESE SIGN REREKAN +1B35 ; Balinese # Mc BALINESE VOWEL SIGN TEDUNG +1B36..1B3A ; Balinese # Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA +1B3B ; Balinese # Mc BALINESE VOWEL SIGN RA REPA TEDUNG +1B3C ; Balinese # Mn BALINESE VOWEL SIGN LA LENGA +1B3D..1B41 ; Balinese # Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG +1B42 ; Balinese # Mn BALINESE VOWEL SIGN PEPET +1B43..1B44 ; Balinese # Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG +1B45..1B4B ; Balinese # Lo [7] BALINESE LETTER KAF SASAK..BALINESE LETTER ASYURA SASAK +1B50..1B59 ; Balinese # Nd [10] BALINESE DIGIT ZERO..BALINESE DIGIT NINE +1B5A..1B60 ; Balinese # Po [7] BALINESE PANTI..BALINESE PAMENENG +1B61..1B6A ; Balinese # So [10] BALINESE MUSICAL SYMBOL DONG..BALINESE MUSICAL SYMBOL DANG GEDE +1B6B..1B73 ; Balinese # Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG +1B74..1B7C ; Balinese # So [9] BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG..BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING + +# Total code points: 121 + +# ================================================ + +12000..1236E ; Cuneiform # Lo [879] CUNEIFORM SIGN A..CUNEIFORM SIGN ZUM +12400..12462 ; Cuneiform # Nl [99] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE QUARTER +12470..12473 ; Cuneiform # Po [4] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON + +# Total code points: 982 + +# ================================================ + +10900..10915 ; Phoenician # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU +10916..10919 ; Phoenician # No [4] PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER ONE HUNDRED +1091F ; Phoenician # Po PHOENICIAN WORD SEPARATOR + +# Total code points: 27 + +# ================================================ + +A840..A873 ; Phags_Pa # Lo [52] PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABINDU +A874..A877 ; Phags_Pa # Po [4] PHAGS-PA SINGLE HEAD MARK..PHAGS-PA MARK DOUBLE SHAD + +# Total code points: 56 + +# ================================================ + +07C0..07C9 ; Nko # Nd [10] NKO DIGIT ZERO..NKO DIGIT NINE +07CA..07EA ; Nko # Lo [33] NKO LETTER A..NKO LETTER JONA RA +07EB..07F3 ; Nko # Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE +07F4..07F5 ; Nko # Lm [2] NKO HIGH TONE APOSTROPHE..NKO LOW TONE APOSTROPHE +07F6 ; Nko # So NKO SYMBOL OO DENNEN +07F7..07F9 ; Nko # Po [3] NKO SYMBOL GBAKURUNEN..NKO EXCLAMATION MARK +07FA ; Nko # Lm NKO LAJANYALAN + +# Total code points: 59 + +# ================================================ + +1B80..1B81 ; Sundanese # Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR +1B82 ; Sundanese # Mc SUNDANESE SIGN PANGWISAD +1B83..1BA0 ; Sundanese # Lo [30] SUNDANESE LETTER A..SUNDANESE LETTER HA +1BA1 ; Sundanese # Mc SUNDANESE CONSONANT SIGN PAMINGKAL +1BA2..1BA5 ; Sundanese # Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU +1BA6..1BA7 ; Sundanese # Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG +1BA8..1BA9 ; Sundanese # Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG +1BAA ; Sundanese # Mc SUNDANESE SIGN PAMAAEH +1BAE..1BAF ; Sundanese # Lo [2] SUNDANESE LETTER KHA..SUNDANESE LETTER SYA +1BB0..1BB9 ; Sundanese # Nd [10] SUNDANESE DIGIT ZERO..SUNDANESE DIGIT NINE + +# Total code points: 55 + +# ================================================ + +1C00..1C23 ; Lepcha # Lo [36] LEPCHA LETTER KA..LEPCHA LETTER A +1C24..1C2B ; Lepcha # Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU +1C2C..1C33 ; Lepcha # Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T +1C34..1C35 ; Lepcha # Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG +1C36..1C37 ; Lepcha # Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA +1C3B..1C3F ; Lepcha # Po [5] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK +1C40..1C49 ; Lepcha # Nd [10] LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE +1C4D..1C4F ; Lepcha # Lo [3] LEPCHA LETTER TTA..LEPCHA LETTER DDA + +# Total code points: 74 + +# ================================================ + +1C50..1C59 ; Ol_Chiki # Nd [10] OL CHIKI DIGIT ZERO..OL CHIKI DIGIT NINE +1C5A..1C77 ; Ol_Chiki # Lo [30] OL CHIKI LETTER LA..OL CHIKI LETTER OH +1C78..1C7D ; Ol_Chiki # Lm [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD +1C7E..1C7F ; Ol_Chiki # Po [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD + +# Total code points: 48 + +# ================================================ + +A500..A60B ; Vai # Lo [268] VAI SYLLABLE EE..VAI SYLLABLE NG +A60C ; Vai # Lm VAI SYLLABLE LENGTHENER +A60D..A60F ; Vai # Po [3] VAI COMMA..VAI QUESTION MARK +A610..A61F ; Vai # Lo [16] VAI SYLLABLE NDOLE FA..VAI SYMBOL JONG +A620..A629 ; Vai # Nd [10] VAI DIGIT ZERO..VAI DIGIT NINE +A62A..A62B ; Vai # Lo [2] VAI SYLLABLE NDOLE MA..VAI SYLLABLE NDOLE DO + +# Total code points: 300 + +# ================================================ + +A880..A881 ; Saurashtra # Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA +A882..A8B3 ; Saurashtra # Lo [50] SAURASHTRA LETTER A..SAURASHTRA LETTER LLA +A8B4..A8C3 ; Saurashtra # Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU +A8C4 ; Saurashtra # Mn SAURASHTRA SIGN VIRAMA +A8CE..A8CF ; Saurashtra # Po [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA +A8D0..A8D9 ; Saurashtra # Nd [10] SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE + +# Total code points: 81 + +# ================================================ + +A900..A909 ; Kayah_Li # Nd [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGIT NINE +A90A..A925 ; Kayah_Li # Lo [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO +A926..A92D ; Kayah_Li # Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU +A92E..A92F ; Kayah_Li # Po [2] KAYAH LI SIGN CWI..KAYAH LI SIGN SHYA + +# Total code points: 48 + +# ================================================ + +A930..A946 ; Rejang # Lo [23] REJANG LETTER KA..REJANG LETTER A +A947..A951 ; Rejang # Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R +A952..A953 ; Rejang # Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA +A95F ; Rejang # Po REJANG SECTION MARK + +# Total code points: 37 + +# ================================================ + +10280..1029C ; Lycian # Lo [29] LYCIAN LETTER A..LYCIAN LETTER X + +# Total code points: 29 + +# ================================================ + +102A0..102D0 ; Carian # Lo [49] CARIAN LETTER A..CARIAN LETTER UUU3 + +# Total code points: 49 + +# ================================================ + +10920..10939 ; Lydian # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C +1093F ; Lydian # Po LYDIAN TRIANGULAR MARK + +# Total code points: 27 + +# ================================================ + +AA00..AA28 ; Cham # Lo [41] CHAM LETTER A..CHAM LETTER HA +AA29..AA2E ; Cham # Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE +AA2F..AA30 ; Cham # Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI +AA31..AA32 ; Cham # Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE +AA33..AA34 ; Cham # Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA +AA35..AA36 ; Cham # Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA +AA40..AA42 ; Cham # Lo [3] CHAM LETTER FINAL K..CHAM LETTER FINAL NG +AA43 ; Cham # Mn CHAM CONSONANT SIGN FINAL NG +AA44..AA4B ; Cham # Lo [8] CHAM LETTER FINAL CH..CHAM LETTER FINAL SS +AA4C ; Cham # Mn CHAM CONSONANT SIGN FINAL M +AA4D ; Cham # Mc CHAM CONSONANT SIGN FINAL H +AA50..AA59 ; Cham # Nd [10] CHAM DIGIT ZERO..CHAM DIGIT NINE +AA5C..AA5F ; Cham # Po [4] CHAM PUNCTUATION SPIRAL..CHAM PUNCTUATION TRIPLE DANDA + +# Total code points: 83 + +# EOF diff --git a/extra/unicode/script/authors.txt b/extra/unicode/script/authors.txt new file mode 100755 index 0000000000..504363d316 --- /dev/null +++ b/extra/unicode/script/authors.txt @@ -0,0 +1 @@ +Daniel Ehrenberg diff --git a/extra/unicode/script/script-docs.factor b/extra/unicode/script/script-docs.factor new file mode 100755 index 0000000000..05828b778f --- /dev/null +++ b/extra/unicode/script/script-docs.factor @@ -0,0 +1,8 @@ +USING: help.syntax help.markup ; +IN: unicode.script + +HELP: script-of +{ $values { "char" "a code point" } { "script" "a symbol" } } +{ $description "Gets a symbol representing the code point of a given character. The word name of the symbol is the same as the one " } ; + +ABOUT: script-of diff --git a/extra/unicode/script/script-tests.factor b/extra/unicode/script/script-tests.factor new file mode 100755 index 0000000000..905837123b --- /dev/null +++ b/extra/unicode/script/script-tests.factor @@ -0,0 +1,4 @@ +USING: unicode.script tools.test ; + +[ Latin ] [ CHAR: a script-of ] unit-test +[ Common ] [ 0 script-of ] unit-test diff --git a/extra/unicode/script/script.factor b/extra/unicode/script/script.factor new file mode 100755 index 0000000000..14fba46c4d --- /dev/null +++ b/extra/unicode/script/script.factor @@ -0,0 +1,56 @@ +USING: unicode.syntax.backend kernel sequences assocs io.files +io.encodings ascii math.ranges io splitting math.parser +namespaces byte-arrays locals math sets io.encodings.ascii +words compiler.units ; +IN: unicode.script + +num-table +VALUE: num>name-table + +: parse-script ( stream -- assoc ) + ! assoc is code point/range => name + lines [ "#" split1 drop ] map [ empty? not ] filter [ + ";" split1 [ [ blank? ] trim ] bi@ + ] H{ } map>assoc ; + +: set-if ( value var -- ) + dup 500000 < [ set ] [ 2drop ] if ; + +: expand-ranges ( assoc -- char-assoc ) + ! char-assoc is code point => name + [ [ + CHAR: . pick member? [ + swap ".." split1 [ hex> ] bi@ [a,b] + [ set-if ] with each + ] [ swap hex> set-if ] if + ] assoc-each ] H{ } make-assoc ; + +: hash>byte-array ( hash -- byte-array ) + [ keys supremum 1+ dup ] keep + [ -rot set-nth ] with assoc-each ; + +: make-char>num ( assoc -- char>num-table ) + expand-ranges + [ num>name-table index ] assoc-map + hash>byte-array ; + +: >symbols ( strings -- symbols ) + [ + [ "unicode.script" create dup define-symbol ] map + ] with-compilation-unit ; + +: process-script ( ranges -- ) + [ values prune \ num>name-table set-value ] + [ make-char>num \ char>num-table set-value ] bi + num>name-table >symbols \ num>name-table set-value ; + +: load-script ( -- ) + "resource:extra/unicode/script/Scripts.txt" + ascii parse-script process-script ; + +load-script +PRIVATE> + +: script-of ( char -- script ) + char>num-table nth num>name-table nth ; diff --git a/extra/unicode/script/summary.txt b/extra/unicode/script/summary.txt new file mode 100755 index 0000000000..a2de844e30 --- /dev/null +++ b/extra/unicode/script/summary.txt @@ -0,0 +1 @@ +Reads the UCD to get the script of a code point diff --git a/extra/unix/bsd/bsd.factor b/extra/unix/bsd/bsd.factor index d80db44348..158dbeaddb 100755 --- a/extra/unix/bsd/bsd.factor +++ b/extra/unix/bsd/bsd.factor @@ -21,7 +21,9 @@ IN: unix : SO_SNDTIMEO HEX: 1005 ; inline : SO_RCVTIMEO HEX: 1006 ; inline +: F_SETFD 2 ; inline : F_SETFL 4 ; inline +: FD_CLOEXEC 1 ; inline : O_NONBLOCK 4 ; inline C-STRUCT: sockaddr-in diff --git a/extra/xml/xml-docs.factor b/extra/xml/xml-docs.factor index dd77d7c766..6a2ff1109e 100644 --- a/extra/xml/xml-docs.factor +++ b/extra/xml/xml-docs.factor @@ -42,17 +42,17 @@ HELP: xml-reprint HELP: write-xml { $values { "xml" "an XML document" } } -{ $description "prints the contents of an XML document (" { $link xml } ") to stdio" } +{ $description "prints the contents of an XML document (" { $link xml } ") to " { $link output-stream } "." } { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ; HELP: print-xml { $values { "xml" "an XML document" } } -{ $description "prints the contents of an XML document (" { $link xml } ") to stdio, followed by a newline" } +{ $description "prints the contents of an XML document (" { $link xml } ") to " { $link output-stream } ", followed by a newline" } { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ; HELP: pprint-xml { $values { "xml" "an XML document" } } -{ $description "prints the contents of an XML document (" { $link xml } ") to stdio in a prettyprinted form." } +{ $description "prints the contents of an XML document (" { $link xml } ") to " { $link output-stream } " in a prettyprinted form." } { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ; HELP: pprint-xml-but @@ -226,7 +226,7 @@ HELP: pull-xml HELP: { $values { "pull-xml" "a pull-xml tuple" } } -{ $description "creates an XML pull-based parser which reads from the " { $link stdio } " stream, executing all initial XML commands to set up the parser." } +{ $description "creates an XML pull-based parser which reads from " { $link input-stream } ", executing all initial XML commands to set up the parser." } { $see-also pull-xml pull-elem pull-event } ; HELP: pull-elem @@ -241,12 +241,12 @@ HELP: pull-event HELP: write-item { $values { "object" "an XML element" } } -{ $description "writes an XML element to the " { $link stdio } " stream." } +{ $description "writes an XML element to " { $link output-stream } "." } { $see-also write-chunk write-xml } ; HELP: write-chunk { $values { "seq" "an XML document fragment" } } -{ $description "writes an XML document fragment, ie a sequence of XML elements, to the " { $link stdio } " stream." } +{ $description "writes an XML document fragment, ie a sequence of XML elements, to " { $link output-stream } "." } { $see-also write-item write-xml } ; HELP: deep-tag-named diff --git a/extra/xml/xml.factor b/extra/xml/xml.factor index 2d7c8c8ff8..4cac3051c3 100644 --- a/extra/xml/xml.factor +++ b/extra/xml/xml.factor @@ -104,7 +104,7 @@ SYMBOL: text-now? TUPLE: pull-xml scope ; : ( -- pull-xml ) [ - stdio [ ] change ! bring stdio var in this scope + input-stream [ ] change ! bring var in this scope init-parser reset-prolog init-ns-stack text-now? on ] H{ } make-assoc diff --git a/extra/xmode/code2html/code2html.factor b/extra/xmode/code2html/code2html.factor index a13e412afe..f6df23b9b2 100755 --- a/extra/xmode/code2html/code2html.factor +++ b/extra/xmode/code2html/code2html.factor @@ -42,8 +42,7 @@ IN: xmode.code2html : htmlize-file ( path -- ) dup utf8 [ - stdio get - over ".html" append utf8 [ - htmlize-stream + dup ".html" append utf8 [ + input-stream get htmlize-stream ] with-file-writer ] with-file-reader ;