You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In JSON either action is valid for duplicate keys. Currently we process every duplicate key with a potential performance penalty. A better alternative would be to generate code like:
var
onceBanana =falseeat(p, tkCurlyLe)
while p.tok != tkCurlyRi:
if p.tok != tkString:
raiseParseErr(p, "string literal as key")
case p.a
of"banana":
discardgetTok(p)
eat(p, tkColon)
ifnot onceBanana:
onceBanana =trueinitFromJson(dst.banana, p)
else:
whendefined(emiDuplicateKey):
skipJson(p)
else: raiseParseErr(p, "duplicate object field")
else:
raiseParseErr(p, "valid object field")
if p.tok != tkComma:
breakdiscardgetTok(p)
eat(p, tkCurlyRi)
...and leave it up to the user to specify whether it should error or skip them.
The text was updated successfully, but these errors were encountered:
planetis-m
changed the title
Skip (or error, or use) on duplicate keys
Skip (or error) on duplicate keys
Apr 25, 2021
In JSON either action is valid for duplicate keys. Currently we process every duplicate key with a potential performance penalty. A better alternative would be to generate code like:
...and leave it up to the user to specify whether it should error or skip them.
The text was updated successfully, but these errors were encountered: