diff --git a/src/template_type.cpp b/src/template_type.cpp index 05f5232..af96fd9 100644 --- a/src/template_type.cpp +++ b/src/template_type.cpp @@ -39,6 +39,10 @@ void template_type::tokenize(const std::string& tmp) { cur_pos = close_pos + close.size(); tokens.push_back({{beg + open_pos, beg + close_pos + close.size()}, open.size(), close.size()}); + if(cur_pos == tmp.size()) { + tokens.push_back({{""}}); + tokens.back().set_eol(true); + } if (*(beg + open_pos + open.size()) == '=' && *(beg + close_pos - 1) == '=') diff --git a/src/token.hpp b/src/token.hpp index 2c86dd4..ef88074 100644 --- a/src/token.hpp +++ b/src/token.hpp @@ -16,6 +16,7 @@ class token { const std::string& name() const { return m_name; }; bool eol() const { return m_eol; } bool ws_only() const { return m_ws_only; } + void set_eol(bool eol) { m_eol = eol; } private: type m_type;