cwmoss / kuddle2
There is no license information available for the latest version (dev-main) of this package.
dev-main
2026-08-07 06:38 UTC
Requires (Dev)
- phpunit/phpunit: ^13.2
This package is auto-updated.
Last update: 2026-08-07 06:38:40 UTC
README
composer require cwmoss/kuddle2:dev-main
this is a dependency free kdl 2 parser for php. fully vibecoded by MAI-Code-1-Flash. at this stage the parser is useful but not features complete and not specs compliant.
what is KDL?
from the source https://kdl.dev/
KDL is a small, pleasant document language with XML-like node semantics that looks like you're invoking a bunch of CLI commands! It's meant to be used both as a serialization format and a configuration language, much like JSON, YAML, or XML. It looks like this:
package {
name my-pkg
version "1.2.3"
dependencies {
// Nodes can have standalone values as well as
// key/value pairs.
lodash "^3.2.1" optional=#true alias=underscore
}
scripts {
// "Raw" and dedented multi-line strings are supported.
message """
hello
world
"""
build #"""
echo "foo"
node -c "console.log('hello, world!');"
echo "foo" > some-file.txt
"""#
}
// `\` breaks up a single node across multiple lines.
the-matrix 1 2 3 \
4 5 6 \
7 8 9
// "Slashdash" comments operate at the node level,
// with just `/-`.
/-this-is-commented {
this entire node {
is gone
}
}
}
specs: look at ./draft-marchan-kdl2.md
use
use cwmoss\kuddle2\parser; $file = "my-config.kdl"; $content = file_get_contents($file); $data = new parser($content)->parse(); var_dump($data);
test
run tests with phpunit
./vendor/bin/phpunit tests/