diff --git a/src/boot/natives.reb b/src/boot/natives.reb index b45f07ad6e..2cf17ac9c4 100644 --- a/src/boot/natives.reb +++ b/src/boot/natives.reb @@ -540,7 +540,7 @@ parse: native [ {Parses a string or block series according to grammar rules.} input [series!] {Input series to parse} rules [block!] {Rules to parse} - /all {For simple rules (not blocks) parse all chars including whitespace} + ;/all {For simple rules (not blocks) parse all chars including whitespace} /case {Uses case-sensitive comparison} ] diff --git a/src/core/u-parse.c b/src/core/u-parse.c index 76221add93..6d0bb7bfb5 100644 --- a/src/core/u-parse.c +++ b/src/core/u-parse.c @@ -1286,10 +1286,13 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index) REBVAL *arg = D_ARG(2); REBCNT opts = 0; - if (D_REF(3)) opts |= PF_ALL; - if (D_REF(4)) opts |= PF_CASE; + if (D_REF(3)) opts |= PF_CASE; + if (IS_BINARY(val)) opts |= PF_CASE; - if (IS_BINARY(val)) opts |= PF_ALL | PF_CASE; +// There was originally also /all +// if (D_REF(3)) opts |= PF_ALL; +// if (D_REF(4)) opts |= PF_CASE; +// if (IS_BINARY(val)) opts |= PF_ALL | PF_CASE; #ifdef INCLUDE_PARSE_SERIES_SPLITTING // Is it a simple string? diff --git a/src/mezz/codec-bbcode.reb b/src/mezz/codec-bbcode.reb index 457c1e7486..538fefe245 100644 --- a/src/mezz/codec-bbcode.reb +++ b/src/mezz/codec-bbcode.reb @@ -87,7 +87,7 @@ form-attribute: func[name /default value][ encode-value: func[value [any-string!] /local out tmp][ out: copy "" - parse/all value [ + parse value [ any [ ;pos: ;(probe pos) [ diff --git a/src/mezz/codec-der.reb b/src/mezz/codec-der.reb index 184f9c41cb..a264707917 100644 --- a/src/mezz/codec-der.reb +++ b/src/mezz/codec-der.reb @@ -234,7 +234,7 @@ register-codec [ /full "Returns name with group name as a string" /local main name warn ][ - parse/all oid [ + parse oid [ #{2B0E0302} (main: "Oddball OIW OID") [ ;http://oid-info.com/get/1.3.14.3.2 #"^(01)" (name: 'rsa) diff --git a/src/mezz/codec-pkix.reb b/src/mezz/codec-pkix.reb index 55fd401a62..ef1787d272 100644 --- a/src/mezz/codec-pkix.reb +++ b/src/mezz/codec-pkix.reb @@ -37,7 +37,7 @@ wrap [ some ch_pretext rl_label ] - unless parse/all input [ + unless parse input [ s: rl_label ( pre-text: copy/part s e ) any [ copy tag some ch_tag #":" @@ -83,7 +83,7 @@ wrap [ | some ch_pretext rl_label ] - parse/all data [rl_label to end] + parse data [rl_label to end] ] ] ] \ No newline at end of file diff --git a/src/mezz/codec-utc-time.reb b/src/mezz/codec-utc-time.reb index 821f60b286..f313cf2d7e 100644 --- a/src/mezz/codec-utc-time.reb +++ b/src/mezz/codec-utc-time.reb @@ -15,7 +15,7 @@ register-codec [ utc [binary! string!] ][ ch_digits: charset [#"0" - #"9"] - parse/all utc [ + parse utc [ insert "20" 2 ch_digits insert #"-" 2 ch_digits insert #"-" diff --git a/src/mezz/mezz-files.reb b/src/mezz/mezz-files.reb index 1242a183c7..5d5c5242fe 100644 --- a/src/mezz/mezz-files.reb +++ b/src/mezz/mezz-files.reb @@ -42,7 +42,7 @@ clean-path: func [ out: make file length? file ; same datatype cnt: 0 ; back dir counter - parse/all reverse file [ + parse reverse file [ some [ ;pp: (?? pp) "../" (++ cnt) diff --git a/src/mezz/prot-http.reb b/src/mezz/prot-http.reb index 97c6b1799d..95ce8e1db5 100644 --- a/src/mezz/prot-http.reb +++ b/src/mezz/prot-http.reb @@ -375,7 +375,7 @@ check-response: func [port /local conn res headers d1 d2 line info state awake s res: false unless info/response-parsed [ ;?? line - parse/all line [ + parse line [ "HTTP/1." [#"0" | #"1"] some #" " [ #"1" (info/response-parsed: 'info) | @@ -600,7 +600,7 @@ check-data: func [port /local headers res data available out chunk-size pos trai ] if not empty? data [ until [ - either parse/all data [ + either parse data [ copy chunk-size some hex-digits crlfbin pos: to end ][ @@ -610,7 +610,7 @@ check-data: func [port /local headers res data available out chunk-size pos trai available: length? data sys/log/more 'HTTP ["Chunk-size:^[[m" chunk-size " ^[[36mavailable:^[[m " available] either chunk-size = 0 [ - if parse/all data [ + if parse data [ crlfbin (trailer: "") to end | copy trailer to crlf2bin to end ][ trailer: construct trailer diff --git a/src/mezz/prot-mysql.reb b/src/mezz/prot-mysql.reb index 6d6ec00da4..f1be98d691 100644 --- a/src/mezz/prot-mysql.reb +++ b/src/mezz/prot-mysql.reb @@ -358,7 +358,7 @@ mysql-driver: make object! [ ] set 'sql-escape func [value [string!] /local c][ - parse/all value [ + parse value [ any [ c: sql-chars (c: change/part c select escaped c/1 1) :c | sql-no-chars @@ -694,7 +694,7 @@ mysql-driver: make object! [ insert-all-queries: func [port [port!] data [string!] /local s e res d][ d: port/extra/delimiter - parse/all s: data [ + parse s: data [ any [ #"#" thru newline | #"'" any ["\\" | "\'" | "''" | not-squote] #"'" @@ -769,7 +769,7 @@ mysql-driver: make object! [ 254 [ if pl/packet-len < 9 [ if pl/packet-len = 5 [ - parse/all/case next port/data [ + parse/case next port/data [ read-int (pl/current-result/warnings: int) read-int (pl/more-results?: not zero? int and 8) ] @@ -791,7 +791,7 @@ mysql-driver: make object! [ ] ] ; ignore session track info - parse/all/case next port/data rules + parse/case next port/data rules ] return 'OK ] @@ -905,7 +905,7 @@ mysql-driver: make object! [ case [ any [pl/current-cmd = defs/cmd/query pl/current-cmd = defs/cmd/field-list][ - parse/all/case buf [ + parse/case buf [ read-length (if zero? pl/current-result/n-columns: len [ pl/stream-end?: true sys/log/more 'MySQL["stream ended because of 0 columns"] @@ -970,7 +970,7 @@ mysql-driver: make object! [ OTHER [ col: make column-class [] either pl/capabilities and defs/client/protocol-41 [ - parse/all/case buf [ + parse/case buf [ read-field (col/catalog: to string! field) read-field (col/db: to string! field) read-field (col/table: to string! field) @@ -987,7 +987,7 @@ mysql-driver: make object! [ read-length (col/default: len) ] ][ - parse/all/case buf [ + parse/case buf [ read-field (col/table: to string! field) read-field (col/name: to string! field) read-length (col/length: len) @@ -1049,7 +1049,7 @@ mysql-driver: make object! [ OTHER FB[ row: make block! pl/current-result/n-columns ;sys/log/more 'MySQL["row buf:" copy/part buf pl/next-packet-length] - parse/all/case buf [pl/current-result/n-columns [read-field (append row field)]] + parse/case buf [pl/current-result/n-columns [read-field (append row field)]] ;sys/log/more 'MySQL["row:" mold row] if none? pl/current-result/rows [ pl/current-result/rows: make block! 10 @@ -1114,13 +1114,13 @@ mysql-driver: make object! [ tcp-port: port pl: port/extra if data/1 = 255 [;error packet - parse/all skip data 1 [ + parse skip data 1 [ read-int (pl/error-code: int) read-string (pl/error-msg: string) ] cause-error 'Access 'message reduce [pl/error-code pl/error-msg] ] - parse/all data [ + parse data [ read-byte (pl/protocol: byte) read-string (pl/version: string) read-long (pl/thread-id: long) @@ -1255,7 +1255,7 @@ mysql-driver: make object! [ switch/default pl/packet-state [ reading-packet-head [ ;sys/log/more 'MySQL["read a packet head" mold copy/part tcp-port/data std-header-length] - parse/all tcp-port/data [ + parse tcp-port/data [ read-int24 (pl/packet-len: int24) read-byte (pl/seq-num: byte) ] diff --git a/src/mezz/sys-base.reb b/src/mezz/sys-base.reb index 2612abdfbb..d658ce9497 100644 --- a/src/mezz/sys-base.reb +++ b/src/mezz/sys-base.reb @@ -237,7 +237,7 @@ log: func [ ][ if error [ msg: form either block? msg [reduce msg][msg] - foreach line parse/all msg #"^/" [ + foreach line split msg #"^/" [ print ajoin [ " ^[[35m[" id "] ^[[1m" either line/1 = #"*" []["** Error: "] diff --git a/src/modules/httpd.reb b/src/modules/httpd.reb index d501ed60a5..bd79b19347 100644 --- a/src/modules/httpd.reb +++ b/src/modules/httpd.reb @@ -54,7 +54,7 @@ decode-target: wrap [ result: object [file: none values: make block! 8 fragment: none original: target] unless target [return result] - parse/all to binary! target [ + parse to binary! target [ opt [ copy val any chars (result/file: val) [ #"?" diff --git a/src/tests/units/parse-test.r3 b/src/tests/units/parse-test.r3 index b8e544007a..c8182e8b86 100644 --- a/src/tests/units/parse-test.r3 +++ b/src/tests/units/parse-test.r3 @@ -347,10 +347,10 @@ Rebol [ abc: charset [ "a" "b" "c" ] rls: [ "a" some ws copy b some abc some ws "c" ] rla: [ "a" any ws copy b some abc any ws "c" ] - --assert parse/all "a b c" rls - --assert parse/all "a b c" rla - --assert not parse/all "a b" rls - --assert not parse/all "a b" rla + --assert parse "a b c" rls + --assert parse "a b c" rla + --assert not parse "a b" rls + --assert not parse "a b" rla --test-- "issue-967" @@ -392,7 +392,7 @@ Rebol [ --test-- "issue-206" ;@@ https://github.com/Oldes/Rebol-issues/issues/206 any-char: complement charset "" - --assert parse/all "^(80)" [any-char] + --assert parse "^(80)" [any-char] --test-- "issue-1895" ;@@ https://github.com/Oldes/Rebol-issues/issues/1895