Merge pull request #6504 from laurentdong/ExpressionBracket

Missed one character previous of closure bracket
This commit is contained in:
Theo Arends 2019-09-28 10:18:02 +02:00 committed by GitHub
commit 55ab9639e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1031,7 +1031,7 @@ bool findNextObjectValue(char * &pointer, float &value)
} else if (*pointer == '(') { //It is a sub expression bracketed with () } else if (*pointer == '(') { //It is a sub expression bracketed with ()
char * closureBracket = findClosureBracket(pointer); //Get the position of closure bracket ")" char * closureBracket = findClosureBracket(pointer); //Get the position of closure bracket ")"
if (closureBracket != nullptr) { if (closureBracket != nullptr) {
value = evaluateExpression(pointer+1, closureBracket - pointer - 2); value = evaluateExpression(pointer+1, closureBracket - pointer - 1);
pointer = closureBracket + 1; pointer = closureBracket + 1;
bSucceed = true; bSucceed = true;
} }
@ -1333,7 +1333,7 @@ bool findNextLogicObjectValue(char * &pointer, bool &value)
} else if (*pointer == '(') { //It is a sub expression bracketed with () } else if (*pointer == '(') { //It is a sub expression bracketed with ()
char * closureBracket = findClosureBracket(pointer); //Get the position of closure bracket ")" char * closureBracket = findClosureBracket(pointer); //Get the position of closure bracket ")"
if (closureBracket != nullptr) { if (closureBracket != nullptr) {
value = evaluateLogicalExpression(pointer+1, closureBracket - pointer - 2); value = evaluateLogicalExpression(pointer+1, closureBracket - pointer - 1);
pointer = closureBracket + 1; pointer = closureBracket + 1;
bSucceed = true; bSucceed = true;
} }