summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/jsonparse/parse.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/jsonparse/parse.go b/internal/jsonparse/parse.go
index d867cbc..06efc8c 100644
--- a/internal/jsonparse/parse.go
+++ b/internal/jsonparse/parse.go
@@ -545,7 +545,11 @@ func (par *Parser) HandleRune(c rune) (RuneType, error) {
case 0x0020, 0x000A, 0x000D, 0x0009:
return RuneTypeSpace, nil
default:
- return RuneTypeEOF, nil
+ if len(par.barriers) > 0 {
+ return RuneTypeEOF, nil
+ } else {
+ return RuneTypeError, fmt.Errorf("invalid character %q after top-level value", c)
+ }
}
}
switch par.stack[len(par.stack)-1] {