tvl-depot/tvix/eval/src
Vincent Ambo 0abc66ad91 feat(tvix/eval): add an AST pretty-printing module
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>
2022-10-16 12:26:56 +00:00
..
builtins fix(tvix/eval): don't coerce variable name to string 2022-10-16 09:20:02 +00:00
compiler fix(tvix/eval): fix Compiler::new on wasm 2022-10-13 16:29:49 +00:00
tests fix(tvix/eval): don't coerce variable name to string 2022-10-16 09:20:02 +00:00
value feat(tvix/eval): remove Clone instance from Chunk and Lambda 2022-10-16 09:23:03 +00:00
chunk.rs feat(tvix/eval): remove Clone instance from Chunk and Lambda 2022-10-16 09:23:03 +00:00
errors.rs feat(tvix/eval): Implement builtins.fromJSON 2022-10-15 20:35:22 +00:00
eval.rs feat(tvix/eval): add an AST pretty-printing module 2022-10-16 12:26:56 +00:00
lib.rs feat(tvix/eval): add an AST pretty-printing module 2022-10-16 12:26:56 +00:00
main.rs feat(tvix/eval): Allow directly evaluating an expr via main 2022-10-11 00:33:49 +00:00
nix_search_path.rs fix(tvix/eval): nix_search_path.rs: use /etc instead of /bin 2022-10-13 09:07:30 +00:00
observer.rs feat(tvix/eval): observe stack after exiting call frames/builtins 2022-10-11 00:07:39 +00:00
opcode.rs refactor(tvix/eval): remove OpResolveWithOrUpvalue 2022-10-14 09:18:38 +00:00
pretty_ast.rs feat(tvix/eval): add an AST pretty-printing module 2022-10-16 12:26:56 +00:00
properties.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
source.rs feat(tvix/eval): fancy-format parse errors returned by rnix 2022-10-08 17:27:57 +00:00
spans.rs refactor(tvix/eval): implement ToSpan directly for rnix::TextRange 2022-10-08 10:58:42 +00:00
test_utils.rs test(tvix/eval): Add proof-of-concept test for Chunk 2022-09-18 17:55:06 +00:00
upvalues.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
vm.rs refactor(tvix/eval) remove Value::DynamicUpvalueMissing 2022-10-16 09:17:02 +00:00
warnings.rs refactor(tvix/eval): introduce source::SourceCode type 2022-10-05 10:29:47 +00:00