Skip to content
Snippets Groups Projects
Commit 2c21e1c7 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'F17393-fe-report-editor-qfq-syntax-highlighting' into 'develop'

Multiline string interruption without closing quote in some non-SQL contexts...

See merge request !684
parents f651bfb8 d98ed369
No related branches found
No related tags found
2 merge requests!691New version v24.3.0,!684Multiline string interruption without closing quote in some non-SQL contexts...
Pipeline #12087 passed
......@@ -492,13 +492,25 @@
},
token: function(stream, state) {
var isTokenString = state.tokenize != tokenComment &&
state.tokenize != tokenQfqVariable && state.tokenize != tokenBase;
if (stream.sol()) {
state.lineTokens = [];
if (!state.sql.isActive && isTokenString) { // interrupt multiline strings in some cases
var line = stream.string;
var isQfqLevelKeyword = new RegExp(regExp.qfqLevelKeyword(state.lvlNesting > 0)).test(line);
var isQfqBaseKeyword = new RegExp(regExp.qfqBaseKeyword).test(line) && state.lvlNesting === 0;
var isQfqOpeningLevel = new RegExp(regExp.qfqOpeningLevel(state.sep)).test(line);
var isQfqClosingLevel = new RegExp(regExp.qfqClosingLevel(state.sep)).test(line);
if (isQfqLevelKeyword || isQfqBaseKeyword || isQfqOpeningLevel || isQfqClosingLevel) {
state.tokenize = tokenBase;
}
}
}
var eatingSpaces = stream.eatSpace(), lineToken;
if (!eatingSpaces) {
// Let's tokenize!
// LET'S TOKENIZE !!!
lineToken = state.tokenize(stream, state);
if (lineToken) state.lineTokens.push(lineToken);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment