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

@@ -117,7 +117,7 @@ int PythonHighlighter::highlightLine(const QString &text, int initialState)
FormatToken tk;
bool hasOnlyWhitespace = true;
while ((tk = scanner.read()).format() != Format_EndOfBlock) {
while (!(tk = scanner.read()).isEndOfBlock()) {
Format format = tk.format();
if (format == Format_Keyword) {
QString value = scanner.value(tk);
@@ -141,7 +141,7 @@ int PythonHighlighter::highlightLine(const QString &text, int initialState)
void PythonHighlighter::highlightImport(Scanner &scanner)
{
FormatToken tk;
while ((tk = scanner.read()).format() != Format_EndOfBlock) {
while (!(tk = scanner.read()).isEndOfBlock()) {
Format format = tk.format();
if (tk.format() == Format_Identifier)
format = Format_ImportedModule;