unwound changes to skipped content consumption

This commit is contained in:
rickg%netscape.com 1998-07-28 04:00:38 +00:00
parent 393a3c4392
commit 168527845e
2 changed files with 8 additions and 36 deletions

View file

@ -1369,29 +1369,15 @@ PRInt32 CSkippedContentToken::GetTokenType(void) {
*/ */
nsresult CSkippedContentToken::Consume(PRUnichar,CScanner& aScanner) { nsresult CSkippedContentToken::Consume(PRUnichar,CScanner& aScanner) {
PRBool done=PR_FALSE; PRBool done=PR_FALSE;
nsresult result=NS_OK; PRInt32 result=kNoError;
nsString temp; nsString temp;
int parens=0;
char lastChar;
static nsAutoString terminals(">()"); while((!done) && (kNoError==result)) {
while((!done) && (NS_OK==result)) { static nsAutoString terminals(">");
result=aScanner.ReadUntil(temp,terminals,PR_TRUE); result=aScanner.ReadUntil(temp,terminals,PR_TRUE);
int len=temp.Length(); done=PRBool(kNotFound!=temp.RFind(mTextValue,PR_TRUE));
lastChar=char(temp[len-1]);
switch(lastChar){
case kLeftParen:
parens++; break;
case kRightParen:
parens--; break;
default:
break;
}
if((0==parens) && (kGreaterThan==lastChar))
done=PRBool(kNotFound!=temp.RFind(mTextValue,PR_TRUE));
} }
mTextValue=temp; mTextValue=temp;
mStringInit=PR_TRUE;
return result; return result;
} }

View file

@ -1369,29 +1369,15 @@ PRInt32 CSkippedContentToken::GetTokenType(void) {
*/ */
nsresult CSkippedContentToken::Consume(PRUnichar,CScanner& aScanner) { nsresult CSkippedContentToken::Consume(PRUnichar,CScanner& aScanner) {
PRBool done=PR_FALSE; PRBool done=PR_FALSE;
nsresult result=NS_OK; PRInt32 result=kNoError;
nsString temp; nsString temp;
int parens=0;
char lastChar;
static nsAutoString terminals(">()"); while((!done) && (kNoError==result)) {
while((!done) && (NS_OK==result)) { static nsAutoString terminals(">");
result=aScanner.ReadUntil(temp,terminals,PR_TRUE); result=aScanner.ReadUntil(temp,terminals,PR_TRUE);
int len=temp.Length(); done=PRBool(kNotFound!=temp.RFind(mTextValue,PR_TRUE));
lastChar=char(temp[len-1]);
switch(lastChar){
case kLeftParen:
parens++; break;
case kRightParen:
parens--; break;
default:
break;
}
if((0==parens) && (kGreaterThan==lastChar))
done=PRBool(kNotFound!=temp.RFind(mTextValue,PR_TRUE));
} }
mTextValue=temp; mTextValue=temp;
mStringInit=PR_TRUE;
return result; return result;
} }