Skip to content

Latest commit

 

History

6 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

[WIP] JSONPatcher

Patch JSON / JSONC.

Background

When JSON / JSONC is parsed and re-encoded, some "trivial" information will be lost, such as whitespaces and comments.

Normally, this is not a problem for JSON, but for JSONC (or JSON5), it is a bad experience for users to find that comments are removed.

There are two approaches for preserving these "trivial" things when JSONC is modified programmatically:

  1. Build a parser that deserializes the "trivial" things into structures, and then serializes them back into JSONC.
  2. Generate the final JSONC content from the original JSONC content and the modified JSON content.

The first approach requires the developers to modify their structures by adding fields to store these "trivial" data. Therefore, this module implements the second approach.

Goals

The goal of this module is not to "efficiently" parse JSONC, but to make it easier for developers to switch from JSON to JSONC.

Current status

  • Scanner
  • Parser
  • Patcher
  • Formatter

关于

[WIP] Patch JSON / JSONC

Resources

Stars

0 stars

关注者

0 watching

复刻s

发布

Sponsor this project

贡献者

Languages