Move io.styles to basis
							parent
							
								
									59ab854480
								
							
						
					
					
						commit
						f5c15481fe
					
				| 
						 | 
				
			
			@ -50,7 +50,7 @@ SYMBOL: bootstrap-time
 | 
			
		|||
 | 
			
		||||
    default-image-name "output-image" set-global
 | 
			
		||||
 | 
			
		||||
    "math compiler help io random tools ui ui.tools unicode handbook" "include" set-global
 | 
			
		||||
    "threads math compiler help io random tools ui ui.tools unicode handbook" "include" set-global
 | 
			
		||||
    "" "exclude" set-global
 | 
			
		||||
 | 
			
		||||
    parse-command-line
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
! Copyright (C) 2008 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
IN: bootstrap.threads
 | 
			
		||||
 | 
			
		||||
USE: io.thread
 | 
			
		||||
USE: threads
 | 
			
		||||
| 
						 | 
				
			
			@ -24,8 +24,14 @@ ARTICLE: "table-styles" "Table styles"
 | 
			
		|||
{ $subsection table-gap }
 | 
			
		||||
{ $subsection table-border } ;
 | 
			
		||||
 | 
			
		||||
HELP: write-object
 | 
			
		||||
{ $values { "str" string } { "obj" "an object" } }
 | 
			
		||||
{ $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 ;
 | 
			
		||||
 | 
			
		||||
ARTICLE: "presentations" "Presentations"
 | 
			
		||||
"The " { $link presented } " style can be used to emit clickable objects. The " { $link write-object } " word should be used instead of setting this directly." ;
 | 
			
		||||
"The " { $link presented } " style can be used to emit clickable objects. A utility word for outputting this style:"
 | 
			
		||||
{ $subsection write-object } ;
 | 
			
		||||
 | 
			
		||||
ARTICLE: "styles" "Formatted output"
 | 
			
		||||
"The " { $link stream-format } ", " { $link with-style } ", " { $link with-nesting } " and " { $link tabular-output } " words take a hashtable of style attributes. Output stream implementations are free to ignore style information."
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
! Copyright (C) 2005, 2006 Slava Pestov.
 | 
			
		||||
! Copyright (C) 2005, 2008 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: hashtables io ;
 | 
			
		||||
IN: io.styles
 | 
			
		||||
 | 
			
		||||
SYMBOL: plain
 | 
			
		||||
| 
						 | 
				
			
			@ -39,3 +40,5 @@ SYMBOL: table-border
 | 
			
		|||
TUPLE: input string ;
 | 
			
		||||
 | 
			
		||||
C: <input> input
 | 
			
		||||
 | 
			
		||||
: write-object ( str obj -- ) presented associate format ;
 | 
			
		||||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: math kernel sequences sbufs vectors namespaces growable
 | 
			
		||||
strings io classes continuations destructors combinators
 | 
			
		||||
io.styles io.streams.plain splitting byte-arrays
 | 
			
		||||
io.streams.plain splitting byte-arrays
 | 
			
		||||
sequences.private accessors ;
 | 
			
		||||
IN: io.encodings
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
USING: help.markup help.syntax io io.styles strings
 | 
			
		||||
USING: help.markup help.syntax io strings
 | 
			
		||||
       io.backend io.files.private quotations ;
 | 
			
		||||
IN: io.files
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -170,16 +170,16 @@ HELP: +symbolic-link+
 | 
			
		|||
{ $description "A symbolic link file.  This type is currently implemented on Unix platforms only. See " { $link "symbolic-links" } " for words operating on symbolic links." } ;
 | 
			
		||||
 | 
			
		||||
HELP: +character-device+
 | 
			
		||||
{ $description "A Unix character device file. This type exists on unix platforms only." } ;
 | 
			
		||||
{ $description "A Unix character device file. This type exists on Unix platforms only." } ;
 | 
			
		||||
 | 
			
		||||
HELP: +block-device+
 | 
			
		||||
{ $description "A Unix block device file. This type exists on unix platforms only." } ;
 | 
			
		||||
{ $description "A Unix block device file. This type exists on Unix platforms only." } ;
 | 
			
		||||
 | 
			
		||||
HELP: +fifo+
 | 
			
		||||
{ $description "A Unix fifo file. This type exists on unix platforms only." } ;
 | 
			
		||||
{ $description "A Unix fifo file. This type exists on Unix platforms only." } ;
 | 
			
		||||
 | 
			
		||||
HELP: +socket+
 | 
			
		||||
{ $description "A Unix socket file. This type exists on unix platforms only." } ;
 | 
			
		||||
{ $description "A Unix socket file. This type exists on Unix platforms only." } ;
 | 
			
		||||
 | 
			
		||||
HELP: +unknown+
 | 
			
		||||
{ $description "A unknown file type." } ;
 | 
			
		||||
| 
						 | 
				
			
			@ -327,7 +327,7 @@ HELP: resource-path
 | 
			
		|||
{ $description "Resolve a path relative to the Factor source code location." } ;
 | 
			
		||||
 | 
			
		||||
HELP: pathname
 | 
			
		||||
{ $class-description "Class of pathname presentations. Path name presentations can be created by calling " { $link <pathname> } ". Instances can be passed to " { $link write-object } " to output a clickable pathname." } ;
 | 
			
		||||
{ $class-description "Class of path name objects. Path name objects can be created by calling " { $link <pathname> } "." } ;
 | 
			
		||||
 | 
			
		||||
HELP: normalize-directory
 | 
			
		||||
{ $values { "str" "a pathname string" } { "newstr" "a new pathname string" } }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -87,7 +87,6 @@ $nl
 | 
			
		|||
{ $subsection bl }
 | 
			
		||||
"Formatted output:"
 | 
			
		||||
{ $subsection format }
 | 
			
		||||
{ $subsection write-object }
 | 
			
		||||
{ $subsection with-style }
 | 
			
		||||
{ $subsection with-nesting }
 | 
			
		||||
"Tabular output:"
 | 
			
		||||
| 
						 | 
				
			
			@ -356,11 +355,6 @@ HELP: bl
 | 
			
		|||
{ $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 " { $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
 | 
			
		||||
{ $values { "stream" "an input stream" } { "seq" "a sequence of strings" } }
 | 
			
		||||
{ $description "Reads lines of text until the stream is exhausted, collecting them in a sequence of strings." } ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
! Copyright (C) 2003, 2007 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: hashtables generic kernel math namespaces sequences
 | 
			
		||||
continuations destructors assocs io.styles ;
 | 
			
		||||
continuations destructors assocs ;
 | 
			
		||||
IN: io
 | 
			
		||||
 | 
			
		||||
GENERIC: stream-readln ( stream -- str/f )
 | 
			
		||||
| 
						 | 
				
			
			@ -96,9 +96,6 @@ SYMBOL: error-stream
 | 
			
		|||
 | 
			
		||||
: bl ( -- ) " " write ;
 | 
			
		||||
 | 
			
		||||
: write-object ( str obj -- )
 | 
			
		||||
    presented associate format ;
 | 
			
		||||
 | 
			
		||||
: lines ( stream -- seq )
 | 
			
		||||
    [ [ readln dup ] [ ] [ drop ] produce ] with-input-stream ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
! Copyright (C) 2005, 2008 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: arrays definitions generic assocs kernel math namespaces
 | 
			
		||||
sequences strings vectors words quotations io.styles io
 | 
			
		||||
sequences strings vectors words quotations io
 | 
			
		||||
combinators sorting splitting math.parser effects continuations
 | 
			
		||||
io.files io.streams.string vocabs io.encodings.utf8 source-files
 | 
			
		||||
classes hashtables compiler.errors compiler.units accessors sets
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
! Copyright (C) 2007, 2008 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: arrays definitions generic assocs kernel math namespaces
 | 
			
		||||
sequences strings vectors words quotations io.styles io
 | 
			
		||||
sequences strings vectors words quotations io
 | 
			
		||||
combinators sorting splitting math.parser effects continuations
 | 
			
		||||
io.files checksums checksums.crc32 vocabs hashtables graphs
 | 
			
		||||
compiler.units io.encodings.utf8 accessors ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
! Copyright (C) 2007, 2008 Eduardo Cavazos, Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: namespaces sequences io.files kernel assocs words vocabs
 | 
			
		||||
definitions parser continuations io io.styles hashtables sorting
 | 
			
		||||
definitions parser continuations io hashtables sorting
 | 
			
		||||
source-files arrays combinators strings system math.parser
 | 
			
		||||
compiler.errors splitting init ;
 | 
			
		||||
IN: vocabs.loader
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue