markup5ever/
lib.rs

1// Copyright 2014-2017 The html5ever Project Developers. See the
2// COPYRIGHT file at the top-level directory of this distribution.
3//
4// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7// option. This file may not be copied, modified, or distributed
8// except according to those terms.
9
10pub use tendril;
11
12#[macro_use]
13extern crate web_atoms;
14
15/// Create a [`SmallCharSet`], with each space-separated number stored in the set.
16///
17/// # Examples
18///
19/// ```
20/// # #[macro_use] extern crate markup5ever;
21/// # fn main() {
22/// let set = small_char_set!(12 54 42);
23/// assert_eq!(set.bits,
24///            0b00000000_01000000_00000100_00000000_00000000_00000000_00010000_00000000);
25/// # }
26/// ```
27///
28/// [`SmallCharSet`]: struct.SmallCharSet.html
29#[macro_export]
30macro_rules! small_char_set ( ($($e:expr)+) => (
31    $ crate ::SmallCharSet {
32        bits: $( (1 << ($e as usize)) )|+
33    }
34));
35
36pub use web_atoms::{
37    local_name, namespace_prefix, namespace_url, ns, LocalName, LocalNameStaticSet, Namespace,
38    NamespaceStaticSet, Prefix, PrefixStaticSet,
39};
40
41pub mod data {
42    pub use web_atoms::C1_REPLACEMENTS;
43    pub use web_atoms::NAMED_ENTITIES;
44}
45#[macro_use]
46pub mod interface;
47pub mod serialize;
48mod util {
49    pub mod buffer_queue;
50    pub mod smallcharset;
51}
52
53pub use interface::{Attribute, ExpandedName, QualName, TokenizerResult};
54pub use util::smallcharset::SmallCharSet;
55pub use util::*;