detect attempts to compare between labels (only with constants is possible)

This commit is contained in:
zadam
2020-07-20 23:27:30 +02:00
parent 4e5ddaf7d1
commit f03e4bc7d7
4 changed files with 47 additions and 4 deletions

View File

@@ -159,6 +159,12 @@ function getExpression(tokens, parsingContext, level = 0) {
let operator = tokens[i + 1].token;
const comparedValue = tokens[i + 2].token;
if (!tokens[i + 2].inQuotes
&& (comparedValue.startsWith('#') || comparedValue.startsWith('~') || comparedValue === 'note')) {
parsingContext.addError(`Error near token "${comparedValue}", it's possible to compare with constant only.`);
return;
}
parsingContext.highlightedTokens.push(comparedValue);
if (parsingContext.fuzzyAttributeSearch && operator === '=') {