pkl_fast is a Rust library aiming to become an efficient tool for working with Apple's Pkl format. The library shall provide fast and reliable parsing and manipulation capabilities for Pkl files in Rust projects.
Note: This library is still in development. The lexer part is completed, and work on the parser has begun.
Efficient lexer for tokenizing Pkl files (using the blazingly fast logos crate), using winnow parsing library instead as logos is too limited (no support for look-ahead in regex)- The parser is currently under development and is intended to return the Pkl file as statements. It will also provide warnings for non-recommended code practices and display errors as needed.
- Designed for speed and reliability.
-
Parsing basic values (e.g., int, float, boolean, string, datasize, duration)
-
Parsing objects declaration
-
Parsing
Map
,Set
,List
-
Parsing
Mapping
,Listing
-
Parsing simple type annotations (
Int
,Float
,UInt16
,unknown
,Any
) -
Parsing more complex type annotations (e.g.,
Listing<Type>
,Mapping<Type, OtherType>
) without type checking -
Adding type checking
-
Parsing
import/import\*
statement (with optionalas
) -
Parsing
amends
statement -
Parsing
extends
statement -
Parsing
module
statement -
Parsing variable declaration statement (partially done)
-
Parsing
class
statement -
Parsing
function
statement -
Parsing
@ModuleInfo
/@Deprecated
annotation -
Parsing
typealias
annotation (partially done, need to support unions) -
Parsing If/Else/Let/For/When statement
-
Parsing Arithmetic expressions
-
Parsing Function call expressions
-
Parsing InterpolatedString expressions
-
Generating a symbol table from the statements
Here is a list of pkl's features that should be implemented in rust, but which are not obvious to implement.
None for the moment, but there will be for sure...
For questions, suggestions, or feedback, please reach out to me at yatsu.dev@gmail.com. Pull requests are appreciated, and issues are welcome too! Thank you for your interest in contributing to the project!