YAMLish

VAL

'; @parts.push: '&' ~ $single.anchor with $single.anchor; @parts.push: '<' ~ $single.tag.full-name($namespace) ~ '>' with $single.tag; @parts.push: $single.type ~ escape-chars($single.value); take @parts.join(' '); }

ALI

*' ~ $alias.identifier }

NAME

YAMLish - a YAML parser/emitter written in pure raku

DESCRIPTION

This is a YAML parser written in pure-raku. It aims at being feature complete (though there still a few features left to implement). Patches are welcome.

INSTALLATION


$ zef install YAMLish

EXPORTED SUBS

  • load-yaml(Str $input, ::GrammarType:U :$schema = ::Schema::Core, :%tags)

  • load-yamls(Str $input, ::GrammarType:U :$schema = ::Schema::Core, :%tags)

  • save-yaml($document, :$sorted = True)

  • save-yamls(**@documents, :$sorted = True)

Example use for a configuration file

This configuration file begins with a comment followed by three lines of key/value:

# key: value
lang: en
lat: 46.12345
lon: -82.6231

Access the file in your code like this:

use YAMLish;
my $str = "config.yml".IO.slurp:
my %conf = load-yaml $str;
say %conf<lang>; # OUTPUT: «en␤»
say %conf<lat>;  # OUTPUT: «46.12345␤»
say %conf<lon>;  # OUTPUT: «-82.6231␤»

TODO

Please have a look at ./TODO.md

AUTHOR

Leon Timmermans

LICENSE

Artistic License 2.0

YAMLish v0.1.3

a YAML parser/emitter written in pure raku

Authors

  • Leon Timmermans

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • YAMLish

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.