summaryrefslogtreecommitdiff
path: root/internal/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/parse.go')
-rw-r--r--internal/parse.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/internal/parse.go b/internal/parse.go
index 121857b..b11aae6 100644
--- a/internal/parse.go
+++ b/internal/parse.go
@@ -264,7 +264,6 @@ type Parser struct {
//
// [ array: waiting for item to start or ']'
// a array: reading item / waiting for ',' or ']'
- // ] array: waiting for item to start
//
// Within each element type, the stack item is replaced, not pushed.
//
@@ -308,7 +307,7 @@ type Parser struct {
// a" ["
// a" ["x
// a ["x"
- // ] ["x",
+ // a? ["x",
// a" ["x","
// a" ["x","y
// a ["x","y"
@@ -513,21 +512,12 @@ func (par *Parser) HandleRune(c rune) (RuneType, error) {
par.pushState(runeTypeAny)
return par.HandleRune(c)
}
- case RuneTypeArrayEnd: // waiting for item
- switch c {
- case 0x0020, 0x000A, 0x000D, 0x0009:
- return RuneTypeSpace, nil
- default:
- par.replaceState(RuneTypeArrayComma)
- par.pushState(runeTypeAny)
- return par.HandleRune(c)
- }
case RuneTypeArrayComma: // waiting for ',' or ']'
switch c {
case 0x0020, 0x000A, 0x000D, 0x0009:
return RuneTypeSpace, nil
case ',':
- par.replaceState(RuneTypeArrayEnd)
+ par.pushState(runeTypeAny)
return RuneTypeArrayComma, nil
case ']':
par.popState()