Skip to content

Commit 345007a

Browse files
Fix type: check for cq not oq
1 parent 0afa177 commit 345007a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/strings.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function xparse(::Type{T}, source::Union{AbstractVector{UInt8}, IO}, pos, len, o
9898
break
9999
else
100100
preqpos = pos
101-
pos = checkquote(source, pos, len, options.oq)
101+
pos = checkquote(source, pos, len, options.cq)
102102
if pos > preqpos
103103
if eof(source, pos, len)
104104
code |= EOF

test/runtests.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ testcases = [
3636
(str=" {\\\\", kwargs=(), x=0, code=(QUOTED | INVALID_QUOTED_FIELD | ESCAPED_STRING | EOF), vpos=3, vlen=0, tlen=4),
3737
(str=" {\\}} ", kwargs=(), x=0, code=(QUOTED | INVALID | ESCAPED_STRING | EOF), vpos=3, vlen=2, tlen=6),
3838
(str=" {\\\\}", kwargs=(), x=0, code=(INVALID | QUOTED | ESCAPED_STRING | EOF), vpos=3, vlen=2, tlen=5),
39-
39+
4040
(str=" {}", kwargs=(), x=0, code=(INVALID | QUOTED | EOF), vpos=3, vlen=0, tlen=3),
4141
(str=" { }", kwargs=(), x=0, code=(INVALID | QUOTED | EOF), vpos=3, vlen=1, tlen=4),
4242
(str=" {,} ", kwargs=(), x=0, code=(INVALID | QUOTED | EOF), vpos=3, vlen=1, tlen=5),
@@ -253,6 +253,8 @@ res = Parsers.xparse(String, "{{hey there}}"; openquotechar="{{", closequotechar
253253
@test res.val.pos == 3 && res.val.len == 9
254254
res = Parsers.xparse(String, "{hey there}"; openquotechar='{', closequotechar='}', stripwhitespace=true)
255255
@test res.val.pos == 2 && res.val.len == 9
256+
res = Parsers.xparse(String, "{{hey there }}"; openquotechar="{{", closequotechar="}}", stripwhitespace=true)
257+
@test res.val.pos == 3 && res.val.len == 10
256258
res = Parsers.xparse(String, "{hey there }"; openquotechar='{', closequotechar='}', stripwhitespace=true)
257259
@test res.val.pos == 2 && res.val.len == 10
258260
res = Parsers.xparse(String, "{hey there },"; openquotechar='{', closequotechar='}', delim=',', stripwhitespace=true)
@@ -270,10 +272,12 @@ res = Parsers.xparse(String, " hey there "; stripwhitespace=true)
270272
res = Parsers.xparse(String, " hey there "; delim=nothing, stripwhitespace=true)
271273
@test res.val.pos == 2 && res.val.len == 9
272274

273-
res = Parsers.xparse(String, "{{hey there }}"; openquotechar="{{", closequotechar="}}", stripquoted=true)
275+
res = Parsers.xparse(String, "{{hey there}}"; openquotechar="{{", closequotechar="}}", stripquoted=true)
274276
@test res.val.pos == 3 && res.val.len == 9
275277
res = Parsers.xparse(String, "{hey there}"; openquotechar='{', closequotechar='}', stripquoted=true)
276278
@test res.val.pos == 2 && res.val.len == 9
279+
res = Parsers.xparse(String, "{{hey there }}"; openquotechar="{{", closequotechar="}}", stripquoted=true)
280+
@test res.val.pos == 3 && res.val.len == 9
277281
res = Parsers.xparse(String, "{hey there }"; openquotechar='{', closequotechar='}', stripquoted=true)
278282
@test res.val.pos == 2 && res.val.len == 9
279283
res = Parsers.xparse(String, "{hey there },"; openquotechar='{', closequotechar='}', delim=',', stripquoted=true)

0 commit comments

Comments
 (0)