Elektra
0.9.0
|
The YAy PEG plugin use a parser based on PEGTL to convert YAML data to Elektra’s KeySet
type.
This plugin requires PEGTL 2.7.1
or later. It does not support PEGTL 3
, which requires C++ 17.
```
sudo kdb mount config.yaml user/tests/yaypeg yaypeg
kdb set user/tests/yaypeg/movements/deadly 'Dull' kdb set user/tests/yaypeg/movements/deep 'Red'
printf 'Rosalía: El::Mal::Querer' >> kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg #> user/tests/yaypeg/Rosalía #> user/tests/yaypeg/movements/deadly #> user/tests/yaypeg/movements/deep
kdb get user/tests/yaypeg/Rosalía #> El::Mal::Querer
kdb rm -r user/tests/yaypeg sudo kdb umount user/tests/yaypeg
sudo kdb mount config.yaml user/tests/yaypeg yaypeg
printf 'ponies:
' > kdb file user/tests/yaypeg
printf ' - Fluttershy # Yay!
' >> kdb file user/tests/yaypeg
printf ' - Pinkie Pie
' >> kdb file user/tests/yaypeg
printf ' - Maud Pie' >> kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg #> user/tests/yaypeg/ponies #> user/tests/yaypeg/ponies/#0 #> user/tests/yaypeg/ponies/#1 #> user/tests/yaypeg/ponies/#2
kdb get user/tests/yaypeg/ponies/$(kdb getmeta user/tests/yaypeg/ponies array) #> Maud Pie
kdb rm -r user/tests/yaypeg sudo kdb umount user/tests/yaypeg
sudo kdb mount config.yaml user/tests/yaypeg yaypeg
printf 'one: true' > kdb file user/tests/yaypeg
0
and 1
kdb get user/tests/yaypeg/one #> 1
kdb rm -r user/tests/yaypeg sudo kdb umount user/tests/yaypeg
sudo kdb mount config.yaml user/tests/yaypeg yaypeg
printf 'Fluttershy:
' > kdb file user/tests/yaypeg
printf 'I’d like to be a tree
' >> kdb file user/tests/yaypeg
# Incorrect indentation
kdb ls user/tests/yaypeg
config.yaml
depends on the current user and OS,config.yaml
as user/tests/error/prefix
.kdb set user/tests/error "$(2>&1 kdb ls user/tests/yaypeg)" kdb set user/tests/error/prefix "$(kdb get user/tests/error | grep 'config.yaml' | head -1 | sed -E 's/(.*)config.yaml.*/\1/')"
kdb set user/tests/error/prefix/length "$(kdb get user/tests/error/prefix | wc -c | sed 's/[ ]*//g')"
head
and tail
.kdb get user/tests/error | tail -n3 | cut -c"$(kdb get user/tests/error/prefix/length)"- #> config.yaml:2:0: Incomplete document, expected “end of file” #> I’d like to be a tree #> ^
printf 'Fluttershy:
' > kdb file user/tests/yaypeg
printf ' I’d like to be a tree
' >> kdb file user/tests/yaypeg
kdb get user/tests/yaypeg/Fluttershy #> I’d like to be a tree
printf '"nothing,nowhere.' > kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg
printf '"\ö"' > kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg
printf "\"\07"" > kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg
printf "'Single" > kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg
printf "'\07'" > kdb file user/tests/yaypeg
kdb ls user/tests/yaypeg
printf 'dummy' > kdb file user/tests/yaypeg
kdb rm -r user/tests/error kdb rm -r user/tests/yaypeg sudo kdb umount user/tests/yaypeg ```
The plugin does not support
While the parser does read comments, the listener does currently not add metakeys for them. This means that comments will be lost, if you modify a key set.
Visualized error messages (containing ^
markers) might not point to the correct error location, if the input contains tabs or unicode characters with a length other than 1
.