From 84e40810cd94c16fad1dc043c6dbac39f9805721 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 26 Aug 2017 01:46:04 -0500 Subject: [PATCH] factor: CHAR: : -> CHAR: \:, same for [{( --- basis/calendar/parser/parser.factor | 2 +- basis/cocoa/messages/messages.factor | 4 ++-- basis/farkup/farkup.factor | 12 ++++++------ basis/help/html/html.factor | 2 +- basis/io/files/info/windows/windows.factor | 2 +- basis/io/files/windows/windows.factor | 2 +- basis/json/reader/reader.factor | 6 +++--- basis/json/writer/writer.factor | 6 +++--- basis/xml/elements/elements.factor | 4 ++-- basis/xml/name/name.factor | 4 ++-- extra/bencode/bencode.factor | 2 +- extra/couchdb/couchdb.factor | 2 +- extra/flip-text/flip-text.factor | 4 ++-- extra/gopher/gopher.factor | 2 +- extra/hashcash/hashcash.factor | 2 +- extra/infix/tokenizer/tokenizer-tests.factor | 2 +- extra/infix/tokenizer/tokenizer.factor | 4 ++-- extra/ini-file/ini-file.factor | 6 +++--- extra/irc/messages/base/base.factor | 2 +- extra/lcd/lcd.factor | 2 +- extra/modern/modern.factor | 16 ++++++++-------- extra/modern/slices/slices.factor | 6 +++--- extra/morse/morse.factor | 2 +- .../redis/response-parser/response-parser.factor | 2 +- .../balanced-brackets/balanced-brackets.factor | 2 +- extra/smalltalk/selectors/selectors.factor | 4 ++-- extra/txon/txon.factor | 2 +- extra/yaml/conversion/conversion.factor | 2 +- 28 files changed, 54 insertions(+), 54 deletions(-) diff --git a/basis/calendar/parser/parser.factor b/basis/calendar/parser/parser.factor index eb0a732408..5bd67b6b15 100644 --- a/basis/calendar/parser/parser.factor +++ b/basis/calendar/parser/parser.factor @@ -37,7 +37,7 @@ ERROR: invalid-timestamp-format ; [ [ read-00 hours - read1 { { CHAR: : [ read-00 ] } { f [ 0 ] } } case minutes + read1 { { CHAR: \: [ read-00 ] } { f [ 0 ] } } case minutes time+ ] dip signed-gmt-offset ] diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 63cbe0224e..de9aac047c 100644 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -210,8 +210,8 @@ ERROR: no-objc-type name ; [ [ 1 + ] dip ] [ nth ] 2bi { { [ dup "rnNoORV" member? ] [ drop (parse-objc-type) ] } { [ dup CHAR: ^ = ] [ 3drop void* ] } - { [ dup CHAR: { = ] [ drop objc-struct-type ] } - { [ dup CHAR: [ = ] [ 3drop void* ] } + { [ dup CHAR: \{ = ] [ drop objc-struct-type ] } + { [ dup CHAR: \[ = ] [ 3drop void* ] } [ 2nip decode-type ] } cond ; diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 4107bb7d16..4d0f8b649c 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -82,9 +82,9 @@ DEFER: (parse-paragraph) ] dip [ (parse-paragraph) cons ] [ 1list ] if* ; : parse-big-link ( before after -- link rest ) - dup ?first CHAR: [ = + dup ?first CHAR: \[ = [ parse-link ] - [ [ CHAR: [ suffix ] [ (parse-paragraph) ] bi* ] + [ [ CHAR: \[ suffix ] [ (parse-paragraph) ] bi* ] if ; : escape ( before after -- before' after' ) @@ -94,7 +94,7 @@ DEFER: (parse-paragraph) [ nil ] [ [ "*_^~%[\\" member? ] find-cut [ { - { CHAR: [ [ parse-big-link ] } + { CHAR: \[ [ parse-big-link ] } { CHAR: \\ [ escape ] } [ dup delimiter-class parse-delimiter ] } case cons @@ -181,7 +181,7 @@ DEFER: (parse-paragraph) CHAR: # ordered-list parse-list ; : parse-code ( state -- state' item ) - dup 1 look CHAR: [ = + dup 1 look CHAR: \[ = [ unclip-slice make-paragraph ] [ dup "{" take-until [ [ nip rest ] dip @@ -197,7 +197,7 @@ DEFER: (parse-paragraph) { CHAR: _ [ parse-line ] } { CHAR: - [ parse-ul ] } { CHAR: # [ parse-ol ] } - { CHAR: [ [ parse-code ] } + { CHAR: \[ [ parse-code ] } { f [ rest-slice f ] } [ drop unclip-slice make-paragraph ] } case ; @@ -212,7 +212,7 @@ CONSTANT: invalid-url "javascript:alert('Invalid URL in farkup');" { [ dup empty? ] [ drop invalid-url ] } { [ dup [ 127 > ] any? ] [ drop invalid-url ] } { [ dup first "/\\" member? ] [ drop invalid-url ] } - { [ CHAR: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] } + { [ CHAR: \: over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] } [ relative-link-prefix get prepend "" like url-encode ] } cond ; diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index eaba3c55be..9a33f5a98f 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -17,7 +17,7 @@ IN: help.html dup H{ { CHAR: \" "__quo__" } { CHAR: * "__star__" } - { CHAR: : "__colon__" } + { CHAR: \: "__colon__" } { CHAR: < "__lt__" } { CHAR: > "__gt__" } { CHAR: ? "__que__" } diff --git a/basis/io/files/info/windows/windows.factor b/basis/io/files/info/windows/windows.factor index 702d832454..61deec1653 100755 --- a/basis/io/files/info/windows/windows.factor +++ b/basis/io/files/info/windows/windows.factor @@ -147,7 +147,7 @@ ERROR: not-absolute-path ; unicode-prefix ?head drop dup { [ length 2 >= ] - [ second CHAR: : = ] + [ second CHAR: \: = ] [ first Letter? ] } 1&& [ 2 head "\\" append ] [ not-absolute-path ] if ; diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 566f8c7a8c..f8496bb087 100755 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -320,7 +320,7 @@ M: windows root-directory? ( path -- ? ) { [ dup empty? ] [ drop f ] } { [ dup [ path-separator? ] all? ] [ drop t ] } { [ dup trim-tail-separators { [ length 2 = ] - [ second CHAR: : = ] } 1&& ] [ drop t ] } + [ second CHAR: \: = ] } 1&& ] [ drop t ] } { [ dup unicode-prefix head? ] [ trim-tail-separators length unicode-prefix length 2 + = ] } [ drop f ] diff --git a/basis/json/reader/reader.factor b/basis/json/reader/reader.factor index 39e932c102..67ffcfefe0 100644 --- a/basis/json/reader/reader.factor +++ b/basis/json/reader/reader.factor @@ -109,11 +109,11 @@ DEFER: (read-json-string) { object vector object } declare { { CHAR: \" [ over read-json-string suffix! ] } - { CHAR: [ [ json-open-array ] } + { CHAR: \[ [ json-open-array ] } { CHAR: , [ v-over-push ] } { CHAR: ] [ json-close-array ] } - { CHAR: { [ json-open-hash ] } - { CHAR: : [ v-pick-push ] } + { CHAR: \{ [ json-open-hash ] } + { CHAR: \: [ v-pick-push ] } { CHAR: } [ json-close-hash ] } { CHAR: \s [ ] } { CHAR: \t [ ] } diff --git a/basis/json/writer/writer.factor b/basis/json/writer/writer.factor index 4f91e7eb6a..1820e7f8e0 100644 --- a/basis/json/writer/writer.factor +++ b/basis/json/writer/writer.factor @@ -111,7 +111,7 @@ M: real stream-json-print [ >float number>string ] [ stream-write ] bi* ; M: sequence stream-json-print - CHAR: [ over stream-write1 swap + CHAR: \[ over stream-write1 swap over '[ CHAR: , _ stream-write1 ] pick '[ _ stream-json-print ] interleave CHAR: ] swap stream-write1 ; @@ -130,7 +130,7 @@ M: float json-coerce float>json ; M: real json-coerce >float number>string ; :: json-print-assoc ( obj stream -- ) - CHAR: { stream stream-write1 obj >alist + CHAR: \{ stream stream-write1 obj >alist [ CHAR: , stream stream-write1 ] json-friendly-keys? get json-coerce-keys? get '[ @@ -140,7 +140,7 @@ M: real json-coerce >float number>string ; [ _ [ json-coerce ] when ] if stream stream-json-print ] [ - CHAR: : stream stream-write1 + CHAR: \: stream stream-write1 stream stream-json-print ] bi* ] interleave diff --git a/basis/xml/elements/elements.factor b/basis/xml/elements/elements.factor index 04aee4d69e..59a456e8ad 100644 --- a/basis/xml/elements/elements.factor +++ b/basis/xml/elements/elements.factor @@ -132,7 +132,7 @@ DEFER: make-tag ! Is this unavoidable? [ take-external-id ] [ f ] if ; : take-internal ( -- dtd/f ) - get-char CHAR: [ eq? + get-char CHAR: \[ eq? [ next take-internal-subset ] [ f ] if ; : take-doctype-decl ( -- doctype-decl ) @@ -152,7 +152,7 @@ DEFER: make-tag ! Is this unavoidable? : direct ( -- object ) get-char { { CHAR: - [ take-comment ] } - { CHAR: [ [ take-cdata ] } + { CHAR: \[ [ take-cdata ] } [ drop take-directive ] } case ; diff --git a/basis/xml/name/name.factor b/basis/xml/name/name.factor index 51b1dcf5ad..4c8a033f7a 100644 --- a/basis/xml/name/name.factor +++ b/basis/xml/name/name.factor @@ -65,8 +65,8 @@ SYMBOL: ns-stack } 2&& [ f ] [ 2drop f ] if ; : prefixed-name ( str -- name/f ) - CHAR: : over index [ - CHAR: : 2over 1 + swap index-from + CHAR: \: over index [ + CHAR: \: 2over 1 + swap index-from [ 2drop f ] [ [ head ] [ 1 + tail ] 2bi maybe-name ] if diff --git a/extra/bencode/bencode.factor b/extra/bencode/bencode.factor index 2347595ae4..150f0f41c6 100644 --- a/extra/bencode/bencode.factor +++ b/extra/bencode/bencode.factor @@ -34,7 +34,7 @@ DEFER: read-bencode ] [ ] produce nip >hashtable ; : read-string ( prefix -- obj ) - ":" read-until CHAR: : assert= swap prefix + ":" read-until CHAR: \: assert= swap prefix string>number read ascii decode ; : read-bencode ( -- obj ) diff --git a/extra/couchdb/couchdb.factor b/extra/couchdb/couchdb.factor index 15db1920e1..111c911a78 100644 --- a/extra/couchdb/couchdb.factor +++ b/extra/couchdb/couchdb.factor @@ -74,7 +74,7 @@ CONSTANT: default-uuids-to-cache 100 default-couch-host default-couch-port ; : (server-url) ( server -- ) - "http://" % [ host>> % ] [ CHAR: : , port>> number>string % ] bi CHAR: / , ; inline + "http://" % [ host>> % ] [ CHAR: \: , port>> number>string % ] bi CHAR: / , ; inline : server-url ( server -- url ) [ (server-url) ] "" make ; diff --git a/extra/flip-text/flip-text.factor b/extra/flip-text/flip-text.factor index ee25928d6c..31ead7f964 100644 --- a/extra/flip-text/flip-text.factor +++ b/extra/flip-text/flip-text.factor @@ -74,9 +74,9 @@ CONSTANT: CHARS H{ { CHAR: \" 0x201E } { CHAR: . 0x02D9 } { CHAR: ; 0x061B } - { CHAR: [ CHAR: ] } + { CHAR: \[ CHAR: ] } { CHAR: ( CHAR: ) } - { CHAR: { CHAR: } } + { CHAR: \{ CHAR: } } { CHAR: ? 0x00BF } { CHAR: ! 0x00A1 } { CHAR: ' CHAR: , } diff --git a/extra/gopher/gopher.factor b/extra/gopher/gopher.factor index 5820c784f7..9bef920f1e 100644 --- a/extra/gopher/gopher.factor +++ b/extra/gopher/gopher.factor @@ -35,7 +35,7 @@ CONSTANT: A_WHOIS CHAR: w CONSTANT: A_QUERY CHAR: q CONSTANT: A_GIF CHAR: g CONSTANT: A_WWW CHAR: w -CONSTANT: A_PLUS_IMAGE CHAR: : +CONSTANT: A_PLUS_IMAGE CHAR: \: CONSTANT: A_PLUS_MOVIE CHAR: ; CONSTANT: A_PLUS_SOUND CHAR: < diff --git a/extra/hashcash/hashcash.factor b/extra/hashcash/hashcash.factor index 0342655172..f47210c0bc 100644 --- a/extra/hashcash/hashcash.factor +++ b/extra/hashcash/hashcash.factor @@ -25,7 +25,7 @@ IN: hashcash ! Random salt is formed by ascii characters ! between 33 and 126 : available-chars ( -- seq ) - 33 126 [a,b] [ CHAR: : = ] reject ; + 33 126 [a,b] [ CHAR: \: = ] reject ; PRIVATE> diff --git a/extra/infix/tokenizer/tokenizer-tests.factor b/extra/infix/tokenizer/tokenizer-tests.factor index 4a5abff301..a92eecac09 100644 --- a/extra/infix/tokenizer/tokenizer-tests.factor +++ b/extra/infix/tokenizer/tokenizer-tests.factor @@ -8,7 +8,7 @@ IN: infix.tokenizer.tests { V{ T{ ast-value f 3 } CHAR: / CHAR: ( T{ ast-value f 3 } CHAR: + T{ ast-value f 4 } CHAR: ) } } [ "3/(3+4)" tokenize-infix ] unit-test { V{ "foo" CHAR: ( "x" CHAR: , "y" CHAR: , "z" CHAR: ) } } [ "foo(x,y,z)" tokenize-infix ] unit-test -{ V{ "arr" CHAR: [ "x" CHAR: + T{ ast-value f 3 } CHAR: ] } } +{ V{ "arr" CHAR: \[ "x" CHAR: + T{ ast-value f 3 } CHAR: ] } } [ "arr[x+3]" tokenize-infix ] unit-test [ "1.0.4" tokenize-infix ] must-fail { V{ CHAR: + CHAR: ] T{ ast-value f 3.4 } CHAR: , "bar" } } diff --git a/extra/infix/tokenizer/tokenizer.factor b/extra/infix/tokenizer/tokenizer.factor index 0f59d842c3..4064991d7c 100644 --- a/extra/infix/tokenizer/tokenizer.factor +++ b/extra/infix/tokenizer/tokenizer.factor @@ -17,8 +17,8 @@ NameFirst = Letter | "_" => [[ CHAR: _ ]] NameRest = NameFirst | Digit Name = NameFirst NameRest* => [[ first2 swap prefix >string ]] Special = [+*/%(),] | "-" => [[ CHAR: - ]] - | "[" => [[ CHAR: [ ]] | "]" => [[ CHAR: ] ]] - | ":" => [[ CHAR: : ]] + | "[" => [[ CHAR: \[ ]] | "]" => [[ CHAR: ] ]] + | ":" => [[ CHAR: \: ]] Tok = Spaces (Name | Number | String | Special ) End = !(.) Toks = Tok* Spaces End diff --git a/extra/ini-file/ini-file.factor b/extra/ini-file/ini-file.factor index a31993cf69..8816c6b66c 100644 --- a/extra/ini-file/ini-file.factor +++ b/extra/ini-file/ini-file.factor @@ -23,7 +23,7 @@ IN: ini-file { CHAR: \\ CHAR: \\ } { CHAR: ? CHAR: ? } { CHAR: ; CHAR: ; } - { CHAR: [ CHAR: [ } + { CHAR: \[ CHAR: \[ } { CHAR: ] CHAR: ] } { CHAR: = CHAR: = } } ?at [ bad-escape ] unless ; @@ -54,7 +54,7 @@ USE: xml.entities { CHAR: \\ "\\\\" } { CHAR: ? "\\?" } { CHAR: ; "\\;" } - { CHAR: [ "\\[" } + { CHAR: \[ "\\[" } { CHAR: ] "\\]" } { CHAR: = "\\=" } } escape-string-by ; @@ -87,7 +87,7 @@ SYMBOL: option : section? ( line -- index/f ) { [ length 1 > ] - [ first CHAR: [ = ] + [ first CHAR: \[ = ] [ CHAR: ] swap last-index ] } 1&& ; diff --git a/extra/irc/messages/base/base.factor b/extra/irc/messages/base/base.factor index f5d3f50c6e..adc399ba51 100644 --- a/extra/irc/messages/base/base.factor +++ b/extra/irc/messages/base/base.factor @@ -81,7 +81,7 @@ M: irc-message set-irc-command [ prefix>> ] [ command>> ] [ parameters>> " " join ] - [ trailing>> dup [ CHAR: : prefix ] when ] + [ trailing>> dup [ CHAR: \: prefix ] when ] } cleave 4array sift " " join ; = >> etc ] if ] } - { CHAR: [ [ read-bracket ] } - { CHAR: { [ read-brace ] } + { CHAR: \[ [ read-bracket ] } + { CHAR: \{ [ read-brace ] } { CHAR: ( [ read-paren ] } { CHAR: \s [ read-token-or-whitespace ] } { CHAR: \r [ read-token-or-whitespace ] } diff --git a/extra/modern/slices/slices.factor b/extra/modern/slices/slices.factor index c0a250d5f1..efef4fd647 100644 --- a/extra/modern/slices/slices.factor +++ b/extra/modern/slices/slices.factor @@ -10,10 +10,10 @@ IN: modern.slices : matching-delimiter ( ch -- ch' ) H{ { CHAR: ( CHAR: ) } - { CHAR: [ CHAR: ] } - { CHAR: { CHAR: } } + { CHAR: \[ CHAR: ] } + { CHAR: \{ CHAR: } } { CHAR: < CHAR: > } - { CHAR: : CHAR: ; } + { CHAR: \: CHAR: ; } } ?at drop ; : matching-delimiter-string ( string -- string' ) diff --git a/extra/morse/morse.factor b/extra/morse/morse.factor index 23301ed3f8..dbbd84c94d 100755 --- a/extra/morse/morse.factor +++ b/extra/morse/morse.factor @@ -65,7 +65,7 @@ CONSTANT: morse-code-table $[ { CHAR: ( "-.--." } { CHAR: ) "-.--.-" } { CHAR: & ".-..." } - { CHAR: : "---..." } + { CHAR: \: "---..." } { CHAR: ; "-.-.-." } { CHAR: = "-...- " } { CHAR: + ".-.-." } diff --git a/extra/redis/response-parser/response-parser.factor b/extra/redis/response-parser/response-parser.factor index 5b4f0b3283..ba5a2755c6 100644 --- a/extra/redis/response-parser/response-parser.factor +++ b/extra/redis/response-parser/response-parser.factor @@ -30,7 +30,7 @@ PRIVATE> : read-response ( -- response ) readln unclip { - { CHAR: : [ string>number ] } + { CHAR: \: [ string>number ] } { CHAR: + [ handle-response ] } { CHAR: $ [ string>number read-bulk ] } { CHAR: * [ string>number read-multi-bulk ] } diff --git a/extra/rosetta-code/balanced-brackets/balanced-brackets.factor b/extra/rosetta-code/balanced-brackets/balanced-brackets.factor index aa174fe148..a2e4d57681 100644 --- a/extra/rosetta-code/balanced-brackets/balanced-brackets.factor +++ b/extra/rosetta-code/balanced-brackets/balanced-brackets.factor @@ -26,7 +26,7 @@ IN: rosetta-code.balanced-brackets t :> ok! str [ { - { CHAR: [ [ 1 ] } + { CHAR: \[ [ 1 ] } { CHAR: ] [ -1 ] } [ drop 0 ] } case counter + counter! diff --git a/extra/smalltalk/selectors/selectors.factor b/extra/smalltalk/selectors/selectors.factor index b4828bdbb4..9b1e37b36c 100644 --- a/extra/smalltalk/selectors/selectors.factor +++ b/extra/smalltalk/selectors/selectors.factor @@ -9,7 +9,7 @@ SYMBOLS: unary binary keyword ; : selector-type ( selector -- type ) { { [ dup [ "~!@%&*-+=|\\<>,?/" member? ] all? ] [ binary ] } - { [ CHAR: : over member? ] [ keyword ] } + { [ CHAR: \: over member? ] [ keyword ] } [ unary ] } cond nip ; @@ -17,7 +17,7 @@ SYMBOLS: unary binary keyword ; dup selector-type { { unary [ drop { } ] } { binary [ drop { "x" } ] } - { keyword [ [ CHAR: : = ] count "x" ] } + { keyword [ [ CHAR: \: = ] count "x" ] } } case "receiver" suffix { "result" } ; : selector>generic ( selector -- generic ) diff --git a/extra/txon/txon.factor b/extra/txon/txon.factor index e04c7c1a3d..c6efc5e6a6 100644 --- a/extra/txon/txon.factor +++ b/extra/txon/txon.factor @@ -32,7 +32,7 @@ DEFER: name/values : parse-value ( string -- remain value ) dup find-` [ - dup 1 - pick ?nth CHAR: : = + dup 1 - pick ?nth CHAR: \: = [ drop name/values ] [ cut swap (parse-value) ] if [ rest [ blank? ] trim-head ] dip ] [ f swap ] if* ; diff --git a/extra/yaml/conversion/conversion.factor b/extra/yaml/conversion/conversion.factor index 88d21c2ad2..268f418a50 100644 --- a/extra/yaml/conversion/conversion.factor +++ b/extra/yaml/conversion/conversion.factor @@ -111,7 +111,7 @@ CONSTANT: YAML_SET_TAG "tag:yaml.org,2002:set" R/ -[0-9][^0-9]/ [ [ CHAR: 0 1 ] dip insert-nth ] re-replace-with R/ [^0-9][0-9]:/ [ [ CHAR: 0 1 ] dip insert-nth ] re-replace-with R/ [ \t]+/ " " re-replace - CHAR: : over index cut CHAR: space swap remove append ; + CHAR: \: over index cut CHAR: space swap remove append ; : construct-timestamp ( obj -- obj' ) dup R/ [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/ matches?