aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/css/css_tokeniser.hxx
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-02-17 21:16:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-02-17 21:16:45 +0000
commit668b6c3f8fab7c38dc29a501808024556fe09e34 (patch)
tree5c40d72fb1fd2c74d13e084f3cc47acae7e04310 /src/libserver/css/css_tokeniser.hxx
parent66f078e7f124c357eae417c01837e25761701128 (diff)
downloadrspamd-668b6c3f8fab7c38dc29a501808024556fe09e34.tar.gz
rspamd-668b6c3f8fab7c38dc29a501808024556fe09e34.zip
[Project] Css: Add some logical skeleton for declarations parser
Diffstat (limited to 'src/libserver/css/css_tokeniser.hxx')
-rw-r--r--src/libserver/css/css_tokeniser.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libserver/css/css_tokeniser.hxx b/src/libserver/css/css_tokeniser.hxx
index f1e9d05fc..e3ba47437 100644
--- a/src/libserver/css/css_tokeniser.hxx
+++ b/src/libserver/css/css_tokeniser.hxx
@@ -23,6 +23,7 @@
#include <utility>
#include <variant>
#include <list>
+#include <functional>
#include "mem_pool.h"
namespace rspamd::css {
@@ -101,6 +102,15 @@ struct css_parser_token {
auto debug_token_str() -> std::string;
};
+static auto css_parser_eof_token(void) -> const css_parser_token & {
+ static css_parser_token eof_tok {
+ css_parser_token::token_type::eof_token,
+ css_parser_token_placeholder()
+ };
+
+ return eof_tok;
+}
+
/* Ensure that parser tokens are simple enough */
/*
* compiler must implement P0602 "variant and optional should propagate copy/move triviality"
@@ -129,6 +139,8 @@ private:
auto consume_ident() -> struct css_parser_token;
};
+using tokeniser_gen_functor = std::function<const css_parser_token &(void)>;
+
}