oga/spec/oga/xml
Yorick Peterse 24ae791f00 Better support for lexing multi-line strings.
When lexing multi-line strings everything used to work fine as long as the input
were to be read as a whole. However, when using an IO instance all hell would
break loose. Due to the lexer reading IO instances on a per line basis,
sometimes Ragel would end up setting "ts" to NULL. For example, the following
input would break the lexer:

    <foo class="\nbar" />

Due to the input being read per line, the following data would be sent to the
lexer:

    <foo class="\n
    bar" />

This would result in different (or NULL) pointers being used for building a
string, in turn resulting in memory allocation errors.

To work around this the string lexing setup has been broken into separate
machines for single and double quoted strings. The tokens used have also been
changed so that instead of just "T_STRING" there are now the following tokens:

* T_STRING_SQUOTE
* T_STRING_DQUOTE
* T_STRING_BODY

A string can have multiple T_STRING_BODY tokens (= multi-line strings, only the
case for IO inputs). These strings are stitched back together by the parser.

This fixes #58.
2014-10-26 11:39:56 +01:00
..
lexer Better support for lexing multi-line strings. 2014-10-26 11:39:56 +01:00
parser Better support for lexing multi-line strings. 2014-10-26 11:39:56 +01:00
pull_parser Support for parsing XML processing instructions. 2014-08-15 22:23:26 +02:00
attribute_spec.rb Encode/decode XML entities. 2014-09-28 21:53:25 +02:00
cdata_spec.rb Removed the node_type method crap. 2014-09-13 15:09:52 +02:00
character_node_spec.rb Use a new base class for XML text nodes. 2014-08-15 10:43:16 +02:00
comment_spec.rb Removed the node_type method crap. 2014-09-13 15:09:52 +02:00
doctype_spec.rb Removed the node_type method crap. 2014-09-13 15:09:52 +02:00
document_spec.rb Track document types when parsing. 2014-09-16 00:25:51 +02:00
element_spec.rb self-close certain XML/HTML elements. 2014-09-16 00:44:38 +02:00
entities_spec.rb Encode/decode XML entities. 2014-09-28 21:53:25 +02:00
namespace_spec.rb Proper namespace support for elements. 2014-08-11 00:41:36 +02:00
node_set_spec.rb Added XML::Node#before and XML::Node#after 2014-09-09 22:48:31 +02:00
node_spec.rb Removed the node_type method crap. 2014-09-13 15:09:52 +02:00
processing_instruction_spec.rb Support for parsing XML processing instructions. 2014-08-15 22:23:26 +02:00
querying_spec.rb XML module for more easily querying using XPath. 2014-09-02 20:16:52 +02:00
sax_parser_spec.rb Implemented a basic SAX API. 2014-09-16 14:30:46 +02:00
text_spec.rb Encode/decode XML entities. 2014-09-28 21:53:25 +02:00
traversal_spec.rb Moved Document#each_node into a separate module. 2014-09-05 19:42:38 +02:00
xml_declaration_spec.rb Removed the node_type method crap. 2014-09-13 15:09:52 +02:00