Crates.io | xtoken |
lib.rs | xtoken |
version | 0.1.1 |
source | src |
created_at | 2023-07-13 21:16:01.913073 |
updated_at | 2023-07-13 21:28:32.667213 |
description | Iterator based no_std XML Tokenizer using memchr |
homepage | |
repository | https://github.com/Xiphoseer/xtoken |
max_upload_size | |
id | 915644 |
size | 12,033 |
Iterator
based no_std
XML Tokenizer using memchr
.
use xtoken::{Token, Tokenizer};
let tokens = Tokenizer::new(b"<x>Hello World!</x>").collect::<Vec<_>>();
assert_eq!(&tokens, &[
Token::Element(b"<x>"),
Token::Span(b"Hello World!"),
Token::ElementEnd(b"</x>"),
]);
let tokens = Tokenizer::new(b"<!DOCTYPE xml>").collect::<Vec<_>>();
assert_eq!(&tokens, &[
Token::Decl(b"<!DOCTYPE xml>")
]);