Home

Awesome

AdaYaml - YAML 1.3 implementation in Ada

This is an implementation of the upcoming YAML 1.3 standard. Since the standard is not completed yet, some features are due to change.

You can use it as YAML 1.2 implementation, it will parse almost all valid YAML 1.2 documents since proposed changes to 1.3 are minimal and only cover edge cases.

Status

Current YAML test suite status:

Total Tests Run:   249
Successful Tests:  244
Failed Assertions: 2
Unexpected Errors: 3

The parser is thoroughly tested and only fails test cases that are expected not to pass in YAML 1.3. Lionel Matias has fuzzy-tested AdaYaml, his findings have been adressed. Benchmarks of AdaYaml show that it currently uses about twice the time libyaml uses for parsing large YAML documents.

The parts of AdaYaml which have not undergone extensive testing are the DOM API and the Presenter.

Installation

You can install AdaYaml easily by executing

gprbuild -p -XMode=release yaml.gpr
gprinstall -XMode=release yaml.gpr

Afterwards, you can with "yaml"; in your projects.

YAML 1.3 Features

Status of YAML 1.3 features, taken from this list:

NumberDesciptionStatus
RFC-001Remove the 1024 character limitImplemented
RFC-002Limit content allowed after the '---' headerImplemented
RFC-003Characters that can appear in anchorImplemented
RFC-004Block sequence entries must use space after dashImplemented
RFC-005Restrict default implicit types to JSON semanticsNot applicable
RFC-006Disallow carriage return as a breakImplemented
RFC-007Disallow flow collections as implicit keysImplemented
RFC-008AnnotationsCan be parsed
RFC-009Allow unresolvable aliasesImplemented
RFC-010Fixed position of properties and block scalarsImplemented
RFC-011Indentation of block scalarsImplemented
RFC-012Remove wiki-like syntax from folded block scalarsImplemented
RFC-013retractedNot implemented
RFC-014Anchors always come before tags (when both)Not implemented

General Roadmap

Hacking

You can build the tests with:

make test

This builds the unit tests. The executables will be located in the test/bin directory (be sure that the root folder is the working directory when executing).

If you have GNAT GPL and GNATcoverage, you can also compute code coverage from the testsuite:

make test-coverage-run

The following command builds a small utility that reads a YAML files and outputs a stream of events to the command line:

make utils

It is located in util/bin afterwards. The tool reads either the file specified as first command line parameter, or, in absense of that parameter, from stdin.

To edit the code, you can use GNAT Programming Studio to open the *.gpr files.

License

MIT