10 unstable releases (3 breaking)
0.4.3 | Jan 18, 2025 |
---|---|
0.4.2 | Jan 18, 2025 |
0.3.0 | Sep 24, 2024 |
0.2.0 | Sep 20, 2024 |
0.1.0 | Nov 1, 2023 |
#537 in Development tools
432 downloads per month
315KB
7.5K
SLoC
This package implements parsing and name resolution for the Starlark language. Starlark is a dialect of Python intended for use as a configuration language. Its main use is for extending the Bazel build system.
This partial implementation is a port of starlark-go to Rust.
The main use of this package is for extracting information from BUILD files. There is a basic interpreter, but it is more than unlikely to evolve into a full implementation.
If you want a complete implementation, you may want to reach for starlark-go or try starlark-rust instead.
Development
Test with Leak Sanitizer
This library uses bumpalo
and an AST that is using references. This has the
advantage of enabling pattern matching on ASTs. However as the docs say,
bumpalo will not call Drop
, and this makes it very easy to leak memory.
When making changes, run the following to detect leaks:
RUSTFLAGS="-Z sanitizer=leak -Zexport-executable-symbols" cargo test --target x86_64-unknown-linux-gnu
The -Zexport-executable-symbols
is a workaround.
The stacktraces will not be useful, unless they are symbolized. For that, you
want llvm-symbolizer
in your path.
Dependencies
~1.3–2MB
~35K SLoC