25 releases (1 stable)
1.0.0 | Jan 5, 2024 |
---|---|
0.6.1 | Jan 4, 2024 |
0.5.2 | Dec 29, 2023 |
0.5.0 | Nov 24, 2023 |
0.1.3 | Oct 14, 2023 |
#303 in Procedural macros
Used in 2 crates
345KB
7K
SLoC
Chandeliers-San
Translations and static analysis of Candle.
Purpose
This crate provides an AST for the Candle language, as well as
- dependency resolution
- typechecking
- (soon to come) positivity check
- code generation
The AST that is declared here is not parseable directly, so it should be generated by translation from a language with better LL properties.
This crate operates at a level where we have all at once
- sufficient computing power (unlike
macro_rules!
that Candle is defined in), Span
s for everything that we manipulate so that errors can be traced back to the source code, and also imporantly- a structure of the AST that is convenient to recurse on, where there are no longer notions of associativity, punctuation, keywords, etc. that are necessary during parsing but just serve to make static analysis more heavy if they are not discarded.
Limitations
The structure of the AST makes it convenient to navigate but difficult to generate for unit tests. Some internal self-contained algorithms (e.g. acyclicity of dependencies) have unit tests of their own, but other than that this crate should be mostly trusted without unit testing as long as it passes the end-to-end tests.
That is not to say that the code here is completely untested, as we are still verifying that it emits the correct error messages at the correct locations, just that it is impossible to test this code without also at the same time testing the parser and the translation.
Dependencies
~285–740KB
~17K SLoC