changed to preprocessor for code generation for tag & entity tables

cleanup tag and entity lookup apis


git-svn-id: svn://10.0.0.236/trunk@39926 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterl%netscape.com
1999-07-18 00:12:32 +00:00
parent d329e12cb0
commit 82107c30bd
40 changed files with 1710 additions and 646 deletions

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("&");