Skip to content

Commit 41eea0c

Browse files
authored
Update JSON.bas
v1.6.0, fixed object and array patterns for non strict evaluation of trailing comma.
1 parent c9be0a9 commit 41eea0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

JSON.bas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Attribute VB_Name = "JSON"
22

3-
' VBA JSON parser, Backus-Naur form JSON parser based on RegEx v1.6.01
3+
' VBA JSON parser, Backus-Naur form JSON parser based on RegEx v1.6.02
44
' Copyright (C) 2015-2017 omegastripes
55
' omegastripes@yandex.ru
66
' https://github.com/omegastripes/VBA-JSON-parser
@@ -60,9 +60,9 @@ Sub Parse(ByVal sSample As String, vJSON As Variant, sState As String)
6060
bMatch = False
6161
.Pattern = "<\d+(?:[sn])>\:<\d+[codas]>" ' Object property structure
6262
Tokenize "p"
63-
.Pattern = "\{(?:<\d+p>(?:,<\d+p>)*)?\}" ' Object structure
63+
.Pattern = "\{(?:<\d+p>(?:,<\d+p>)*)?,?\}" ' Object structure
6464
Tokenize "o"
65-
.Pattern = "\[(?:<\d+[codas]>(?:,<\d+[codas]>)*)?\]" ' Array structure
65+
.Pattern = "\[(?:<\d+[codas]>(?:,<\d+[codas]>)*)?,?\]" ' Array structure
6666
Tokenize "a"
6767
Loop While bMatch
6868
.Pattern = "^<\d+[oa]>$" ' Top level object structure, unspecified array accepted

0 commit comments

Comments
 (0)