Skip to content

Commit 1a9db60

Browse files
committed
CHANGE: Removed /all refine from parse
related to: Oldes/Rebol-issues#2046
1 parent eef4085 commit 1a9db60

12 files changed

+34
-31
lines changed

src/boot/natives.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ parse: native [
540540
{Parses a string or block series according to grammar rules.}
541541
input [series!] {Input series to parse}
542542
rules [block!] {Rules to parse}
543-
/all {For simple rules (not blocks) parse all chars including whitespace}
543+
;/all {For simple rules (not blocks) parse all chars including whitespace}
544544
/case {Uses case-sensitive comparison}
545545
]
546546

src/core/u-parse.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -1286,10 +1286,13 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
12861286
REBVAL *arg = D_ARG(2);
12871287
REBCNT opts = 0;
12881288

1289-
if (D_REF(3)) opts |= PF_ALL;
1290-
if (D_REF(4)) opts |= PF_CASE;
1289+
if (D_REF(3)) opts |= PF_CASE;
1290+
if (IS_BINARY(val)) opts |= PF_CASE;
12911291

1292-
if (IS_BINARY(val)) opts |= PF_ALL | PF_CASE;
1292+
// There was originally also /all
1293+
// if (D_REF(3)) opts |= PF_ALL;
1294+
// if (D_REF(4)) opts |= PF_CASE;
1295+
// if (IS_BINARY(val)) opts |= PF_ALL | PF_CASE;
12931296

12941297
#ifdef INCLUDE_PARSE_SERIES_SPLITTING
12951298
// Is it a simple string?

