rpkl-parser

Crates.iorpkl-parser
lib.rsrpkl-parser
version0.1.0
created_at2025-12-19 17:17:41.486467+00
updated_at2025-12-19 17:17:41.486467+00
descriptionParser for the PKL configuration language
homepage
repositoryhttps://github.com/prefix-dev/rpkl
max_upload_size
id1995151
size85,421
Wolf Vollprecht (wolfv)

documentation

README

rpkl-parser

PKL parser for Rust, built with pest.

Usage

use rpkl_parser::{parse_module, parse_expression};

// Parse a module
let module = parse_module(r#"
    name = "example"
    value = 42
"#)?;

// Parse a single expression
let expr = parse_expression("1 + 2 * 3")?;

Supported Syntax

  • Literals: null, booleans, integers, floats, strings (with interpolation)
  • Operators: arithmetic, comparison, logical, null-coalescing
  • Objects: dynamic, Listing, Mapping, typed
  • Classes: with inheritance (extends)
  • Modules: amends, extends, import
  • Functions: function declarations and lambdas
  • Type annotations and constraints
  • Generators: for, when
  • Duration and DataSize literals

License

Apache-2.0

Commit count: 0

cargo fmt