Get rid of special "EndOfBlock" format in python highlighter

Change-Id: Ie02d3ae02b2453b33a3c779307f6f44348e2d0cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Eike Ziller
2017-05-05 20:41:43 +02:00
parent fca108c35d
commit ecbe001f2e
3 changed files with 9 additions and 8 deletions

View File

@@ -42,8 +42,7 @@ enum Format {
Format_Whitespace,
Format_ImportedModule,
Format_FormatsAmount,
Format_EndOfBlock
Format_FormatsAmount
};
class FormatToken
@@ -55,15 +54,17 @@ public:
: m_format(format), m_position(position), m_length(length)
{}
bool isEndOfBlock() { return m_position == -1; }
Format format() const { return m_format; }
int begin() const { return m_position; }
int end() const { return m_position + m_length; }
int length() const { return m_length; }
private:
Format m_format;
int m_position;
int m_length;
Format m_format = Format_FormatsAmount;
int m_position = -1;
int m_length = -1;
};
} // namespace Internal