rusteerio 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +73 -0
- package/Cargo.lock +1051 -0
- package/Cargo.toml +36 -0
- package/LICENSE +21 -0
- package/README.md +252 -2
- package/RELEASING.md +138 -0
- package/THIRD_PARTY_NOTICES.md +7443 -0
- package/build.rs +3 -0
- package/dist/chunk-DKULX6VO.mjs +3185 -0
- package/dist/chunk-DKULX6VO.mjs.map +1 -0
- package/dist/chunk-OHPGEY3E.mjs +32 -0
- package/dist/chunk-OHPGEY3E.mjs.map +1 -0
- package/dist/index.cjs +3230 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +113 -0
- package/dist/index.d.ts +113 -0
- package/dist/index.mjs +38 -0
- package/dist/index.mjs.map +1 -0
- package/dist/slim.cjs +2441 -0
- package/dist/slim.cjs.map +1 -0
- package/dist/slim.d.mts +11 -0
- package/dist/slim.d.ts +11 -0
- package/dist/slim.mjs +19 -0
- package/dist/slim.mjs.map +1 -0
- package/dist/types-BP6TpxE5.d.mts +532 -0
- package/dist/types-BP6TpxE5.d.ts +532 -0
- package/dist/utils.cjs +61 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.mts +13 -0
- package/dist/utils.d.ts +13 -0
- package/dist/utils.mjs +17 -0
- package/dist/utils.mjs.map +1 -0
- package/native/src/arena.rs +1781 -0
- package/native/src/attributes.rs +923 -0
- package/native/src/codec.rs +172 -0
- package/native/src/diagnostics.rs +1249 -0
- package/native/src/extraction.rs +226 -0
- package/native/src/gc.rs +166 -0
- package/native/src/hook_sink.rs +727 -0
- package/native/src/hook_stream.rs +513 -0
- package/native/src/lib.rs +2095 -0
- package/native/src/location.rs +392 -0
- package/native/src/runtime.rs +189 -0
- package/native/src/selector.rs +1287 -0
- package/native/src/sink.rs +261 -0
- package/native/src/stream.rs +334 -0
- package/native/src/tokenizer.rs +355 -0
- package/native/src/tracker.rs +232 -0
- package/native/vendor/README.md +25 -0
- package/native/vendor/html5ever-0.35.0/.cargo_vcs_info.json +6 -0
- package/native/vendor/html5ever-0.35.0/Cargo.lock +828 -0
- package/native/vendor/html5ever-0.35.0/Cargo.toml +85 -0
- package/native/vendor/html5ever-0.35.0/LICENSE-APACHE +201 -0
- package/native/vendor/html5ever-0.35.0/LICENSE-MIT +25 -0
- package/native/vendor/html5ever-0.35.0/README.md +60 -0
- package/native/vendor/html5ever-0.35.0/benches/html5ever.rs +86 -0
- package/native/vendor/html5ever-0.35.0/data/bench/lipsum-zh.html +19 -0
- package/native/vendor/html5ever-0.35.0/data/bench/lipsum.html +40 -0
- package/native/vendor/html5ever-0.35.0/data/bench/medium-fragment.html +24 -0
- package/native/vendor/html5ever-0.35.0/data/bench/small-fragment.html +7 -0
- package/native/vendor/html5ever-0.35.0/data/bench/strong.html +1 -0
- package/native/vendor/html5ever-0.35.0/data/bench/tiny-fragment.html +1 -0
- package/native/vendor/html5ever-0.35.0/examples/arena.rs +356 -0
- package/native/vendor/html5ever-0.35.0/examples/capi/tokenize.c +74 -0
- package/native/vendor/html5ever-0.35.0/examples/noop-tokenize.rs +47 -0
- package/native/vendor/html5ever-0.35.0/examples/noop-tree-builder.rs +132 -0
- package/native/vendor/html5ever-0.35.0/examples/print-tree-actions.rs +185 -0
- package/native/vendor/html5ever-0.35.0/examples/tokenize.rs +111 -0
- package/native/vendor/html5ever-0.35.0/src/driver.rs +148 -0
- package/native/vendor/html5ever-0.35.0/src/lib.rs +30 -0
- package/native/vendor/html5ever-0.35.0/src/macros.rs +34 -0
- package/native/vendor/html5ever-0.35.0/src/serialize/mod.rs +255 -0
- package/native/vendor/html5ever-0.35.0/src/tokenizer/char_ref/mod.rs +451 -0
- package/native/vendor/html5ever-0.35.0/src/tokenizer/interface.rs +99 -0
- package/native/vendor/html5ever-0.35.0/src/tokenizer/mod.rs +2305 -0
- package/native/vendor/html5ever-0.35.0/src/tokenizer/states.rs +97 -0
- package/native/vendor/html5ever-0.35.0/src/tree_builder/data.rs +170 -0
- package/native/vendor/html5ever-0.35.0/src/tree_builder/mod.rs +1848 -0
- package/native/vendor/html5ever-0.35.0/src/tree_builder/rules.rs +1494 -0
- package/native/vendor/html5ever-0.35.0/src/tree_builder/tag_sets.rs +114 -0
- package/native/vendor/html5ever-0.35.0/src/tree_builder/types.rs +91 -0
- package/native/vendor/html5ever-0.35.0/src/util/str.rs +52 -0
- package/native/vendor/html5gum-0.8.4/Cargo.lock +1006 -0
- package/native/vendor/html5gum-0.8.4/Cargo.toml +109 -0
- package/native/vendor/html5gum-0.8.4/LICENSE +19 -0
- package/native/vendor/html5gum-0.8.4/README.md +110 -0
- package/native/vendor/html5gum-0.8.4/benches/files/0050.html +2131 -0
- package/native/vendor/html5gum-0.8.4/benches/files/6D30.html +1004 -0
- package/native/vendor/html5gum-0.8.4/benches/files.rs +32 -0
- package/native/vendor/html5gum-0.8.4/benches/patterns.rs +31 -0
- package/native/vendor/html5gum-0.8.4/src/arrayvec.rs +29 -0
- package/native/vendor/html5gum-0.8.4/src/char_validator.rs +134 -0
- package/native/vendor/html5gum-0.8.4/src/emitters/callback.rs +676 -0
- package/native/vendor/html5gum-0.8.4/src/emitters/default.rs +207 -0
- package/native/vendor/html5gum-0.8.4/src/emitters/emitter.rs +344 -0
- package/native/vendor/html5gum-0.8.4/src/emitters/html5ever.rs +306 -0
- package/native/vendor/html5gum-0.8.4/src/emitters/mod.rs +25 -0
- package/native/vendor/html5gum-0.8.4/src/entities.rs +3342 -0
- package/native/vendor/html5gum-0.8.4/src/error.rs +96 -0
- package/native/vendor/html5gum-0.8.4/src/htmlstring.rs +130 -0
- package/native/vendor/html5gum-0.8.4/src/lib.rs +66 -0
- package/native/vendor/html5gum-0.8.4/src/machine.rs +2136 -0
- package/native/vendor/html5gum-0.8.4/src/machine_helper.rs +277 -0
- package/native/vendor/html5gum-0.8.4/src/read_helper.rs +244 -0
- package/native/vendor/html5gum-0.8.4/src/reader.rs +440 -0
- package/native/vendor/html5gum-0.8.4/src/span.rs +98 -0
- package/native/vendor/html5gum-0.8.4/src/state.rs +16 -0
- package/native/vendor/html5gum-0.8.4/src/testutils.rs +71 -0
- package/native/vendor/html5gum-0.8.4/src/tokenizer.rs +189 -0
- package/native/vendor/html5gum-0.8.4/src/utils.rs +88 -0
- package/native/vendor/markup5ever-0.35.0/.cargo_vcs_info.json +6 -0
- package/native/vendor/markup5ever-0.35.0/Cargo.toml +45 -0
- package/native/vendor/markup5ever-0.35.0/LICENSE-APACHE +201 -0
- package/native/vendor/markup5ever-0.35.0/LICENSE-MIT +25 -0
- package/native/vendor/markup5ever-0.35.0/interface/mod.rs +422 -0
- package/native/vendor/markup5ever-0.35.0/interface/tree_builder.rs +280 -0
- package/native/vendor/markup5ever-0.35.0/lib.rs +59 -0
- package/native/vendor/markup5ever-0.35.0/serialize.rs +77 -0
- package/native/vendor/markup5ever-0.35.0/util/buffer_queue.rs +333 -0
- package/native/vendor/markup5ever-0.35.0/util/smallcharset.rs +88 -0
- package/package.json +137 -4
- package/rusteerio.darwin-arm64.node +0 -0
- package/rusteerio.darwin-x64.node +0 -0
- package/rusteerio.linux-arm64-gnu.node +0 -0
- package/rusteerio.linux-arm64-musl.node +0 -0
- package/rusteerio.linux-x64-gnu.node +0 -0
- package/rusteerio.linux-x64-musl.node +0 -0
- package/rusteerio.win32-arm64-msvc.node +0 -0
- package/rusteerio.win32-x64-msvc.node +0 -0
- package/scripts/check-native.mjs +15 -0
- package/scripts/check-release.mjs +235 -0
- package/scripts/fix-declarations.mjs +27 -0
- package/scripts/generate-notices.mjs +176 -0
- package/scripts/notices/README.md +13 -0
- package/scripts/notices/cheerio-MIT.txt +21 -0
- package/scripts/notices/html5ever-AUTHORS.txt +20 -0
- package/scripts/notices/html5ever-COPYRIGHT.txt +8 -0
- package/scripts/notices/html5ever-LICENSE-APACHE.txt +201 -0
- package/scripts/notices/html5ever-LICENSE-MIT.txt +25 -0
- package/scripts/notices/napi-rs-MIT.txt +43 -0
- package/scripts/notices/neon-MIT.txt +19 -0
- package/scripts/notices/runtime-01c266bced4a434da005.txt +3 -0
- package/scripts/notices/runtime-0a54e647fe54104658b5.txt +14 -0
- package/scripts/notices/runtime-0b74dfa0bcee5c420c6b.txt +25 -0
- package/scripts/notices/runtime-0d542e0c8804e39aa7f3.txt +177 -0
- package/scripts/notices/runtime-0f96a83840e146e43c0e.txt +21 -0
- package/scripts/notices/runtime-123a331b5dbf04c30097.txt +25 -0
- package/scripts/notices/runtime-172020dbfd5b53a226df.txt +34 -0
- package/scripts/notices/runtime-209fbbe0ad52d9235e37.txt +26 -0
- package/scripts/notices/runtime-23f18e03dc49df91622f.txt +23 -0
- package/scripts/notices/runtime-268872b9816f90fd8e85.txt +220 -0
- package/scripts/notices/runtime-35242e7a83f69875e6ed.txt +176 -0
- package/scripts/notices/runtime-378f5840b258e2779c39.txt +25 -0
- package/scripts/notices/runtime-4108245a1f2df9d4e94d.txt +25 -0
- package/scripts/notices/runtime-4455bf75a91154108304.txt +21 -0
- package/scripts/notices/runtime-553fffcd9b1cb158bc3e.txt +13 -0
- package/scripts/notices/runtime-62c7a1e35f56406896d7.txt +176 -0
- package/scripts/notices/runtime-6485b8ed310d3f0340bf.txt +25 -0
- package/scripts/notices/runtime-69fef7b0f322a6555415.txt +201 -0
- package/scripts/notices/runtime-6df43f6f4b5d4587f3d8.txt +187 -0
- package/scripts/notices/runtime-799e9ca9d179295ef372.txt +24 -0
- package/scripts/notices/runtime-7b63ecd5f1902af1b637.txt +25 -0
- package/scripts/notices/runtime-7bc7d5de2a0b793d4e1a.txt +21 -0
- package/scripts/notices/runtime-7e12e5df4bae12cb2158.txt +24 -0
- package/scripts/notices/runtime-861399f8c21c042b1105.txt +12 -0
- package/scripts/notices/runtime-8ada45cd9f843acf64e4.txt +201 -0
- package/scripts/notices/runtime-90eb64f0279b0d9432ac.txt +12 -0
- package/scripts/notices/runtime-a60eea817514531668d7.txt +201 -0
- package/scripts/notices/runtime-a7c936ff1ed8fa340172.txt +25 -0
- package/scripts/notices/runtime-ab6eec6caf0fa5775e41.txt +275 -0
- package/scripts/notices/runtime-b1181a40b2a7b25cf66f.txt +19 -0
- package/scripts/notices/runtime-b71bd43a069ca0641a9e.txt +25 -0
- package/scripts/notices/runtime-c16f8dcf1a368b83be78.txt +201 -0
- package/scripts/notices/runtime-c2cfccb812fe482101a8.txt +21 -0
- package/scripts/notices/runtime-e99d88d232bf57d70f0f.txt +25 -0
- package/scripts/notices/runtime-f32fb3b417a194167cfa.txt +9 -0
- package/scripts/notices/runtime-f5062c9a188d81dfe66b.txt +39 -0
- package/scripts/notices/runtime-f9070a832833fa7488fd.txt +4 -0
- package/scripts/notices/runtime-fab3dd6bdab226f1c086.txt +373 -0
- package/scripts/notices/runtime-fba3318d0c600380177e.txt +62 -0
- package/scripts/notices/runtime-ff8f68cb076caf8cefe7.txt +25 -0
- package/scripts/notices/runtime-ff92bed461f50338dd70.txt +74 -0
- package/scripts/notices/runtime.json +1632 -0
- package/scripts/notices/sources.json +555 -0
- package/scripts/notices/xray-MIT.txt +21 -0
- package/src/attributes.ts +271 -0
- package/src/codec.ts +74 -0
- package/src/dom.ts +87 -0
- package/src/extract-plan.ts +97 -0
- package/src/extract.ts +130 -0
- package/src/hooks.ts +220 -0
- package/src/index.ts +223 -0
- package/src/io.ts +491 -0
- package/src/native.ts +135 -0
- package/src/nodes.ts +290 -0
- package/src/parse.ts +53 -0
- package/src/parser-types.ts +157 -0
- package/src/router.ts +327 -0
- package/src/selection.ts +566 -0
- package/src/slim.ts +12 -0
- package/src/transport.ts +104 -0
- package/src/types.ts +186 -0
- package/src/utils.ts +29 -0
- package/src/workers.ts +21 -0
- package/tsconfig.json +15 -0
- package/tsup.config.ts +16 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#![allow(non_snake_case)]
|
|
2
|
+
use iai::{black_box, main};
|
|
3
|
+
|
|
4
|
+
use html5gum::Tokenizer;
|
|
5
|
+
|
|
6
|
+
// files taken from https://github.com/AndreasMadsen/htmlparser-benchmark/tree/master/files
|
|
7
|
+
const F0050: &str = include_str!("files/0050.html");
|
|
8
|
+
const F6D30: &str = include_str!("files/6D30.html");
|
|
9
|
+
|
|
10
|
+
fn file(file: &str, i: usize) {
|
|
11
|
+
let s: String = black_box((0..i).map(|_| file).collect());
|
|
12
|
+
for Ok(_) in Tokenizer::new(&s) {}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
macro_rules! pattern_tests {
|
|
16
|
+
($(($name:ident, $file:expr, $repeat:expr), )*) => {
|
|
17
|
+
$(
|
|
18
|
+
fn $name() {
|
|
19
|
+
file($file, $repeat)
|
|
20
|
+
}
|
|
21
|
+
)*
|
|
22
|
+
|
|
23
|
+
main!($($name),*);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
pattern_tests![
|
|
28
|
+
(file_0050_10, F0050, 10),
|
|
29
|
+
(file_0050_100, F0050, 100),
|
|
30
|
+
(file_6D30_10, F6D30, 10),
|
|
31
|
+
(file_6D30_100, F6D30, 100),
|
|
32
|
+
];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
use iai::{black_box, main};
|
|
2
|
+
|
|
3
|
+
use html5gum::Tokenizer;
|
|
4
|
+
|
|
5
|
+
fn pattern(pattern: &str, i: usize) {
|
|
6
|
+
let s: String = black_box((0..i).map(|_| pattern).collect());
|
|
7
|
+
for Ok(_) in Tokenizer::new(&s) {}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
macro_rules! pattern_tests {
|
|
11
|
+
($(($name:ident, $pattern:expr, $repeat:expr), )*) => {
|
|
12
|
+
$(
|
|
13
|
+
fn $name() {
|
|
14
|
+
pattern($pattern, $repeat)
|
|
15
|
+
}
|
|
16
|
+
)*
|
|
17
|
+
|
|
18
|
+
main!($($name),*);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
pattern_tests![
|
|
23
|
+
(data_state_10, "a", 10),
|
|
24
|
+
(data_state_10000, "a", 10000),
|
|
25
|
+
(tagopen_10, "<a>", 10),
|
|
26
|
+
(tagopen_10000, "<a>", 10000),
|
|
27
|
+
(tagopenclose_10, "<a></a>", 10),
|
|
28
|
+
(tagopenclose_10000, "<a></a>", 10000),
|
|
29
|
+
(comment_10, "<!-- -->", 10),
|
|
30
|
+
(comment_10000, "<!-- -->", 10000),
|
|
31
|
+
];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// This is basically like the arrayvec crate, except crappier, only the subset I need and
|
|
2
|
+
/// therefore without unsafe Rust.
|
|
3
|
+
#[derive(Debug)]
|
|
4
|
+
pub(crate) struct ArrayVec<T: Copy, const CAP: usize> {
|
|
5
|
+
content: [T; CAP],
|
|
6
|
+
len: usize,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl<T: Copy, const CAP: usize> ArrayVec<T, CAP> {
|
|
10
|
+
pub(crate) fn new(filler_item: T) -> Self {
|
|
11
|
+
// filler_item is there to avoid usage of MaybeUninit, and can literally be anything at
|
|
12
|
+
// all.
|
|
13
|
+
ArrayVec {
|
|
14
|
+
content: [filler_item; CAP],
|
|
15
|
+
len: 0,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub(crate) fn push(&mut self, item: T) {
|
|
20
|
+
self.content[self.len] = item;
|
|
21
|
+
self.len += 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
pub(crate) fn drain(&mut self) -> &[T] {
|
|
25
|
+
let rv = &self.content[..self.len];
|
|
26
|
+
self.len = 0;
|
|
27
|
+
rv
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
use crate::arrayvec::ArrayVec;
|
|
2
|
+
use crate::{Emitter, Error};
|
|
3
|
+
|
|
4
|
+
#[derive(Debug)]
|
|
5
|
+
pub(crate) struct CharValidator {
|
|
6
|
+
last_4_bytes: u32,
|
|
7
|
+
character_error: ArrayVec<Error, 3>,
|
|
8
|
+
codec_escape: bool,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
impl Default for CharValidator {
|
|
12
|
+
fn default() -> Self {
|
|
13
|
+
CharValidator {
|
|
14
|
+
last_4_bytes: 0,
|
|
15
|
+
character_error: ArrayVec::new(Error::EofInTag),
|
|
16
|
+
codec_escape: false,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
impl CharValidator {
|
|
22
|
+
pub(crate) fn reset(&mut self) {
|
|
23
|
+
self.last_4_bytes = 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#[inline]
|
|
27
|
+
pub(crate) fn validate_bytes<E: Emitter>(&mut self, emitter: &mut E, next_bytes: &[u8]) {
|
|
28
|
+
if !emitter.should_emit_errors() {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for &x in next_bytes {
|
|
33
|
+
self.validate_byte(emitter, x);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#[inline]
|
|
38
|
+
pub(crate) fn validate_byte<E: Emitter>(&mut self, emitter: &mut E, next_byte: u8) {
|
|
39
|
+
if !emitter.should_emit_errors() {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if next_byte < 128 {
|
|
44
|
+
// start of character (ascii)
|
|
45
|
+
self.last_4_bytes = 0;
|
|
46
|
+
self.flush_character_error(emitter);
|
|
47
|
+
self.validate_last_4_bytes(emitter, u32::from(next_byte));
|
|
48
|
+
} else if next_byte >= 192 {
|
|
49
|
+
// start of character (non-ascii)
|
|
50
|
+
self.last_4_bytes = u32::from(next_byte);
|
|
51
|
+
self.flush_character_error(emitter);
|
|
52
|
+
} else {
|
|
53
|
+
self.last_4_bytes <<= 8;
|
|
54
|
+
self.last_4_bytes |= u32::from(next_byte);
|
|
55
|
+
self.validate_last_4_bytes(emitter, self.last_4_bytes);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
pub(crate) fn flush_character_error<E: Emitter>(&mut self, emitter: &mut E) {
|
|
60
|
+
if !emitter.should_emit_errors() {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
for e in self.character_error.drain() {
|
|
65
|
+
emitter.emit_error(*e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
pub(crate) fn set_character_error<E: Emitter>(&mut self, emitter: &mut E, error: Error) {
|
|
70
|
+
if !emitter.should_emit_errors() {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if self.last_4_bytes == 0 {
|
|
75
|
+
emitter.emit_error(error);
|
|
76
|
+
} else {
|
|
77
|
+
self.character_error.push(error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#[inline]
|
|
82
|
+
fn validate_last_4_bytes<E: Emitter>(&mut self, emitter: &mut E, last_4_bytes: u32) {
|
|
83
|
+
if emitter.rusteerio_codec() {
|
|
84
|
+
let encoded = last_4_bytes.to_be_bytes();
|
|
85
|
+
if encoded[1] == 0xee && encoded[2] & 0xc0 == 0x80 && encoded[3] & 0xc0 == 0x80 {
|
|
86
|
+
let scalar = (((encoded[1] & 15) as u32) << 12)
|
|
87
|
+
| (((encoded[2] & 63) as u32) << 6)
|
|
88
|
+
| (encoded[3] & 63) as u32;
|
|
89
|
+
if (0xe000..=0xe800).contains(&scalar) {
|
|
90
|
+
if self.codec_escape {
|
|
91
|
+
self.codec_escape = false;
|
|
92
|
+
} else if scalar == 0xe800 {
|
|
93
|
+
self.codec_escape = true;
|
|
94
|
+
} else {
|
|
95
|
+
emitter.emit_error(Error::SurrogateInInputStream);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
self.codec_escape = false;
|
|
99
|
+
}
|
|
100
|
+
} else if last_4_bytes < 128 {
|
|
101
|
+
self.codec_escape = false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// generated with Python 3:
|
|
105
|
+
// ' | '.join(map(hex, sorted([int.from_bytes(chr(x).encode("utf8"), 'big') for x in nonchars])))
|
|
106
|
+
match last_4_bytes {
|
|
107
|
+
0x00ef_b790 | 0x00ef_b791 | 0x00ef_b792 | 0x00ef_b793 | 0x00ef_b794 | 0x00ef_b795
|
|
108
|
+
| 0x00ef_b796 | 0x00ef_b797 | 0x00ef_b798 | 0x00ef_b799 | 0x00ef_b79a | 0x00ef_b79b
|
|
109
|
+
| 0x00ef_b79c | 0x00ef_b79d | 0x00ef_b79e | 0x00ef_b79f | 0x00ef_b7a0 | 0x00ef_b7a1
|
|
110
|
+
| 0x00ef_b7a2 | 0x00ef_b7a3 | 0x00ef_b7a4 | 0x00ef_b7a5 | 0x00ef_b7a6 | 0x00ef_b7a7
|
|
111
|
+
| 0x00ef_b7a8 | 0x00ef_b7a9 | 0x00ef_b7aa | 0x00ef_b7ab | 0x00ef_b7ac | 0x00ef_b7ad
|
|
112
|
+
| 0x00ef_b7ae | 0x00ef_b7af | 0x00ef_bfbe | 0x00ef_bfbf | 0xf09f_bfbe | 0xf09f_bfbf
|
|
113
|
+
| 0xf0af_bfbe | 0xf0af_bfbf | 0xf0bf_bfbe | 0xf0bf_bfbf | 0xf18f_bfbe | 0xf18f_bfbf
|
|
114
|
+
| 0xf19f_bfbe | 0xf19f_bfbf | 0xf1af_bfbe | 0xf1af_bfbf | 0xf1bf_bfbe | 0xf1bf_bfbf
|
|
115
|
+
| 0xf28f_bfbe | 0xf28f_bfbf | 0xf29f_bfbe | 0xf29f_bfbf | 0xf2af_bfbe | 0xf2af_bfbf
|
|
116
|
+
| 0xf2bf_bfbe | 0xf2bf_bfbf | 0xf38f_bfbe | 0xf38f_bfbf | 0xf39f_bfbe | 0xf39f_bfbf
|
|
117
|
+
| 0xf3af_bfbe | 0xf3af_bfbf | 0xf3bf_bfbe | 0xf3bf_bfbf | 0xf48f_bfbe | 0xf48f_bfbf => {
|
|
118
|
+
emitter.emit_error(Error::NoncharacterInInputStream);
|
|
119
|
+
self.flush_character_error(emitter);
|
|
120
|
+
}
|
|
121
|
+
0x1 | 0x2 | 0x3 | 0x4 | 0x5 | 0x6 | 0x7 | 0x8 | 0xb | 0xd | 0xe | 0xf | 0x10 | 0x11
|
|
122
|
+
| 0x12 | 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1a | 0x1b | 0x1c | 0x1d
|
|
123
|
+
| 0x1e | 0x1f | 0x7f | 0xc280 | 0xc281 | 0xc282 | 0xc283 | 0xc284 | 0xc285 | 0xc286
|
|
124
|
+
| 0xc287 | 0xc288 | 0xc289 | 0xc28a | 0xc28b | 0xc28c | 0xc28d | 0xc28e | 0xc28f
|
|
125
|
+
| 0xc290 | 0xc291 | 0xc292 | 0xc293 | 0xc294 | 0xc295 | 0xc296 | 0xc297 | 0xc298
|
|
126
|
+
| 0xc299 | 0xc29a | 0xc29b | 0xc29c | 0xc29d | 0xc29e | 0xc29f => {
|
|
127
|
+
emitter.emit_error(Error::ControlCharacterInInputStream);
|
|
128
|
+
self.flush_character_error(emitter);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
_ => (),
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|