Commit graph

40 commits

Author SHA1 Message Date
kiith-sa f93e3cf032 Minor debug message fixes. 2012-11-02 14:32:09 +01:00
kiith-sa c7e97b6113 User defined constructors now can construct all default types (e.g. float). 2012-09-22 22:45:37 +02:00
kiith-sa edf3e2a799 Using std.typecons.Flag where possible, and more in->const. 2012-09-14 01:21:01 +02:00
kiith-sa 58fc17197b Replaced some incorrect 'in' uses with 'const'. 2012-09-13 21:37:28 +02:00
kiith-sa 4f78702a57 Added pure/@safe/nothrow where possible. 2012-09-09 01:42:13 +02:00
kiith-sa 37a661b034 Fixed compilation with DMD 2.058.
There are some hacks to allow toHash() methods
to be const nothrow @safe, these are due to
Phobos problems (e.g. Variant.toHash() is not const nor nothrow).
2012-08-30 15:38:51 +02:00
Ferdinand Majerech c690d56d9f Added a property to determine if the node is null. 2012-04-07 03:59:54 +02:00
Ferdinand Majerech 1a1783a228 Fixed a compilation bug on 32bit. 2012-03-19 14:31:11 +01:00
Ferdinand Majerech d64de6a312 Merged implementations of Node.remove() and Node.removeAt(). 2012-03-01 17:43:42 +01:00
Ferdinand Majerech 2505c0b3af Improved Node exception messages. 2012-03-01 15:23:53 +01:00
Ferdinand Majerech 2448c69f55 Added containsKey() to check if a mapping has specified key. 2012-03-01 13:17:32 +01:00
Ferdinand Majerech ebc6e64c2b API BREAKING:
Node opEquals(), opIndex(), opIndexAssign(), remove(), removeAt()
no longer automatically convert to string. This was changed
to prevent the API from getting too non-obvious, and to
remove the need for too many special cases in the code.
The API documentation was changed accordingly.
opApply()  still automatically converts to string.

Added a contains() method to Node.

Clarified YAML null values in the documentation.

Improved unittests.

Fixed a bug that caused opIndex() and opIndexAssign() to only
work with exactly the same type as stored in the node
(e.g. real, but not double, for floating-point values)

Fixed some potential bugs.

