Standalone tags should not require a newline to follow them.

This commit is contained in:
Daniel Sipka 2015-05-04 12:57:01 +02:00
parent 65d6395e71
commit 82c34735c4
2 changed files with 5 additions and 0 deletions

View file

@ -39,6 +39,10 @@ void template_type::tokenize(const std::string& tmp) {
cur_pos = close_pos + close.size(); cur_pos = close_pos + close.size();
tokens.push_back({{beg + open_pos, beg + close_pos + close.size()}, tokens.push_back({{beg + open_pos, beg + close_pos + close.size()},
open.size(), 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()) == '=' && if (*(beg + open_pos + open.size()) == '=' &&
*(beg + close_pos - 1) == '=') *(beg + close_pos - 1) == '=')

View file

@ -16,6 +16,7 @@ class token {
const std::string& name() const { return m_name; }; const std::string& name() const { return m_name; };
bool eol() const { return m_eol; } bool eol() const { return m_eol; }
bool ws_only() const { return m_ws_only; } bool ws_only() const { return m_ws_only; }
void set_eol(bool eol) { m_eol = eol; }
private: private:
type m_type; type m_type;