Changeset View
Changeset View
Standalone View
Standalone View
src/backends/julia/juliahighlighter.cpp
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Line(s) | 100 | while (pos < text.length()) { | |||
---|---|---|---|---|---|
158 | } else { // There is nothing to highlight | 158 | } else { // There is nothing to highlight | ||
159 | break; | 159 | break; | ||
160 | } | 160 | } | ||
161 | } | 161 | } | ||
162 | 162 | | |||
163 | setCurrentBlockState(state); | 163 | setCurrentBlockState(state); | ||
164 | } | 164 | } | ||
165 | 165 | | |||
166 | void JuliaHighlighter::updateHighlight() | 166 | void JuliaHighlighter::addUserVariable(const QStringList& variables) | ||
167 | { | 167 | { | ||
168 | // Remove rules for outdated variables and functions | 168 | addVariables(variables); | ||
169 | for (const auto &var : JuliaKeywords::instance()->removedVariables()) { | | |||
170 | removeRule(var); | | |||
171 | } | 169 | } | ||
172 | for (const auto &func : JuliaKeywords::instance()->removedFunctions()) { | 170 | | ||
173 | removeRule(func); | 171 | void JuliaHighlighter::removeUserVariable(const QStringList& variables) | ||
172 | { | ||||
173 | removeRules(variables); | ||||
174 | } | 174 | } | ||
175 | 175 | | |||
176 | // Add actual variables and function | 176 | void JuliaHighlighter::addUserFunctions(const QStringList functions) | ||
177 | addVariables(JuliaKeywords::instance()->variables()); | 177 | { | ||
178 | addFunctions(JuliaKeywords::instance()->functions()); | 178 | addFunctions(functions); | ||
179 | rehighlight(); | 179 | } | ||
180 | | ||||
181 | void JuliaHighlighter::removeUserFunctions(const QStringList functions) | ||||
182 | { | ||||
183 | removeRules(functions); | ||||
180 | } | 184 | } | ||
181 | 185 | | |||
182 | QString JuliaHighlighter::nonSeparatingCharacters() const | 186 | QString JuliaHighlighter::nonSeparatingCharacters() const | ||
183 | { | 187 | { | ||
184 | return QLatin1String("[\\w¡-ﻼ!]"); | 188 | return QLatin1String("[\\w¡-ﻼ!]"); | ||
185 | } | 189 | } |