 
     private function pushToken(type:String):void
     {
+        // don't make empty text tokens
         if (!(type == HTMLToken.TEXT && currentToken.text.length == 0))
         {
             currentToken.type = type;

    {
        return isNameStartChar(char) ||
               (char >= "0" && char <= "9") ||
               char == "-" ||
               char == ".";
    }

    private static function isNameStartChar(char:String):Boolean

            }
            else
            {
                // if the entity parsed so far is valid, then allow it to
                // be terminated with something other than a ;
                if (HTMLReference.instance.isTextEntity(ent.substr(1).toLowerCase()) ||
                    HTMLReference.instance.isNumericEntity(ent))
                {
                    ent += ";";
                    putback();
                }
                else  // otherwise the opening & may have been meant as literal
                {
                    fail("Illegal character in entity");
                }
