# pkl-parser This crate exports a parser for Apple's Pkl language. ## Features All the Pkl syntax is supported. ## Installation When in your rust project, simply run: `cargo add pkl-parser` ## Usage Here's an example of how to parse a PKL string: ```rust use pkl_parser::{parse, pratt, Rule, Error, Pairs}; fn main() -> Result, Error> { let source = "//some pkl code"; let pairs = parse(source)?; let file = result.next().unwrap().into_inner(); for element in file { match element.as_rule() { // then take care of each stmt separately Rule::stmt => (), // then take care of each comment/annotation separately Rule::COMMENT => (), Rule::EOI => (), _ => unreachable!(), } } Ok(()) } ``` ### LICENSE This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.