This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c1c69d
commit b246357
Showing
604 changed files
with
310,992 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
edition = "2021" | ||
name = "rome_js_unicode_table" | ||
version = "0.0.0" | ||
authors = ["Rome Tools"] | ||
license = "MIT" | ||
description = "Unicode table for JavaScript IDs" | ||
repository = "https://github.com/rome/tools" | ||
|
||
[dependencies] | ||
|
||
[dev-dependencies] |
79 changes: 70 additions & 9 deletions
79
crates/rome_js_parser/src/lexer/bytes.rs → crates/rome_js_unicode_table/src/bytes.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use crate::bytes::DISPATCHER; | ||
use crate::tables::derived_property::{ID_Continue, ID_Start}; | ||
|
||
mod bytes; | ||
mod tables; | ||
|
||
pub use crate::bytes::Dispatch; | ||
|
||
/// Tests if `c` is a valid start of an identifier | ||
#[inline] | ||
pub fn is_id_start(c: char) -> bool { | ||
c == '_' || c == '$' || ID_Start(c) | ||
} | ||
|
||
/// Tests if `c` is a valid continuation of an identifier. | ||
#[inline] | ||
pub fn is_id_continue(c: char) -> bool { | ||
c == '$' || c == '\u{200d}' || c == '\u{200c}' || ID_Continue(c) | ||
} | ||
|
||
/// Looks up a byte in the lookup table. | ||
#[inline] | ||
pub fn lookup_byte(byte: u8) -> Dispatch { | ||
// Safety: the lookup table maps all values of u8, so it's impossible for a u8 to be out of bounds | ||
unsafe { *DISPATCHER.get_unchecked(byte as usize) } | ||
} |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
edition = "2021" | ||
name = "rome_json_parser" | ||
version = "0.0.0" | ||
authors = ["Rome Tools"] | ||
license = "MIT" | ||
description = "An extremely fast JSON parser" | ||
repository = "https://github.com/rome/tools" | ||
|
||
[dependencies] | ||
rome_rowan = { path = "../rome_rowan" } | ||
rome_console = { path = "../rome_console" } | ||
rome_diagnostics = { path = "../rome_diagnostics" } | ||
rome_json_syntax = { path = "../rome_json_syntax" } | ||
rome_js_unicode_table = { path = "../rome_js_unicode_table" } | ||
|
||
[dev-dependencies] | ||
tests_macros = { path = "../tests_macros" } | ||
quickcheck = "1.0.3" | ||
quickcheck_macros = "1.0.0" | ||
insta = { version="1.18.2" } | ||
|
Oops, something went wrong.