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 //! Tokenizer states.
11 //!
12 //! This is public for use by the tokenizer tests.  Other library
13 //! users should not have to care about this.
14 
15 pub use self::AttrValueKind::*;
16 pub use self::DoctypeKind::*;
17 pub use self::XmlState::*;
18 
19 #[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)]
20 #[doc(hidden)]
21 pub enum DoctypeKind {
22     Public,
23     System,
24 }
25 
26 #[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)]
27 #[doc(hidden)]
28 pub enum XmlState {
29     Data,
30     TagState,
31     EndTagState,
32     EndTagName,
33     EndTagNameAfter,
34     Pi,
35     PiTarget,
36     PiTargetAfter,
37     PiData,
38     PiAfter,
39     MarkupDecl,
40     CommentStart,
41     CommentStartDash,
42     Comment,
43     CommentLessThan,
44     CommentLessThanBang,
45     CommentLessThanBangDash,
46     CommentLessThanBangDashDash,
47     CommentEnd,
48     CommentEndDash,
49     CommentEndBang,
50     Cdata,
51     CdataBracket,
52     CdataEnd,
53     TagName,
54     TagEmpty,
55     TagAttrNameBefore,
56     TagAttrName,
57     TagAttrNameAfter,
58     TagAttrValueBefore,
59     TagAttrValue(AttrValueKind),
60     Doctype,
61     BeforeDoctypeName,
62     DoctypeName,
63     AfterDoctypeName,
64     AfterDoctypeKeyword(DoctypeKind),
65     BeforeDoctypeIdentifier(DoctypeKind),
66     DoctypeIdentifierDoubleQuoted(DoctypeKind),
67     DoctypeIdentifierSingleQuoted(DoctypeKind),
68     AfterDoctypeIdentifier(DoctypeKind),
69     BetweenDoctypePublicAndSystemIdentifiers,
70     BogusDoctype,
71     BogusComment,
72     Quiescent,
73 }
74 
75 #[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)]
76 #[doc(hidden)]
77 pub enum AttrValueKind {
78     Unquoted,
79     SingleQuoted,
80     DoubleQuoted,
81 }
82