Skip to content

Allowing comments #107

@devlaam

Description

@devlaam

Hi Erik,

Very nice piece of work indeed!

Recently i changed from play to your parser for my home brew json operator lib. Because I have quite a lot if "comments" in my json i forked your lib, and wanted to extend it so it can spit out comments or at least skip them. Due to the clarity of your code this is rather easy to do.

I have a question about one design decision you made though. You differentiate between parseStringSimple and parseStringComplex, the only difference (from a performance point of view at least) seems to be the inspection of \\. The price you pay is rescanning the string when it turns out not be simple after all. Was this the sole ground for have two separate methods here, or am I missing something? Would one extra if statement in the scan make a big difference and not outweigh the disposal of work done?

If not, i would integrate the methods scan regularly until the first \\ and then, if this happens, switch to the collection into the CharBuilder. But, maybe you have already tested this and turned out to be a dead end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions