mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
Merge pull request #12369 from simon-walton/BugFix
Lexer code has confusion between strings and chars
This commit is contained in:
commit
e8bea3a611
1 changed files with 3 additions and 3 deletions
|
@ -190,7 +190,7 @@ bool JSBaker::handleMultiLineComments(QTextStream& in) {
|
||||||
while (!in.atEnd()) {
|
while (!in.atEnd()) {
|
||||||
in >> character;
|
in >> character;
|
||||||
if (character == '*') {
|
if (character == '*') {
|
||||||
if (in.read(1) == '/') {
|
if (in.read(1) == "/") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ bool JSBaker::isSpecialCharacter(QChar c) {
|
||||||
// If previous character is a special character, maybe don't omit new line (depends on next character as well)
|
// If previous character is a special character, maybe don't omit new line (depends on next character as well)
|
||||||
bool JSBaker::isSpecialCharacterPrevious(QChar c) {
|
bool JSBaker::isSpecialCharacterPrevious(QChar c) {
|
||||||
return (c == '\'' || c == '$' || c == '_' || c == '}' || c == ']' || c == ')' || c == '+' || c == '-'
|
return (c == '\'' || c == '$' || c == '_' || c == '}' || c == ']' || c == ')' || c == '+' || c == '-'
|
||||||
|| c == '"' || c == "'");
|
|| c == '"' || c == '\'');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If next character is a special character, maybe don't omit new line (depends on previous character as well)
|
// If next character is a special character, maybe don't omit new line (depends on previous character as well)
|
||||||
|
@ -243,5 +243,5 @@ bool JSBaker::isSpaceOrTab(QChar c) {
|
||||||
|
|
||||||
// Check If the currentCharacter is " or ' or `
|
// Check If the currentCharacter is " or ' or `
|
||||||
bool JSBaker::isQuote(QChar c) {
|
bool JSBaker::isQuote(QChar c) {
|
||||||
return (c == '"' || c == "'" || c == '`');
|
return (c == '"' || c == '\'' || c == '`');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue