#parser

strangemeadowlark

Parser for the Starlark configuration language. Ported from https://github.com/google/starlark-go

6 releases

0.3.0 Sep 24, 2024
0.2.0 Sep 20, 2024
0.1.4 Jun 19, 2024
0.1.3 May 28, 2024
0.1.0 Nov 1, 2023

#1088 in Development tools

Download history 105/week @ 2024-06-15 10/week @ 2024-06-22 9/week @ 2024-06-29 12/week @ 2024-07-27 1/week @ 2024-08-03 117/week @ 2024-09-14 182/week @ 2024-09-21 110/week @ 2024-09-28

409 downloads per month

Apache-2.0

230KB
5.5K SLoC

This is a parser for the Starlark language, a dialect of Python intended for use as a configuration language (for example, to configure builds in bazel).

This implementation is a port of starlark-go to Rust.

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 bumpalo will not call Drop and that makes it very easy to leak memory.

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

~1MB
~19K SLoC