diff options
Diffstat (limited to 'src/html_token.hpp')
-rw-r--r-- | src/html_token.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/html_token.hpp b/src/html_token.hpp new file mode 100644 index 0000000..ee385ce --- /dev/null +++ b/src/html_token.hpp @@ -0,0 +1,32 @@ +#ifndef HTML_TOKEN_HPP +#define HTML_TOKEN_HPP + +#include <string> +#include "code_point.h" + +enum HtmlTokenType { + HtmlTokenType_None = 0, + HtmlTokenType_StartTag, + HtmlTokenType_EndTag, + HtmlTokenType_Attribute, + HtmlTokenType_EOF, + HtmlTokenType_Character, + HtmlTokenType_Length +}; + +struct HtmlToken { + HtmlTokenType type; + + // TODO: Performance + char character_token; + std::string tag_name; + + void append_to_tag_name(code_point_t c) { + tag_name += c; + } + + void print(); + void reset(); +}; + +#endif |