summaryrefslogtreecommitdiff
path: root/src/html_token.hpp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2023-04-23 20:23:54 -0400
committermattkae <mattkae@protonmail.com>2023-04-23 20:23:54 -0400
commit4058f9b1704322f8185136c2558c2ab96a4d835c (patch)
treef764007c2cdd0f41372d66dcf02ccde26509b839 /src/html_token.hpp
Initial commit with a working parser
Diffstat (limited to 'src/html_token.hpp')
-rw-r--r--src/html_token.hpp32
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