google / google/json5format

Consider using nom or another parser-support library?

Open
#5 1 comment 1 reaction 0 assignees View on GitHub
enhancement long term
Dominant language
Rust
Stars
118
Forks
23
PR merge metrics
No merged PRs in 30d

Description

The current [regex parsing strategy] looks like it works quite well and is very well tested, but I have concerns about the efficiency and maintainability of regex-based parsers. This (really awesome!) tool seems likely to be with us for a long haul so I'd encourage the authors to look into using a crate like [nom] or [pest] for handling the actual parsing. nom has a fairly concise example of using it to [parse json] which I imagine could be adapted to support json5 and the additional parsing done there.

[regex parsing strategy]: https://github.com/google/json5format/blob/1ad0bcbb33f0bc6138c1cd7b1772e91e71bf962e/src/parser.rs#L30
[nom]: https://docs.rs/nom
[pest]: https://docs.rs/pest
[parse json]: https://github.com/Geal/nom/blob/master/examples/json.rs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.