Age | Commit message (Collapse) | Author |
|
Add parse_embed_pcdata flag
This flag determines if plain character data is be stored in the parent element's value. This significantly changes the structure of the document; this flag is only recommended for parsing documents with a lot of PCDATA nodes in a very memory-constrained environment.
Most high-level APIs continue to work; code that inspects DOM using first_child()/value() will have to be adapted.
|
|
The performance cost is probably negligible and this means we treat embedded
value as the first child consistently.
|
|
|
|
Since round-tripping should not be a problem any more don't mention it.
|
|
|
|
This change fixes an important ordering issue - if element node has a PCDATA
child *after* other elements, it's impossible to tell which order the children
were in.
Since the goal of PCDATA embedding is to save memory when it's the only child,
only apply the optimization to the first child. This seems to fix all
roundtripping issues so the only caveat is that the DOM structure is different.
|
|
This is a bit awkward since preserving correct indentation structure requires
a bit of extra work, and the closing tag has to be written by _start function
to correctly process the rest of the tree.
|
|
|
|
|
|
When this flag is true, PCDATA value is saved to the parent element instead of
allocating a new node.
This prevents some documents from round-tripping since it loses information,
but can provide a significant memory reduction and parsing speedup for some
documents.
|
|
|
|
|
|
|
|
Also refactor to use the same case and run after common options.
|
|
scripts: Allow linking static CRT libraries on Windows
Use the solution from CMake FAQ to specify correct command-line arguments.
|
|
(!"string") triggers the warning however (false && "string") does not.
Fixes #75.
|
|
|
|
|
|
Apparently some MinGW distributions have a compiler that's recent enough to
support C++11 but limits.h header that incorrectly omits LLONG limits in
strict ANSI mode, since it guards the definitions with:
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
We can just define these symbols ourselves in this specific case.
Fixes #66.
|
|
The tests now compile fine but crash on the first floating-point exception
despite our attempts to disable them in main()...
|
|
It does not have stdint.h and has some C++ parsing issues.
|
|
|
|
|
|
Fixes #61.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For some reason reference to a fixed-size array works in two other places
but not in this one...
|
|
These show up when building with Wcast-align for ARM.
|
|
Travis CI strikes once more.
|
|
|
|
It now also moves parse result.
|
|
Only happens on GCC 3.4 for some reason.
|
|
Fix "this decimal constant is unsigned only in ISO C90".
|
|
|
|
name_sentry dtor results in multiple symbol definition errors in MSVC6.
|
|
Since they don't contribute to the resulting value just skip them before
parsing. This matches the behavior of strtol/strtoll and results in more
intuitive behavior.
|
|
Node type enum is not used as an array index anywhere else; the code is not
very readable and the value of this "optimization" is questionable.
The conditions are arranged so that in all normal cases the first comparison
returns true anyway.
|
|
The minneg argument is supposed to be the absolute value of the minimum negative
representable number. In case of two-complement arithmetic, it's the same as the
value itself but it's better to be explicit and negate the argument.
|
|
|
|
|
|
Share the implementation for different encodings. We still need two functions
because endian_swap on uint8_t is ambiguous...
|
|
|
|
|