about summary refs log tree commit diff
path: root/tvix/eval/src/pretty_ast.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-12-25 r/5486 fix(tvix/eval): fix current clippy warningsVincent Ambo1-44/+18
It's been a while since the last time, so quite a lot of stuff has accumulated here. Change-Id: I0762827c197b30a917ff470fd8ae8f220f6ba247 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7597 Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-10-16 r/5149 fix(tvix/eval): more faithfully serialise ast::LiteralVincent Ambo1-10/+9
The previous serialisation format kind of lost the information about what AST node we're dealing with (e.g. `1234` would serialise to an AST with a literal `1234`). That's great for pretty-printing the _code_, but we explicitly want to serialise how rnix-parser parses something. To that end, literals are now instead serialised into a structure like all the other ones (`kind: literal` and appropriate value fields). Change-Id: I586c95d7db41820b8ec43565ba4016ed3834d1b5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7030 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: j4m3s <james.landrein@gmail.com> Reviewed-by: Adam Joseph <adam@westernsemico.com>
2022-10-16 r/5143 feat(tvix/eval): add an AST pretty-printing moduleVincent Ambo1-0/+495
This implements serde::Serialize for the rnix AST through a wrapper type, and exposes a function for serialising the AST into a (pretty-printed JSON) string representation. This can be used to debug issues with the AST, and to display an AST reprsentation in tools like tvixbolt. Serialize is implemented manually because we don't own any of the structs and the way to traverse them is not easily derived automatically, and this is quite verbose. We might be able to condense it a little bit, but at the same time it's also fairly straightforward. Change-Id: I922df43cfc25636f3c8baee7944c75ade516055c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6943 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: Adam Joseph <adam@westernsemico.com> Reviewed-by: tazjin <tazjin@tvl.su>