src/mezz/codec-bbcode.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ form-attribute: func[name /default value][
8787

8888
encode-value: func[value [any-string!] /local out tmp][
8989
out: copy ""
90-
parse/all value [
90+
parse value [
9191
any [
9292
;pos: ;(probe pos)
9393
[

src/mezz/codec-der.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ register-codec [
234234
/full "Returns name with group name as a string"
235235
/local main name warn
236236
][
237-
parse/all oid [
237+
parse oid [
238238
#{2B0E0302} (main: "Oddball OIW OID") [
239239
;http://oid-info.com/get/1.3.14.3.2
240240
#"^(01)" (name: 'rsa)

src/mezz/codec-pkix.reb

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ wrap [
3737
some ch_pretext rl_label
3838
]
3939

40-
unless parse/all input [
40+
unless parse input [
4141
s: rl_label ( pre-text: copy/part s e )
4242
any [
4343
copy tag some ch_tag #":"
@@ -83,7 +83,7 @@ wrap [
8383
|
8484
some ch_pretext rl_label
8585
]
86-
parse/all data [rl_label to end]
86+
parse data [rl_label to end]
8787
]
8888
]
8989
]

src/mezz/codec-utc-time.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ register-codec [
1515
utc [binary! string!]
1616
][
1717
ch_digits: charset [#"0" - #"9"]
18-
parse/all utc [
18+
parse utc [
1919
insert "20"
2020
2 ch_digits insert #"-"
2121
2 ch_digits insert #"-"

src/mezz/mezz-files.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ clean-path: func [
4242
out: make file length? file ; same datatype
4343
cnt: 0 ; back dir counter
4444

45-
parse/all reverse file [
45+
parse reverse file [
4646
some [
4747
;pp: (?? pp)
4848
"../" (++ cnt)

src/mezz/prot-http.reb

+3-3
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ check-response: func [port /local conn res headers d1 d2 line info state awake s
375375
res: false
376376
unless info/response-parsed [
377377
;?? line
378-
parse/all line [
378+
parse line [
379379
"HTTP/1." [#"0" | #"1"] some #" " [
380380
#"1" (info/response-parsed: 'info)
381381
|
@@ -600,7 +600,7 @@ check-data: func [port /local headers res data available out chunk-size pos trai
600600
]
601601
if not empty? data [
602602
until [
603-
either parse/all data [
603+
either parse data [
604604
copy chunk-size some hex-digits
605605
crlfbin pos: to end
606606
][
@@ -610,7 +610,7 @@ check-data: func [port /local headers res data available out chunk-size pos trai
610610
available: length? data
611611
sys/log/more 'HTTP ["Chunk-size:^[[m" chunk-size " ^[[36mavailable:^[[m " available]
612612
either chunk-size = 0 [
613-
if parse/all data [
613+
if parse data [
614614
crlfbin (trailer: "") to end | copy trailer to crlf2bin to end
615615
][
616616
trailer: construct trailer

src/mezz/prot-mysql.reb

+11-11
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ mysql-driver: make object! [
358358
]
359359

360360
set 'sql-escape func [value [string!] /local c][
361-
parse/all value [
361+
parse value [
362362
any [
363363
c: sql-chars (c: change/part c select escaped c/1 1) :c
364364
| sql-no-chars
@@ -694,7 +694,7 @@ mysql-driver: make object! [
694694

695695
insert-all-queries: func [port [port!] data [string!] /local s e res d][
696696
d: port/extra/delimiter
697-
parse/all s: data [
697+
parse s: data [
698698
any [
699699
#"#" thru newline
700700
| #"'" any ["\\" | "\'" | "''" | not-squote] #"'"
@@ -769,7 +769,7 @@ mysql-driver: make object! [
769769
254 [
770770
if pl/packet-len < 9 [
771771
if pl/packet-len = 5 [
772-
parse/all/case next port/data [
772+
parse/case next port/data [
773773
read-int (pl/current-result/warnings: int)
774774
read-int (pl/more-results?: not zero? int and 8)
775775
]
@@ -791,7 +791,7 @@ mysql-driver: make object! [
791791
]
792792
]
793793
; ignore session track info
794-
parse/all/case next port/data rules
794+
parse/case next port/data rules
795795
]
796796
return 'OK
797797
]
@@ -905,7 +905,7 @@ mysql-driver: make object! [
905905
case [
906906
any [pl/current-cmd = defs/cmd/query
907907
pl/current-cmd = defs/cmd/field-list][
908-
parse/all/case buf [
908+
parse/case buf [
909909
read-length (if zero? pl/current-result/n-columns: len [
910910
pl/stream-end?: true
911911
sys/log/more 'MySQL["stream ended because of 0 columns"]
@@ -970,7 +970,7 @@ mysql-driver: make object! [
970970
OTHER [
971971
col: make column-class []
972972
either pl/capabilities and defs/client/protocol-41 [
973-
parse/all/case buf [
973+
parse/case buf [
974974
read-field (col/catalog: to string! field)
975975
read-field (col/db: to string! field)
976976
read-field (col/table: to string! field)
@@ -987,7 +987,7 @@ mysql-driver: make object! [
987987
read-length (col/default: len)
988988
]
989989
][
990-
parse/all/case buf [
990+
parse/case buf [
991991
read-field (col/table: to string! field)
992992
read-field (col/name: to string! field)
993993
read-length (col/length: len)
@@ -1049,7 +1049,7 @@ mysql-driver: make object! [
10491049
OTHER FB[
10501050
row: make block! pl/current-result/n-columns
10511051
;sys/log/more 'MySQL["row buf:" copy/part buf pl/next-packet-length]
1052-
parse/all/case buf [pl/current-result/n-columns [read-field (append row field)]]
1052+
parse/case buf [pl/current-result/n-columns [read-field (append row field)]]
10531053
;sys/log/more 'MySQL["row:" mold row]
10541054
if none? pl/current-result/rows [
10551055
pl/current-result/rows: make block! 10
@@ -1114,13 +1114,13 @@ mysql-driver: make object! [
11141114
tcp-port: port
11151115
pl: port/extra
11161116
if data/1 = 255 [;error packet
1117-
parse/all skip data 1 [
1117+
parse skip data 1 [
11181118
read-int (pl/error-code: int)
11191119
read-string (pl/error-msg: string)
11201120
]
11211121
cause-error 'Access 'message reduce [pl/error-code pl/error-msg]
11221122
]
1123-
parse/all data [
1123+
parse data [
11241124
read-byte (pl/protocol: byte)
11251125
read-string (pl/version: string)
11261126
read-long (pl/thread-id: long)
@@ -1255,7 +1255,7 @@ mysql-driver: make object! [
12551255
switch/default pl/packet-state [
12561256
reading-packet-head [
12571257
;sys/log/more 'MySQL["read a packet head" mold copy/part tcp-port/data std-header-length]
1258-
parse/all tcp-port/data [
1258+
parse tcp-port/data [
12591259
read-int24 (pl/packet-len: int24)
12601260
read-byte (pl/seq-num: byte)
12611261
]

src/mezz/sys-base.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ log: func [
237237
][
238238
if error [
239239
msg: form either block? msg [reduce msg][msg]
240-
foreach line parse/all msg #"^/" [
240+
foreach line split msg #"^/" [
241241
print ajoin [
242242
" ^[[35m[" id "] ^[[1m"
243243
either line/1 = #"*" []["** Error: "]

src/modules/httpd.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ decode-target: wrap [
5454

5555
result: object [file: none values: make block! 8 fragment: none original: target]
5656
unless target [return result]
57-
parse/all to binary! target [
57+
parse to binary! target [
5858
opt [
5959
copy val any chars (result/file: val) [
6060
#"?"

src/tests/units/parse-test.r3

+5-5
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ Rebol [
347347
abc: charset [ "a" "b" "c" ]
348348
rls: [ "a" some ws copy b some abc some ws "c" ]
349349
rla: [ "a" any ws copy b some abc any ws "c" ]
350-
--assert parse/all "a b c" rls
351-
--assert parse/all "a b c" rla
352-
--assert not parse/all "a b" rls
353-
--assert not parse/all "a b" rla
350+
--assert parse "a b c" rls
351+
--assert parse "a b c" rla
352+
--assert not parse "a b" rls
353+
--assert not parse "a b" rla
354354

355355

356356
--test-- "issue-967"
@@ -392,7 +392,7 @@ Rebol [
392392
--test-- "issue-206"
393393
;@@ https://github.com/Oldes/Rebol-issues/issues/206
394394
any-char: complement charset ""
395-
--assert parse/all "^(80)" [any-char]
395+
--assert parse "^(80)" [any-char]
396396

397397
--test-- "issue-1895"
398398
;@@ https://github.com/Oldes/Rebol-issues/issues/1895

0 commit comments

Comments
 (0)