-
Notifications
You must be signed in to change notification settings - Fork 656
Conversation
✅ Deploy Preview for docs-rometools canceled.
|
|
||
#[derive(Debug, Diagnostic, Clone)] | ||
#[diagnostic(category = "parse", severity = Error)] | ||
pub struct ParseDiagnostic { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diagnostic is a duplicate for now. I plan to move it into a rome_parser
crate once I start refactoring the parser.
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
97ef5cd
to
d4eda07
Compare
!bench_parser |
5bc9e50
to
b246357
Compare
b246357
to
3317255
Compare
3317255
to
eab845d
Compare
!bench_parser |
Comparing feat(rome_json_parser): JSON Lexer Snapshot #5 to median since last deploy of rome.tools.
1 page testedHomeBrowser previews
Most significant changes27 other significant changes: JS Parse & Compile on Chrome Desktop, Largest Contentful Paint on Motorola Moto G Power, 3G connection, First Contentful Paint on Motorola Moto G Power, 3G connection, Total Blocking Time on Chrome Desktop, Total CSS Size in Bytes on Chrome Desktop, Total CSS Size in Bytes on iPhone, 4G LTE, Total CSS Size in Bytes on Motorola Moto G Power, 3G connection, Time to Interactive on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection, Time to Interactive on Chrome Desktop, Number of Requests on Motorola Moto G Power, 3G connection, Number of Requests on Chrome Desktop, Number of Requests on iPhone, 4G LTE, First Contentful Paint on Chrome Desktop, Largest Contentful Paint on Chrome Desktop, Speed Index on Motorola Moto G Power, 3G connection, Time to Interactive on iPhone, 4G LTE, Largest Contentful Paint on iPhone, 4G LTE, First Contentful Paint on iPhone, 4G LTE, Speed Index on Chrome Desktop, Total HTML Size in Bytes on Chrome Desktop, Total HTML Size in Bytes on iPhone, 4G LTE, Total HTML Size in Bytes on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Chrome Desktop Calibre: Site dashboard | View this PR | Edit settings | View documentation |
06b4d1e
to
ca7bd61
Compare
ca7bd61
to
83d8b95
Compare
Parser Benchmark Results
|
span: Option<TextRange>, | ||
/// Reference to a file where the issue occurred | ||
#[location(resource)] | ||
file_id: FileId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a refactor I have in mind for the JS parser and formatter too but we may try it out with the new JSON lexer first: since the parsing (and by extension lexing) only works on a single file, the parser itself doesn't really need to know the FileId
of the file it's parsing and may simply return a list of diagnostics without a resource, to be injected at a higher level (probably in the Workspace) using the .with_file_path()
diagnostic combinator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. Ideally, we should move away from FileId
gradually :)
This will make things way easier in the long run! (personal experience)
version = "0.0.0" | ||
authors = ["Rome Tools"] | ||
license = "MIT" | ||
description = "An extremely fast JSON parser" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: blazing fast
, or turbo fast
or nitro fast
🤣
Please don't take this comment seriously!! 😄
* upstream/main: (73 commits) fix(semantic_analyzers): style/noShoutyConstants does not recognize multiple uses of a constant. (rome#3789) feat(rome_js_analyze): useDefaultSwitchClauseLast (rome#3791) chore: run rustfmt and typo fix (rome#3840) feat(rome_js_analyze): use exhaustive deps support properties (rome#3581) website(docs): Fix text formatting (rome#3828) feat(rome_js_analyze): `noVoidTypeReturn` (rome#3806) feat(rome_cli): expose the `--verbose` flag to the CLI (rome#3812) fix(rome_diagnostics): allow diagnostic locations to be created without a resource (rome#3834) feat(rome_js_analyze): add noExtraNonNullAssertion rule (rome#3797) fix(rome_lsp): lsp friendly catch unwind (rome#3740) feat(rome_js_semantic): model improvements (rome#3825) feat(rome_json_parser): JSON Lexer (rome#3809) feat(rome_js_analyze): implement `noDistractingElements` (rome#3820) fix(rome_js_formatter): shothanded named import line break with default import (rome#3826) feat(rome_js_analyze): `noConstructorReturn` (rome#3805) feat(website): change enabledNurseryRules to All/Recommended select (rome#3810) feat(rome_js_analyze): noSetterReturn feat(rome_js_analyze): noConstructorReturn feat(rome_analyze): suppress rule via code actions (rome#3572) feat(rome_js_analyze): `noVar` (rome#3765) ...
Summary
Part of #2351
This is the first step toward our own JSON parser. The PR implements a basic JSON lexer with basic error recovery.
Non-standard features implemented by the lexer for better error recovery:
This PR introduces a new
rome_js_unicode_table
crate that is shared between the json and JS parser and allows for fast unicode resolution.Test Plan
I wrote a handful of manual tests and copied the JSONTestSuite