Remove hilight style
parent
5771e256b3
commit
2e8df17b20
|
@ -1,23 +1,3 @@
|
||||||
USING: io io.streams.string io.streams.nested kernel math
|
USING: io io.streams.string io.streams.nested kernel math
|
||||||
namespaces io.styles tools.test ;
|
namespaces io.styles tools.test ;
|
||||||
IN: temporary
|
IN: temporary
|
||||||
|
|
||||||
[ "=>a<=" ] [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
H{ { highlight t } } [
|
|
||||||
H{ } [ "a" write ] with-nesting
|
|
||||||
] with-style
|
|
||||||
] string-out
|
|
||||||
] with-scope
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
[ "a" ] [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
H{ } [
|
|
||||||
H{ { highlight t } } [ "a" write ] with-nesting
|
|
||||||
] with-style
|
|
||||||
] string-out
|
|
||||||
] with-scope
|
|
||||||
] unit-test
|
|
||||||
|
|
|
@ -9,12 +9,11 @@ TUPLE: plain-writer ;
|
||||||
: <plain-writer> ( stream -- new-stream )
|
: <plain-writer> ( stream -- new-stream )
|
||||||
plain-writer construct-delegate ;
|
plain-writer construct-delegate ;
|
||||||
|
|
||||||
M: plain-writer stream-nl CHAR: \n swap stream-write1 ;
|
M: plain-writer stream-nl
|
||||||
|
CHAR: \n swap stream-write1 ;
|
||||||
|
|
||||||
M: plain-writer stream-format
|
M: plain-writer stream-format
|
||||||
highlight rot at
|
nip stream-write ;
|
||||||
[ >r "=>" swap "<=" 3append r> ] when
|
|
||||||
stream-write ;
|
|
||||||
|
|
||||||
M: plain-writer make-span-stream
|
M: plain-writer make-span-stream
|
||||||
<style-stream> <ignore-close-stream> ;
|
<style-stream> <ignore-close-stream> ;
|
||||||
|
|
|
@ -106,10 +106,6 @@ HELP: presented-path
|
||||||
HELP: presented-printer
|
HELP: presented-printer
|
||||||
{ $description "Character and paragraph style. A quotation with stack effect " { $snippet "( obj -- )" } " which is applied to the value at the " { $link presented-path } " if the presentation needs to be re-displayed after the object has been edited." } ;
|
{ $description "Character and paragraph style. A quotation with stack effect " { $snippet "( obj -- )" } " which is applied to the value at the " { $link presented-path } " if the presentation needs to be re-displayed after the object has been edited." } ;
|
||||||
|
|
||||||
HELP: highlight
|
|
||||||
{ $description "Character style. Used to mark up text on streams that otherwise do not support different colors or font styles." }
|
|
||||||
{ $examples "Instances of " { $link plain-writer } " uppercases highlighted text." } ;
|
|
||||||
|
|
||||||
HELP: page-color
|
HELP: page-color
|
||||||
{ $description "Paragraph style. Background color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
|
{ $description "Paragraph style. Background color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
|
||||||
{ $examples
|
{ $examples
|
||||||
|
|
|
@ -19,9 +19,6 @@ SYMBOL: presented
|
||||||
SYMBOL: presented-path
|
SYMBOL: presented-path
|
||||||
SYMBOL: presented-printer
|
SYMBOL: presented-printer
|
||||||
|
|
||||||
! Only for plain-stream
|
|
||||||
SYMBOL: highlight
|
|
||||||
|
|
||||||
! Paragraph styles
|
! Paragraph styles
|
||||||
SYMBOL: page-color
|
SYMBOL: page-color
|
||||||
SYMBOL: border-color
|
SYMBOL: border-color
|
||||||
|
|
|
@ -27,9 +27,3 @@ HELP: line-limit
|
||||||
|
|
||||||
HELP: string-limit
|
HELP: string-limit
|
||||||
{ $var-description "Toggles whether printed strings are truncated to the margin." } ;
|
{ $var-description "Toggles whether printed strings are truncated to the margin." } ;
|
||||||
|
|
||||||
HELP: hilite-quotation
|
|
||||||
{ $var-description "If set, printing this quotation will highlight the element with index " { $link hilite-index } " in an output stream-specific manner." } ;
|
|
||||||
|
|
||||||
HELP: hilite-index
|
|
||||||
{ $var-description "If set, printing the quotation stored in " { $link hilite-quotation } " will highlight the element with this index in an output stream-specific manner." } ;
|
|
||||||
|
|
|
@ -13,10 +13,6 @@ SYMBOL: length-limit
|
||||||
SYMBOL: line-limit
|
SYMBOL: line-limit
|
||||||
SYMBOL: string-limit
|
SYMBOL: string-limit
|
||||||
|
|
||||||
! Special trick to highlight a word in a quotation
|
|
||||||
SYMBOL: hilite-quotation
|
|
||||||
SYMBOL: hilite-index
|
|
||||||
|
|
||||||
global [
|
global [
|
||||||
4 tab-size set
|
4 tab-size set
|
||||||
64 margin set
|
64 margin set
|
||||||
|
|
|
@ -204,7 +204,7 @@ HELP: stack.
|
||||||
|
|
||||||
HELP: callstack.
|
HELP: callstack.
|
||||||
{ $values { "callstack" callstack } }
|
{ $values { "callstack" callstack } }
|
||||||
{ $description "Displays a sequence output by " { $link callstack } " in a nice way, by highlighting the current execution point in every call frame." } ;
|
{ $description "Displays a sequence output by " { $link callstack } " in a nice way, by highlighting the current execution point in every call frame with " { $link -> } "." } ;
|
||||||
|
|
||||||
HELP: .c
|
HELP: .c
|
||||||
{ $description "Displays the contents of the call stack, with the top of the stack printed first." } ;
|
{ $description "Displays the contents of the call stack, with the top of the stack printed first." } ;
|
||||||
|
|
|
@ -53,12 +53,6 @@ unit-test
|
||||||
|
|
||||||
[ "W{ \\ + }" ] [ [ W{ \ + } ] first unparse ] unit-test
|
[ "W{ \\ + }" ] [ [ W{ \ + } ] first unparse ] unit-test
|
||||||
|
|
||||||
[ "[ 1 2 =>dup<= ]" ]
|
|
||||||
[
|
|
||||||
[ 1 2 dup ] dup hilite-quotation set 2 hilite-index set
|
|
||||||
[ pprint ] string-out
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
[ t ] [
|
[ t ] [
|
||||||
"[ >r \"alloc\" add 0 0 r> ]" dup parse first unparse =
|
"[ >r \"alloc\" add 0 0 r> ]" dup parse first unparse =
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -151,12 +151,6 @@ TUPLE: block sections ;
|
||||||
: last-section ( -- section )
|
: last-section ( -- section )
|
||||||
pprinter-block block-sections [ break? not ] find-last nip ;
|
pprinter-block block-sections [ break? not ] find-last nip ;
|
||||||
|
|
||||||
: hilite-style ( -- hash )
|
|
||||||
H{
|
|
||||||
{ background { 0.9 0.9 0.9 1 } }
|
|
||||||
{ highlight t }
|
|
||||||
} ;
|
|
||||||
|
|
||||||
: start-group ( -- )
|
: start-group ( -- )
|
||||||
t last-section set-section-start-group? ;
|
t last-section set-section-start-group? ;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2005, 2007 Slava Pestov.
|
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel words parser io inspector quotations sequences
|
USING: kernel words parser io inspector quotations sequences
|
||||||
prettyprint tools.interpreter ;
|
prettyprint continuations ;
|
||||||
IN: tools.annotations
|
IN: tools.annotations
|
||||||
|
|
||||||
: annotate ( word quot -- )
|
: annotate ( word quot -- )
|
||||||
|
|
Loading…
Reference in New Issue