aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1d6e2d1..95647ff 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,8 +18,31 @@ pub use tendril;
#[macro_use]
mod macros;
+/// Create a [`SmallCharSet`], with each space-separated number stored in the set.
+///
+/// # Examples
+///
+/// ```
+/// # #[macro_use] extern crate markup5ever;
+/// # fn main() {
+/// let set = small_char_set!(12 54 42);
+/// assert_eq!(set.bits,
+/// 0b00000000_01000000_00000100_00000000_00000000_00000000_00010000_00000000);
+/// # }
+/// ```
+///
+/// [`SmallCharSet`]: struct.SmallCharSet.html
+#[macro_export]
+macro_rules! small_char_set ( ($($e:expr)+) => (
+ $ crate ::util::smallcharset::SmallCharSet {
+ bits: $( (1 << ($e as usize)) )|+
+ }
+));
+
mod util {
pub mod str;
+ pub mod buffer_queue;
+ pub mod smallcharset;
}
pub mod tokenizer;