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
10#![allow(unexpected_cfgs)]
11// This error is coming from code generated by PHF which we cannot directly fix
12#![allow(clippy::empty_line_after_doc_comments)]
13
14pub use tendril;
15
16#[macro_use]
17extern crate web_atoms;
18
19/// Create a [`SmallCharSet`], with each space-separated number stored in the set.
20///
21/// # Examples
22///
23/// ```
24/// # #[macro_use] extern crate markup5ever;
25/// # fn main() {
26/// let set = small_char_set!(12 54 42);
27/// assert_eq!(set.bits,
28///            0b00000000_01000000_00000100_00000000_00000000_00000000_00010000_00000000);
29/// # }
30/// ```
31///
32/// [`SmallCharSet`]: struct.SmallCharSet.html
33#[macro_export]
34macro_rules! small_char_set ( ($($e:expr)+) => (
35    $ crate ::SmallCharSet {
36        bits: $( (1 << ($e as usize)) )|+
37    }
38));
39
40pub use web_atoms::{
41    local_name, namespace_prefix, namespace_url, ns, LocalName, LocalNameStaticSet, Namespace,
42    NamespaceStaticSet, Prefix, PrefixStaticSet,
43};
44
45pub mod data {
46    pub use web_atoms::C1_REPLACEMENTS;
47    pub use web_atoms::NAMED_ENTITIES;
48}
49#[macro_use]
50pub mod interface;
51pub mod serialize;
52mod util {
53    pub mod buffer_queue;
54    pub mod smallcharset;
55}
56
57pub use interface::{Attribute, ExpandedName, QualName, TokenizerResult};
58pub use util::smallcharset::SmallCharSet;
59pub use util::*;