| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2018 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtSCriptTools module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include "qscriptsyntaxhighlighter_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptsyntaxhighlighter_p.h`/ |
| 41 | |
| 42 | #include <algorithm> |
| 43 | |
| 44 | #ifndef QT_NO_SYNTAXHIGHLIGHTER |
| 45 | |
| 46 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 47 | |
| 48 | enum ScriptIdscxx . . $ ScriptIds# { |
| 49 | Commentcxx . . $ Comment. = 1, |
| 50 | Numbercxx . . $ Number., |
| 51 | Stringcxx . . $ String., |
| 52 | Typecxx . . $ Type., |
| 53 | Keywordcxx . . $ Keyword., |
| 54 | PreProcessorcxx . . $ PreProcessor., |
| 55 | Labelcxx . . $ Label. |
| 56 | }; |
| 57 | |
| 58 | #define MAX_KEYWORDcxx . . $ `src/scripttools/debugging/qscriptsyntaxhighlighter.cpp:58:9`! 63 |
| 59 | static const char *const keywordscxx . . $ keywords.[MAX_KEYWORDcxx . . $ `src/scripttools/debugging/qscriptsyntaxhighlighter.cpp:58:9`!] = { |
| 60 | "Infinity", |
| 61 | "NaN", |
| 62 | "abstract", |
| 63 | "boolean", |
| 64 | "break", |
| 65 | "byte", |
| 66 | "case", |
| 67 | "catch", |
| 68 | "char", |
| 69 | "class", |
| 70 | "const", |
| 71 | "constructor", |
| 72 | "continue", |
| 73 | "debugger", |
| 74 | "default", |
| 75 | "delete", |
| 76 | "do", |
| 77 | "double", |
| 78 | "else", |
| 79 | "enum", |
| 80 | "export", |
| 81 | "extends", |
| 82 | "false", |
| 83 | "final", |
| 84 | "finally", |
| 85 | "float", |
| 86 | "for", |
| 87 | "function", |
| 88 | "goto", |
| 89 | "if", |
| 90 | "implements", |
| 91 | "import", |
| 92 | "in", |
| 93 | "instanceof", |
| 94 | "int", |
| 95 | "interface", |
| 96 | "long", |
| 97 | "native", |
| 98 | "new", |
| 99 | "package", |
| 100 | "private", |
| 101 | "protected", |
| 102 | "public", |
| 103 | "return", |
| 104 | "short", |
| 105 | "static", |
| 106 | "super", |
| 107 | "switch", |
| 108 | "synchronized", |
| 109 | "this", |
| 110 | "throw", |
| 111 | "throws", |
| 112 | "transient", |
| 113 | "true", |
| 114 | "try", |
| 115 | "typeof", |
| 116 | "undefined", |
| 117 | "var", |
| 118 | "void", |
| 119 | "volatile", |
| 120 | "while", |
| 121 | "with", // end of array |
| 122 | 0 |
| 123 | }; |
| 124 | |
| 125 | struct KeywordHelpercxx . . $ KeywordHelper# |
| 126 | { |
| 127 | inline KeywordHelpercxx . . $ KeywordHelper#KeywordHelper(3520e46b33348bf6).(const QStringcxx . . $ QString# &word) : needlecxx . . $ KeywordHelper#needle.(word) {} |
| 128 | const QStringcxx . . $ QString# needlecxx . . $ KeywordHelper#needle.; |
| 129 | }; |
| 130 | |
| 131 | static bool operatorcxx . . $ `operator<`(15c12ada10c3749d).<(const KeywordHelpercxx . . $ KeywordHelper# &helper, const char *kw) |
| 132 | { |
| 133 | return helper.needlecxx . . $ KeywordHelper#needle. <cxx . . $ QString#`operator<`(b3b98e09a392cdf9). QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).(kw); |
| 134 | } |
| 135 | |
| 136 | static bool operatorcxx . . $ `operator<`(3e18ada6215f1006).<(const char *kw, const KeywordHelpercxx . . $ KeywordHelper# &helper) |
| 137 | { |
| 138 | return QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).(kw) <cxx . . $ QLatin1String#`operator<`(5f824a95086435ac). helper.needlecxx . . $ KeywordHelper#needle.; |
| 139 | } |
| 140 | |
| 141 | static bool isKeywordcxx . . $ isKeyword(e1defb592416720d).(const QStringcxx . . $ QString# &word) |
| 142 | { |
| 143 | const char * const *start = &keywordscxx . . $ keywords.[0]; |
| 144 | const char * const *end = &keywordscxx . . $ keywords.[MAX_KEYWORDcxx . . $ `src/scripttools/debugging/qscriptsyntaxhighlighter.cpp:58:9`! - 1]; |
| 145 | |
| 146 | const KeywordHelpercxx . . $ KeywordHelper# keywordHelpercxx . . $ KeywordHelper#KeywordHelper(3520e46b33348bf6).(word); |
| 147 | const char * const *kw = stdcxx . . $ std/::lower_boundcxx . . $ std/lower_bound(a92da12e15934614).(start, end, keywordHelper); |
| 148 | |
| 149 | return kw != end && !(keywordHelper <cxx . . $ `operator<`(15c12ada10c3749d). *kw); |
| 150 | } |
| 151 | |
| 152 | QScriptSyntaxHighlightercxx . . $ QScriptSyntaxHighlighter#::QScriptSyntaxHighlightercxx . . $ QScriptSyntaxHighlighter#QScriptSyntaxHighlighter(68d7deb16251beb9).(QTextDocumentcxx . . $ QTextDocument# *document) |
| 153 | : QSyntaxHighlightercxx . . $ QSyntaxHighlighter#QSyntaxHighlighter(68d7deb16251beb9).(document) |
| 154 | { |
| 155 | |
| 156 | m_formats[ScriptNumberFormat].setForeground(Qt::darkBlue); |
| 157 | m_formats[ScriptStringFormat].setForeground(Qt::darkGreen); |
| 158 | m_formats[ScriptTypeFormat].setForeground(Qt::darkMagenta); |
| 159 | m_formats[ScriptKeywordFormat].setForeground(Qt::darkYellow); |
| 160 | m_formats[ScriptPreprocessorFormat].setForeground(Qt::darkBlue); |
| 161 | m_formats[ScriptLabelFormat].setForeground(Qt::darkRed); |
| 162 | m_formats[ScriptCommentFormat].setForeground(Qt::darkGreen); |
| 163 | m_formats[ScriptCommentFormat].setFontItalic(true); |
| 164 | } |
| 165 | |
| 166 | QScriptSyntaxHighlightercxx . . $ QScriptSyntaxHighlighter#::~cxx . . $ QScriptSyntaxHighlighter#`~QScriptSyntaxHighlighter`(ced63f7c635d850d).QScriptSyntaxHighlightercxx . . $ QScriptSyntaxHighlighter#() |
| 167 | { |
| 168 | } |
| 169 | |
| 170 | void QScriptSyntaxHighlightercxx . . $ QScriptSyntaxHighlighter#::highlightBlockcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).(const QStringcxx . . $ QString# &text) |
| 171 | { |
| 172 | |
| 173 | // states |
| 174 | enum Statescxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).States# { StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateCCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentStart2., |
| 175 | StateScriptCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptCommentStart2., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1., |
| 176 | StateCCommentEnd2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd2., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringEndcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringEnd., |
| 177 | StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2Endcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2End., |
| 178 | StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., NumStatescxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).NumStates. }; |
| 179 | |
| 180 | // tokens |
| 181 | enum Tokenscxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).Tokens# { InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha., InputNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputNumber., InputAsterixcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAsterix., InputSlashcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSlash., InputParencxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputParen., |
| 182 | InputSpacecxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSpace., InputHashcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputHash., InputQuotationcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputQuotation., InputApostrophecxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputApostrophe., InputSepcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSep., NumTokenscxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).NumTokens. }; |
| 183 | |
| 184 | static ucharcxx . . $ uchar# table[NumStatescxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).NumStates.][NumTokenscxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).NumTokens.] = { |
| 185 | { StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. }, // StateStandard |
| 186 | { StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber., StateCCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentStart2., StateScriptCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptCommentStart2., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. }, // StateCommentStart1 |
| 187 | { StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment. }, // StateCCommentStart2 |
| 188 | { StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment. }, // ScriptCommentStart2 |
| 189 | { StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment. }, // StateCComment |
| 190 | { StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment., StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment. }, // StateScriptComment |
| 191 | { StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1., StateCCommentEnd2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd2., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment., StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment. }, // StateCCommentEnd1 |
| 192 | { StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. }, // StateCCommentEnd2 |
| 193 | { StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringEndcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringEnd., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString. }, // StateStringStart |
| 194 | { StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringEndcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringEnd., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString., StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString. }, // StateString |
| 195 | { StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. }, // StateStringEnd |
| 196 | { StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2Endcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2End., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2. }, // StateString2Start |
| 197 | { StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2., StateString2Endcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2End., StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2. }, // StateString2 |
| 198 | { StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. }, // StateString2End |
| 199 | { StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber., StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. }, // StateNumber |
| 200 | { StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard., StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor., StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart., StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start., StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. } // StatePreProcessor |
| 201 | }; |
| 202 | |
| 203 | QStringcxx . . $ QString# buffercxx . . $ QString#QString(ced63f7c635d850d).; |
| 204 | buffer.reservecxx . . $ QString#reserve(d4f767463ce0a6b3).(text.lengthcxx . . $ QString#length(455f465bc33b4cdf).()); |
| 205 | |
| 206 | QTextCharFormatcxx . . $ QTextCharFormat# emptyFormatcxx . . $ QTextCharFormat#QTextCharFormat(49f6e7a06ebc5aa8).; |
| 207 | |
| 208 | int state = StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.; |
| 209 | int braceDepth = 0; |
| 210 | const int previousState = previousBlockStatecxx . . $ QSyntaxHighlighter#previousBlockState(455f465bc33b4cdf).(); |
| 211 | if (previousState != -1) { |
| 212 | state = previousState & 0xff; |
| 213 | braceDepth = previousState >> 8; |
| 214 | } |
| 215 | |
| 216 | if (text.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 217 | setCurrentBlockStatecxx . . $ QSyntaxHighlighter#setCurrentBlockState(d4f767463ce0a6b3).(previousState); |
| 218 | #if 0 |
| 219 | TextEditDocumentLayout::clearParentheses(currentBlock()); |
| 220 | #endif |
| 221 | return; |
| 222 | } |
| 223 | #if 0 |
| 224 | Parentheses parentheses; |
| 225 | parentheses.reserve(20); // assume wizard level ;-) |
| 226 | #endif |
| 227 | int input = -1; |
| 228 | int i = 0; |
| 229 | bool lastWasBackSlash = false; |
| 230 | bool makeLastStandard = false; |
| 231 | |
| 232 | static const QStringcxx . . $ QString# alphabeth = QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); |
| 233 | static const QStringcxx . . $ QString# mathChars = QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("xXeE"); |
| 234 | static const QStringcxx . . $ QString# numbers = QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("0123456789"); |
| 235 | bool questionMark = false; |
| 236 | QCharcxx . . $ QChar# lastCharcxx . . $ QChar#QChar(ced63f7c635d850d).; |
| 237 | |
| 238 | int firstNonSpace = -1; |
| 239 | |
| 240 | for (;;) { |
| 241 | const QCharcxx . . $ QChar# c = text.atcxx . . $ QString#at(13af7ae5a875439e).(i); |
| 242 | |
| 243 | if (lastWasBackSlash) { |
| 244 | input = InputSepcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSep.; |
| 245 | } else { |
| 246 | switch (c.toLatin1cxx . . $ QChar#toLatin1(a33b425be6aff8f0).()) { |
| 247 | case '*': |
| 248 | input = InputAsterixcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAsterix.; |
| 249 | break; |
| 250 | case '/': |
| 251 | input = InputSlashcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSlash.; |
| 252 | break; |
| 253 | case '{': |
| 254 | braceDepth++; |
| 255 | // fall through |
| 256 | case '(': case '[': |
| 257 | input = InputParencxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputParen.; |
| 258 | switch (state) { |
| 259 | case StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.: |
| 260 | case StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber.: |
| 261 | case StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor.: |
| 262 | case StateCCommentEnd2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd2.: |
| 263 | case StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1.: |
| 264 | case StateString2Endcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2End.: |
| 265 | case StateStringEndcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringEnd.: |
| 266 | // parentheses.push_back(Parenthesis(Parenthesis::Opened, c, i)); |
| 267 | break; |
| 268 | default: |
| 269 | break; |
| 270 | } |
| 271 | break; |
| 272 | case '}': |
| 273 | if (--braceDepth < 0) |
| 274 | braceDepth = 0; |
| 275 | // fall through |
| 276 | case ')': case ']': |
| 277 | input = InputParencxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputParen.; |
| 278 | switch (state) { |
| 279 | case StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.: |
| 280 | case StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber.: |
| 281 | case StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor.: |
| 282 | case StateCCommentEnd2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd2.: |
| 283 | case StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1.: |
| 284 | case StateString2Endcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2End.: |
| 285 | case StateStringEndcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringEnd.: |
| 286 | // parentheses.push_back(Parenthesis(Parenthesis::Closed, c, i)); |
| 287 | break; |
| 288 | default: |
| 289 | break; |
| 290 | } |
| 291 | break; |
| 292 | case '#': |
| 293 | input = InputHashcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputHash.; |
| 294 | break; |
| 295 | case '"': |
| 296 | input = InputQuotationcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputQuotation.; |
| 297 | break; |
| 298 | case '\'': |
| 299 | input = InputApostrophecxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputApostrophe.; |
| 300 | break; |
| 301 | case ' ': |
| 302 | input = InputSpacecxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSpace.; |
| 303 | break; |
| 304 | case '1': case '2': case '3': case '4': case '5': |
| 305 | case '6': case '7': case '8': case '9': case '0': |
| 306 | if (alphabeth.containscxx . . $ QString#contains(7cf081d1b6a1defd).(lastChar) |
| 307 | && (!mathChars.containscxx . . $ QString#contains(7cf081d1b6a1defd).(lastChar) || !numbers.containscxx . . $ QString#contains(7cf081d1b6a1defd).(text.atcxx . . $ QString#at(13af7ae5a875439e).(i - 1))) |
| 308 | ) { |
| 309 | input = InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha.; |
| 310 | } else { |
| 311 | if (input == InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha. && numbers.containscxx . . $ QString#contains(7cf081d1b6a1defd).(lastChar)) |
| 312 | input = InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha.; |
| 313 | else |
| 314 | input = InputNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputNumber.; |
| 315 | } |
| 316 | break; |
| 317 | case ':': { |
| 318 | input = InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha.; |
| 319 | const QCharcxx . . $ QChar# colon = QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(':'); |
| 320 | if (state == StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard. && !questionMark && lastChar !=cxx . . $ `operator!=`(a468b2f18a3afe8). colon) { |
| 321 | const QCharcxx . . $ QChar# nextChar = i < text.lengthcxx . . $ QString#length(455f465bc33b4cdf).() - 1 ? text.atcxx . . $ QString#at(13af7ae5a875439e).(i + 1) : QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(' '); |
| 322 | if (nextChar !=cxx . . $ `operator!=`(a468b2f18a3afe8). colon) |
| 323 | for (int j = 0; j < i; ++j) { |
| 324 | if (formatcxx . . $ QSyntaxHighlighter#format(1efc934825e6558c).(j) ==cxx . . $ `operator==`(abb235a625a921b3). emptyFormat ) |
| 325 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(j, 1, m_formats[ScriptLabelFormat]); |
| 326 | } |
| 327 | } |
| 328 | } break; |
| 329 | default: |
| 330 | if (!questionMark && c ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('?')) |
| 331 | questionMark = true; |
| 332 | if (c.isLettercxx . . $ QChar#isLetter(3482b152b9333168).() || c ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('_')) |
| 333 | input = InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha.; |
| 334 | else |
| 335 | input = InputSepcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSep.; |
| 336 | break; |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | if (input != InputSpacecxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputSpace.) { |
| 341 | if (firstNonSpace < 0) |
| 342 | firstNonSpace = i; |
| 343 | } |
| 344 | |
| 345 | lastWasBackSlash = !lastWasBackSlash && c ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('\\'); |
| 346 | |
| 347 | if (input == InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha.) |
| 348 | buffer +=cxx . . $ QString#`operator+=`(3a2ffbdf8ecc25e2). c; |
| 349 | |
| 350 | state = table[state][input]; |
| 351 | |
| 352 | switch (state) { |
| 353 | case StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.: { |
| 354 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, emptyFormat); |
| 355 | if (makeLastStandard) |
| 356 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 357 | makeLastStandard = false; |
| 358 | if (input != InputAlphacxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).InputAlpha.) { |
| 359 | highlightWordcxx . . $ QScriptSyntaxHighlighter#highlightWord(4b11a7293b4ed91c).(i, buffer); |
| 360 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 361 | } |
| 362 | } break; |
| 363 | case StateCommentStart1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCommentStart1.: |
| 364 | if (makeLastStandard) |
| 365 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 366 | makeLastStandard = true; |
| 367 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 368 | break; |
| 369 | case StateCCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentStart2.: |
| 370 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 2, m_formats[ScriptCommentFormat]); |
| 371 | makeLastStandard = false; |
| 372 | // parentheses.push_back(Parenthesis(Parenthesis::Opened, QLatin1Char('/'), i-1)); |
| 373 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 374 | break; |
| 375 | case StateScriptCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptCommentStart2.: |
| 376 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 2, m_formats[ScriptCommentFormat]); |
| 377 | makeLastStandard = false; |
| 378 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 379 | break; |
| 380 | case StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment.: |
| 381 | if (makeLastStandard) |
| 382 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 383 | makeLastStandard = false; |
| 384 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptCommentFormat]); |
| 385 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 386 | break; |
| 387 | case StateScriptCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateScriptComment.: |
| 388 | if (makeLastStandard) |
| 389 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 390 | makeLastStandard = false; |
| 391 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptCommentFormat]); |
| 392 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 393 | break; |
| 394 | case StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1.: |
| 395 | if (makeLastStandard) |
| 396 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 397 | makeLastStandard = false; |
| 398 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptCommentFormat]); |
| 399 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 400 | break; |
| 401 | case StateCCommentEnd2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd2.: |
| 402 | if (makeLastStandard) |
| 403 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 404 | makeLastStandard = false; |
| 405 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptCommentFormat]); |
| 406 | // parentheses.push_back(Parenthesis(Parenthesis::Closed, QLatin1Char('/'), i)); |
| 407 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 408 | break; |
| 409 | case StateStringStartcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringStart.: |
| 410 | if (makeLastStandard) |
| 411 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 412 | makeLastStandard = false; |
| 413 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, emptyFormat); |
| 414 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 415 | break; |
| 416 | case StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString.: |
| 417 | if (makeLastStandard) |
| 418 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 419 | makeLastStandard = false; |
| 420 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptStringFormat]); |
| 421 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 422 | break; |
| 423 | case StateStringEndcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStringEnd.: |
| 424 | if (makeLastStandard) |
| 425 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 426 | makeLastStandard = false; |
| 427 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, emptyFormat); |
| 428 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 429 | break; |
| 430 | case StateString2Startcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2Start.: |
| 431 | if (makeLastStandard) |
| 432 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 433 | makeLastStandard = false; |
| 434 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, emptyFormat); |
| 435 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 436 | break; |
| 437 | case StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2.: |
| 438 | if (makeLastStandard) |
| 439 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 440 | makeLastStandard = false; |
| 441 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptStringFormat]); |
| 442 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 443 | break; |
| 444 | case StateString2Endcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2End.: |
| 445 | if (makeLastStandard) |
| 446 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 447 | makeLastStandard = false; |
| 448 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, emptyFormat); |
| 449 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 450 | break; |
| 451 | case StateNumbercxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateNumber.: |
| 452 | if (makeLastStandard) |
| 453 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 454 | makeLastStandard = false; |
| 455 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptNumberFormat]); |
| 456 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 457 | break; |
| 458 | case StatePreProcessorcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StatePreProcessor.: |
| 459 | if (makeLastStandard) |
| 460 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i - 1, 1, emptyFormat); |
| 461 | makeLastStandard = false; |
| 462 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(i, 1, m_formats[ScriptPreprocessorFormat]); |
| 463 | buffer =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 464 | break; |
| 465 | } |
| 466 | |
| 467 | lastChar =cxx . . $ QChar#`operator=`(4d430369cfc1b27). c; |
| 468 | i++; |
| 469 | if (i >= text.lengthcxx . . $ QString#length(455f465bc33b4cdf).()) { |
| 470 | #if 0 |
| 471 | if (TextBlockUserData *userData = TextEditDocumentLayout::testUserData(currentBlock())) { |
| 472 | userData->setHasClosingCollapse(false); |
| 473 | userData->setCollapseMode(TextBlockUserData::NoCollapse); |
| 474 | } |
| 475 | int collapse = Parenthesis::collapseAtPos(parentheses); |
| 476 | if (collapse >= 0) { |
| 477 | if (collapse == firstNonSpace) |
| 478 | TextEditDocumentLayout::userData(currentBlock())->setCollapseMode(TextBlockUserData::CollapseThis); |
| 479 | else |
| 480 | TextEditDocumentLayout::userData(currentBlock())->setCollapseMode(TextBlockUserData::CollapseAfter); |
| 481 | } |
| 482 | if (Parenthesis::hasClosingCollapse(parentheses)) { |
| 483 | TextEditDocumentLayout::userData(currentBlock())->setHasClosingCollapse(true); |
| 484 | } |
| 485 | #endif |
| 486 | |
| 487 | break; |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | highlightWordcxx . . $ QScriptSyntaxHighlighter#highlightWord(4b11a7293b4ed91c).(text.lengthcxx . . $ QString#length(455f465bc33b4cdf).(), buffer); |
| 492 | |
| 493 | switch (state) { |
| 494 | case StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment.: |
| 495 | case StateCCommentEnd1cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentEnd1.: |
| 496 | case StateCCommentStart2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCCommentStart2.: |
| 497 | state = StateCCommentcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateCComment.; |
| 498 | break; |
| 499 | case StateStringcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString.: |
| 500 | // quotes cannot span multiple lines, so if somebody starts |
| 501 | // typing a quoted string we don't need to look for the ending |
| 502 | // quote in another line (or highlight until the end of the |
| 503 | // document) and therefore slow down editing. |
| 504 | state = StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.; |
| 505 | break; |
| 506 | case StateString2cxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateString2.: |
| 507 | state = StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.; |
| 508 | break; |
| 509 | default: |
| 510 | state = StateStandardcxx . . $ QScriptSyntaxHighlighter#highlightBlock(3520e46b33348bf6).StateStandard.; |
| 511 | break; |
| 512 | } |
| 513 | |
| 514 | #if 0 |
| 515 | TextEditDocumentLayout::setParentheses(currentBlock(), parentheses); |
| 516 | #endif |
| 517 | |
| 518 | setCurrentBlockStatecxx . . $ QSyntaxHighlighter#setCurrentBlockState(d4f767463ce0a6b3).((braceDepth << 8) | state); |
| 519 | } |
| 520 | |
| 521 | void QScriptSyntaxHighlightercxx . . $ QScriptSyntaxHighlighter#::highlightWordcxx . . $ QScriptSyntaxHighlighter#highlightWord(4b11a7293b4ed91c).(int currentPos, const QStringcxx . . $ QString# &buffer) |
| 522 | { |
| 523 | if (buffer.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 524 | return; |
| 525 | |
| 526 | // try to highlight Qt 'identifiers' like QObject and Q_PROPERTY |
| 527 | // but don't highlight words like 'Query' |
| 528 | if (buffer.lengthcxx . . $ QString#length(455f465bc33b4cdf).() > 1 |
| 529 | && buffer.atcxx . . $ QString#at(13af7ae5a875439e).(0) ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('Q') |
| 530 | && (buffer.atcxx . . $ QString#at(13af7ae5a875439e).(1).isUppercxx . . $ QChar#isUpper(3482b152b9333168).() |
| 531 | || buffer.atcxx . . $ QString#at(13af7ae5a875439e).(1) ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('_') |
| 532 | || buffer.atcxx . . $ QString#at(13af7ae5a875439e).(1) ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('t'))) { |
| 533 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(currentPos - buffer.lengthcxx . . $ QString#length(455f465bc33b4cdf).(), buffer.lengthcxx . . $ QString#length(455f465bc33b4cdf).(), m_formats[ScriptTypeFormat]); |
| 534 | } else { |
| 535 | if (isKeywordcxx . . $ isKeyword(e1defb592416720d).(buffer)) |
| 536 | setFormatcxx . . $ QSyntaxHighlighter#setFormat(c9121f7a6060c957).(currentPos - buffer.lengthcxx . . $ QString#length(455f465bc33b4cdf).(), buffer.lengthcxx . . $ QString#length(455f465bc33b4cdf).(), m_formats[ScriptKeywordFormat]); |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |
| 541 | |
| 542 | #endif // QT_NO_SYNTAXHIGHLIGHTER |
| 543 |