Changeset 160 for trunk/src/xmldecl.c


Ignore:
Timestamp:
Jun 20, 2008, 3:30:40 PM (11 years ago)
Author:
lindanl
Message:

Restructured character set architecture; StringPool? in symbol table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/xmldecl.c

    r111 r160  
    7575//
    7676template <CodeUnit_Base C>
    77 int XML_Decl_Parser<C>::ReadXMLInfo(Entity_Info *e) {
     77void XML_Decl_Parser<C>::ReadXMLInfo(Entity_Info *e) {
    7878        e->version = no_XML_version_value;
    7979        e->has_encoding_decl = false;
     
    8282        // It is possible that there is no XML declaration.
    8383        if (!at_XmlDecl_start<C>(cur())) {
    84                 return AbsPos();
     84                e->content_start = AbsPos();
     85                return;
    8586        }
    8687        // Otherwise, the XML declaration exists and must have
     
    9899        else DeclarationError(AbsPos());
    99100        Advance(5);
    100         if (at_PI_End<C>(cur())) return AbsPos()+2;
     101        if (at_PI_End<C>(cur())) {
     102                e->content_start = AbsPos()+2;
     103                return;
     104        }
    101105        if (!at_WhiteSpace<XML_1_0, ASCII>(cur())) DeclarationError(AbsPos());
    102106        Scan_WS();
     
    118122                else DeclarationError(AbsPos());
    119123                Advance(1);
    120                 if (at_PI_End<C>(cur())) return AbsPos()+2;
     124                if (at_PI_End<C>(cur())) {
     125                        e->content_start = AbsPos()+2;
     126                        return;
     127                }
    121128                if (!at_WhiteSpace<XML_1_0, ASCII>(cur())) DeclarationError(AbsPos());
    122129                Scan_WS();
     
    134141        }
    135142        if (!at_PI_End<C>(cur())) DeclarationError(AbsPos());
    136         return AbsPos()+2;
     143        e->content_start = AbsPos()+2;
    137144}
    138145
     
    142149// processing.
    143150template <CodeUnit_Base C>
    144 int XML_Decl_Parser<C>::ReadTextDeclaration(Entity_Info *e) {
     151void XML_Decl_Parser<C>::ReadTextDeclaration(Entity_Info *e) {
    145152        e->version = no_XML_version_value;
    146153        e->has_encoding_decl = false;
     
    149156        // It is possible that there is no XML declaration.
    150157        if (!at_XmlDecl_start<C>(cur())) {
    151                 return AbsPos();
     158                e->content_start = AbsPos();
     159                return;
    152160        }
    153161        // Otherwise, the text declaration exists and may have
     
    188196        Scan_WS();
    189197        if (!at_PI_End<C>(cur())) DeclarationError(AbsPos());
    190         return AbsPos()+2;
    191 }
    192 
     198        e->content_start = AbsPos()+2;
     199}
     200
Note: See TracChangeset for help on using the changeset viewer.