tools icon indicating copy to clipboard operation
tools copied to clipboard

feat(rome_json_parser): first version of json parser

Open IWANABETHATGUY opened this issue 2 years ago • 2 comments

Summary

  1. Part of #2786
  2. Implementing JSON parser with easy error recovery.
  3. Adding basic errory recover for trailing comma
  4. Adding some valid basic JSON test cases copy from prettier json test case
  5. Adding some invalid trailing comma test cases
  6. Extracting common parser logic into a new crate rome_parse

Test Plan

  1. cargo test
  2. Check if the new generated *.rast is correct.

IWANABETHATGUY avatar Jun 26 '22 06:06 IWANABETHATGUY

Have you tested this parser with any open source JSON test suites? For example: https://github.com/nst/JSONTestSuite

EDIT: I see you included some from Prettier. Are these tests comprehensive?

strager avatar Jun 27 '22 08:06 strager

Have you tested this parser with any open source JSON test suites? For example: https://github.com/nst/JSONTestSuite

Not yet. (only use prettier json test case.) The rome member suggested me to use https://github.com/rome/tools/blob/archived-js/internal/codec-config/json/parser-test262.test.ts instead prettier test case, so I think I would like to use rome classic json test case. Also, thanks for sharing the json test case repo

IWANABETHATGUY avatar Jun 27 '22 08:06 IWANABETHATGUY

This PR is stale because it has been open 14 days with no activity.

github-actions[bot] avatar Sep 13 '22 12:09 github-actions[bot]