Minor documentation fixes.
2012-03-01 11:44:05 +01:00
Ferdinand Majerech 9596806644 Red-Black Trees are now used for duplicate detection, and planned
to be used for unordered map storage. This is because AAs still
don't work correctly and even if they did, require the user to
define both toHash and opCmp/opEquals for every YAML
struct/class. Now only opCmp needs to be defined.
Documentation/tutorials/examples have been updated accordingly.
2012-01-23 15:57:26 +01:00
Ferdinand Majerech d46a3ac5c2 Fixed a bug that caused an out of range error when a key in a
mapping could not be found.
2012-01-22 17:03:32 +01:00
Ferdinand Majerech 04af9bf240 Fixed some compilation bugs on 32bit. 2012-01-22 10:37:44 +01:00
Ferdinand Majerech 10dbb55ed8 Minor documentation and API fixes. 2011-11-18 12:28:29 +01:00
Ferdinand Majerech f95f0d14c8 Const correctness and minor bugfixes all over the code. 2011-10-30 20:24:43 +01:00
Ferdinand Majerech 8208e817de Updated Node for much more constness (unfortunately, quite some
code duplication as well). No longer need a custom Variant.
2011-10-30 18:12:02 +01:00
Ferdinand Majerech 508696584e More constness in Node. 2011-10-30 10:52:40 +01:00
Ferdinand Majerech b3a51800f7 Removed Node.getToVar as it turned out to be a premature
optimization.
2011-10-29 22:53:46 +02:00
Ferdinand Majerech be5664a24d Updated D:YAML with DMD 2.056 support. Fixed some bugs.
Found a bug in std.variant and bundled a fixed version.
2011-10-29 00:31:14 +02:00
Ferdinand Majerech 5d35f44416 Nodes now remember their scalar and collection style, although
these are not accessible by the user (as the spec says).
This allows D:YAML to remember styles between loading and
dumping.
2011-10-27 23:13:14 +02:00
Ferdinand Majerech c787531497 Node struct enlarged to 40 bytes. There is no significant
slowdown and a slight memory usage increase. Fixed a potential
bug in Reader. Tag is now implemented as a zero-terminated
string, removing the need for global state.
Node opIndex now returns a reference.
2011-10-26 21:05:56 +02:00
Ferdinand Majerech 97693b4417 Got rid of most UTF-8 decoding that took a lot of time.
Removed unnecessary calls to Stream.available(),
again for grat speed gain. Also various small optimizations.
Overall, improved loading speed about 400%.
2011-10-24 00:46:35 +02:00
Ferdinand Majerech 9d68b6fa9a Optimized GC performance when loading,
greatly decreasing memory usage and
improving speed by 30% or more.
2011-10-23 20:17:37 +02:00
Ferdinand Majerech 13ea5f0c24 Added a shortcut alias called "as" for Node.get(), and replaced
get() with as() all over the code, tutorials, examples and docs.
Fixed a bug in YAML benchmark makefile.
Fixed a bug in autoddoc configuration.
2011-10-22 17:06:32 +02:00
Ferdinand Majerech 7402d8f827 Fixed Makefile of the yaml_stats example.
Fixed a bug in Node that caused an empty exception message.
2011-10-21 20:40:37 +02:00
Ferdinand Majerech 33a376b038 String representation of a Node's tag can now be accessed by the
user.
2011-10-20 15:48:21 +02:00
Ferdinand Majerech 8ad650e089 Cleaned up exceptions and their messages.
Some minor dog fixes.
2011-10-18 16:12:22 +02:00
Ferdinand Majerech 009017eef0 Simplified the Constructor and Resolver example -
no need for range checks as they are handled in Node itself.
2011-10-17 13:13:02 +02:00
Ferdinand Majerech 548480b06b Changed the Constructor API (for loading of custom types) to
make it easier to load custom classes/structs. Updated API docs,
tutorials and examples accordingly.
2011-10-17 12:53:38 +02:00
Ferdinand Majerech 23290239a7 There should be no problem constructing new instances of Tag,
Anchor and TagDirectives in separate threads anymore. D:YAML
still is not thread safe itself, though (it's the user's
responsibility to handle synchronization when working with a
single node from two threads, for example).
2011-10-14 19:54:41 +02:00
Ferdinand Majerech 765b74ffca Updated the API documentation.
Updated examples based on the new Loader API.
(Dumper API still needs examples)
2011-10-14 10:34:53 +02:00
Ferdinand Majerech 8360da733d All YAML exceptions now keep track of file and line they've been
thrown at, making debugging easier.
2011-10-13 11:30:14 +02:00
Ferdinand Majerech 934df763ad Most of emitter work done. There are some more changes left until 0.2,
and the turorials and documentation still need some updating.
2011-10-11 15:58:23 +02:00
Ferdinand Majerech 967fe8c48b Added various node manipulation functions so e.g. new elements
can be added to collections before emitting. The code is
somewhat ugly, might be revised later.
2011-08-21 23:53:19 +02:00
Ferdinand Majerech b0f2ce201a Added Node constructors needed to create new nodes to emit. 2011-08-21 03:56:21 +02:00
Ferdinand Majerech dde7d2f64f Node equality test now takes tag into account, as the
specification requires.
2011-08-20 22:38:32 +02:00
Ferdinand Majerech 7192503fe6 Implemented a Tag struct taking as little memory as possible.
Removed endMark from Node to keep it in 32 bytes on 64bit.
This will result in slightly worse debugging messages, but we
still have the start position of a node.

Tag is needed for better compliance with the spec and emitting
support for multiple tags with the same D data type.
2011-08-20 22:15:20 +02:00
Ferdinand Majerech 283c42bf8f Initial commit. 2011-08-16 14:53:13 +02:00