congo-parser-generator icon indicating copy to clipboard operation
congo-parser-generator copied to clipboard

jsonc needs to support trailing commas

Open 0c3d7r4 opened this issue 2 years ago • 2 comments

^ .

0c3d7r4 avatar Sep 05 '23 11:09 0c3d7r4

Fixing this will probably need to avoid including the JSON.ccc file in JSONC.ccc, but rather copying its contents and changing the grammar to allow trailing commas. Also, JSONC allows bare identifiers as keys, which would need to be catered for - that's not mentioned in the title of this issue.

See this JSONC playground.

vsajip avatar Sep 21 '23 16:09 vsajip

Well, generally speaking, these JSON and JSONC grammars are pretty trivial examples that are provided potentially as a starting point, though they can be useful as-is too, depending on your case. But if you want something slightly different, it should not be very hard to modify the grammar to do what you need.

revusky avatar Sep 21 '23 17:09 revusky

This is over two years old, so I'm closing it. Hopefully the OP finally understood that the JSON grammars are just examples that you can use as a starting point.

revusky avatar Oct 30 '25 19:10 revusky