Re:A Journey building a fast JSON parser and full JSONPath
by tomthe on Thursday October 12, 2023 @04:35AM
(#37854799)
Thank you for thinking more deeply about this than I did!
But I do not see a problem in your first example, only true is the true true (according to my browser and the linked definition on https://www.json.org)
I don't get your other examples, can you explain? I assumed that 1.20.4 is not a valid SEN entry, because it starts with a digit but is not a number.
Re:A Journey building a fast JSON parser and full JSONPath
by kubanczyk on Saturday October 14, 2023 @10:51AM
(#37880898)
My bad, you are right about 1.20.4 (and also my 0e02 example wouldn't be a valid SEN value).
The true/"true" leaves a bad taste in my mouth after yaml, but overall SEN is an improvement :)
Re:A Journey building a fast JSON parser and full JSONPath
by jarym on Thursday October 12, 2023 @04:43AM
(#37854840)
I'm not following:
`
{
array: [string1 string2 "true" true True TRUE yes y]
}
`
Doesn't look like a valid SEN or JSON. The `y` `yes`, `True`, TRUE` aren't valid keywords/variables/consts and `string1` and `string2` look like variable references which aren't something SEN or JSON support. The closest valid thing I can imagine is:
` { array: ["string1" "string2" "true" true "True" "TRUE" "yes" "y"] } `
Re:A Journey building a fast JSON parser and full JSONPath
by mjpa86 on Thursday October 12, 2023 @05:25AM
(#37855051)
aren't they implied strings? If "[a b c]" is an array of 3 strings, "a", "b" and "c", then True is a string "True". That's the problem.
Re:A Journey building a fast JSON parser and full JSONPath
by jarym on Thursday October 12, 2023 @08:12AM
(#37856112)
I must be missing why you think they're implied strings - I don't see that in the spec. What I do see is:
"Strings can also be delimited with a single quote character which allows for a string to be either "abc" or 'abc'."
There's no mention of having a string without a delimeter.
Re:A Journey building a fast JSON parser and full JSONPath
by ReleaseCandidat on Thursday October 12, 2023 @08:24AM
(#37856212)
The example below is this:
> array: [a b c]
Re:A Journey building a fast JSON parser and full JSONPath
by jarym on Thursday October 12, 2023 @01:47PM
(#37860418)
ohhh I see it now, that looks like a recipe for... issues.
My immediate question would be what's the JSON for this SEN I've crafted:
For more fun, there's a single problematic entry here, can you spot it?: Or, level expert, there's exactly one problem here as well: