fix: string not correctly syntax parsed.

This commit is contained in:
Roy Qu 2024-03-06 17:27:44 +08:00
parent 93768c199e
commit 52e859756b
1 changed files with 4 additions and 5 deletions

View File

@ -1300,7 +1300,8 @@ void CppSyntaxer::procString()
while (mRun < mLineSize) {
if (mLine[mRun]=='"') {
mRun++;
break;
mRange.state = RangeState::rsUnknown;
return;
} else if (mLine[mRun]==' ' || mLine[mRun]=='\t') {
return;
} else if (mLine[mRun]=='\\') {
@ -1342,10 +1343,8 @@ void CppSyntaxer::procString()
}
mRun+=1;
}
if (mRun>=mLineSize)
mRange.state = RangeState::rsStringUnfinished;
else
mRange.state = RangeState::rsUnknown;
// here mRun>=mLineSize
mRange.state = RangeState::rsStringUnfinished;
}
void CppSyntaxer::procStringStart()