diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2026-03-02 16:27:17 +0100 |
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2026-03-02 18:37:57 +0100 |
| commit | f09e816aee0513031656734cc3cded9827e0b22b (patch) | |
| tree | 06edab862eceb829dd235c1f39265f26b15ed386 /oryxc/src/unicode | |
| parent | 048a4e588c01f65c94d7a6d93c555ca11e0230ae (diff) | |
Significantly improve lexer error reporting
Diffstat (limited to 'oryxc/src/unicode')
| -rw-r--r-- | oryxc/src/unicode/default_ignorable_code_point.rs | 363 | ||||
| -rw-r--r-- | oryxc/src/unicode/mod.rs | 2 |
2 files changed, 0 insertions, 365 deletions
diff --git a/oryxc/src/unicode/default_ignorable_code_point.rs b/oryxc/src/unicode/default_ignorable_code_point.rs deleted file mode 100644 index b900a3b..0000000 --- a/oryxc/src/unicode/default_ignorable_code_point.rs +++ /dev/null @@ -1,363 +0,0 @@ -/* Autogenerated – DO NOT EDIT */ - -static DEFAULT_IGNORABLE_CODE_POINT_L1: [u16; 544] = [ - 0, 1, 2, 3, 4, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 7, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1,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 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -]; -static DEFAULT_IGNORABLE_CODE_POINT_L2: [u64; 320] = [ - 0, - 0, - 35184372088832, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 32768, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 268435456, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 6442450944, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 13510798882111488, - 0, - 63488, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 136339441907712, - 281470681743360, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 68719476736, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 65535, - 0, - 0, - 9223372036854775808, - 0, - 0, - 4294967296, - 143833713099145216, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 64424509440, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 574208952489738240, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, -]; -#[inline] -pub fn default_ignorable_code_point_p(c: char) -> bool { - let cp = c as usize; - let blki = - unsafe { *DEFAULT_IGNORABLE_CODE_POINT_L1.get_unchecked(cp >> 11) } - as usize; - let in_blk_offset_p = cp & 0x7FF; - let wordi = (blki * 32) + (in_blk_offset_p >> 6); - let biti = in_blk_offset_p & 0x3F; - unsafe { - return (*DEFAULT_IGNORABLE_CODE_POINT_L2.get_unchecked(wordi) - & (1 << biti)) - != 0; - } -} diff --git a/oryxc/src/unicode/mod.rs b/oryxc/src/unicode/mod.rs index 2fbdcb3..e4a719e 100644 --- a/oryxc/src/unicode/mod.rs +++ b/oryxc/src/unicode/mod.rs @@ -1,10 +1,8 @@ -pub mod default_ignorable_code_point; pub mod line_terminator; pub mod pattern_white_space; pub mod xid_continue; pub mod xid_start; -pub use default_ignorable_code_point::default_ignorable_code_point_p; pub use line_terminator::line_terminator_p; pub use pattern_white_space::pattern_white_space_p; pub use xid_continue::xid_continue_p; |