mirror of
https://github.com/MeowLynxSea/ceditor.git
synced 2025-07-09 10:54:37 +00:00
修复了不能正确处理字符、字符串中的'和"字符的问题
This commit is contained in:
parent
273ecc77b0
commit
b4e10279d2
@ -206,7 +206,8 @@ private:
|
|||||||
!maybeOperatorOrDelimiterWith2Letters(preprocessedText[currentIndex])) {
|
!maybeOperatorOrDelimiterWith2Letters(preprocessedText[currentIndex])) {
|
||||||
if(preprocessedText[currentIndex] == '\"') {
|
if(preprocessedText[currentIndex] == '\"') {
|
||||||
currentToken += preprocessedText[currentIndex++];
|
currentToken += preprocessedText[currentIndex++];
|
||||||
while(preprocessedText[currentIndex] != '\"') {
|
while(currentIndex < preprocessedText.length()) {
|
||||||
|
if(preprocessedText[currentIndex] == '\"' && preprocessedText[currentIndex - 1] != '\\') break;
|
||||||
currentToken += preprocessedText[currentIndex++];
|
currentToken += preprocessedText[currentIndex++];
|
||||||
}
|
}
|
||||||
currentToken += preprocessedText[currentIndex++];
|
currentToken += preprocessedText[currentIndex++];
|
||||||
@ -215,7 +216,8 @@ private:
|
|||||||
}
|
}
|
||||||
if(preprocessedText[currentIndex] == '\'') {
|
if(preprocessedText[currentIndex] == '\'') {
|
||||||
currentToken += preprocessedText[currentIndex++];
|
currentToken += preprocessedText[currentIndex++];
|
||||||
while(preprocessedText[currentIndex] != '\'') {
|
while(currentIndex < preprocessedText.length()) {
|
||||||
|
if(preprocessedText[currentIndex] == '\'' && preprocessedText[currentIndex - 1] != '\\') break;
|
||||||
currentToken += preprocessedText[currentIndex++];
|
currentToken += preprocessedText[currentIndex++];
|
||||||
}
|
}
|
||||||
currentToken += preprocessedText[currentIndex++];
|
currentToken += preprocessedText[currentIndex++];
|
||||||
|
Loading…
Reference in New Issue
Block a user