changed to preprocessor for code generation for tag & entity tables

cleanup tag and entity lookup apis
This commit is contained in:
peterl@netscape.com
1999-07-18 00:12:32 +00:00
parent ec3ea240c5
commit afeb6760cf
40 changed files with 1710 additions and 646 deletions
+2 -4
View File
@@ -468,7 +468,7 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
*/
if(NS_SUCCEEDED(result))
if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
nsAutoString endTag(NS_EnumToTag(theTag));
nsAutoString endTag(nsHTMLTags::GetStringValue(theTag));
endTag.Insert("</",0,2);
CToken* textToken=theRecycler->CreateTokenOfType(eToken_text,theTag,endTag);
result=((CTextToken*)textToken)->ConsumeUntil(0,PR_TRUE,aScanner,endTag); //tell new token to finish consuming text...
@@ -545,10 +545,8 @@ nsresult nsHTMLTokenizer::ConsumeEntity(PRUnichar aChar,CToken*& aToken,nsScanne
return ConsumeText(temp,aToken,aScanner);
}//if
if(aToken){
char cbuf[30];
nsString& theStr=aToken->GetStringValueXXX();
theStr.ToCString(cbuf, sizeof(cbuf)-1);
if((kHashsign!=theChar) && (-1==NS_EntityToUnicode(cbuf))){
if((kHashsign!=theChar) && (-1==nsHTMLEntities::EntityToUnicode(theStr))){
//if you're here we have a bogus entity.
//convert it into a text token.
nsAutoString temp("&");