aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/tokenize.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/tokenize.rs b/examples/tokenize.rs
new file mode 100644
index 0000000..9a039c3
--- /dev/null
+++ b/examples/tokenize.rs
@@ -0,0 +1,9 @@
+//! Let's you easily try out the tokenizer with e.g.
+//! printf '<h1>Hello world!</h1>' | cargo run --example=tokenize
+use html5gum::{BufReadReader, Tokenizer};
+
+fn main() {
+ for token in Tokenizer::new(BufReadReader::new(std::io::stdin().lock())).flatten() {
+ println!("{:?}", token);
+ }
+}