groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Laverack <ja...@jameslaverack.com>
Subject GROOVY-7979 and Index Overlay JSON parser behaviour
Date Sun, 14 May 2017 20:02:12 GMT
Hi all,

I'm interested in contributing to Groovy development, so I've taken a look
at the bug tracker and taken up GROOVY-7979. Most of this is pretty
straightforward, but I'm having a bit of difficulty with figuring out how
the index overlay parsers (`INDEX_OVERLAY` and `LAX`) should behave.

The ticket seems to imply that like the other parser implementations they
should throw a JsonException when attempting to parse the string "[-]". But
because the index overlay parser doesn't parse the value in the array until
it's called for, simply doing `parser.parseText('[-]')` won't throw an
exception whereas `parser.parseText('[-]')[0]` would. (With the fixes I've
implemented to the number parsing code that fix the other parsers anyway.)

Is it acceptable to have the lax parser behave like this and not throw the
exception until the value is accessed, or should the implementation of
`NumberValue` check for this case when it's created?

Thanks,
James Laverack

Mime
View raw message