about summary refs log tree commit diff
path: root/tvix/eval/src/errors.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-30 r/4538 refactor(tvix/eval): remove Error::InvalidKeyTypeVincent Ambo1-4/+0
We're confident that we're handling all branches that can reasonably occur from valid AST, any other cases should be considered a critical evaluator bug and panic rather than surfacing something that looks like user error. Change-Id: If96966eb32b8ff12fcaeb9ea3b0c8fc51b6abd11 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6205 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-28 r/4524 feat(tvix/eval): add local identifier accessVincent Ambo1-0/+3
This makes basic `let ... in ...` statements work correctly. It does not yet account for the call frames pushed into the VM during function application. Change-Id: I67155171daf1a43011b96716dd9d1ab04b27db33 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6190 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-28 r/4523 feat(tvix/eval): detect dynamic identifier names in `let`Vincent Ambo1-0/+3
Nix does not allow dynamic identifiers in let expressions (only in attribute sets), but there are several different kinds of things it considers static identifiers. The functions introduced here put the path components of a let expression into normalised (string) form, and surface an error about dynamic keys if one is encountered. Change-Id: Ia3ebd95c6f3ed3cd33b94e156930d2e9c39b6cbf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6189 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-28 r/4518 refactor(tvix/eval): implement error variant for path resolutionVincent Ambo1-0/+3
There are multiple things that can theoretically fail while resolving a path, as some of it includes I/O. A new error variant has been added for this and appropriate errors have been introduced. Change-Id: Ie222245425207dabbf203166eb5ed1eec0114483 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6184 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-26 r/4492 feat(tvix/eval): implement attribute set access operatorVincent Ambo1-0/+4
Fairly straightforward, handling the optimised representations manually and otherwise delegating to BTreeMap. Note that parsing of raw identifiers is not yet implemented. Encountering an identifier node usually means that there is locals access going on, so we need a special case for compiling a node in such a way that an identifier's literal value ends up on the stack. Change-Id: I13fbab7ac657b17ef3f4c5859fe737c321890c8a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6158 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-25 r/4478 feat(tvix/eval): implement binary comparison operatorsVincent Ambo1-0/+5
This is accomplished by simply delegating to the Rust implementations of (Partial)Ord and (Partial)Eq, which are implemented for Value and underlying wrapper types to behave like they do in Nix. To ease the implementation overhead, a new comparison operator macro has been added to the VM module. Incomparable types will raise a new error variant when a comparison is attempted, containing both supplied types. This mimics the information carried in the error thrown by C++ Nix. Change-Id: Ia19634d69119d40722f3ca672387bc3a80096998 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6143 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-14 r/4442 feat(tvix/vm): implement first nested attribute set constructionVincent Ambo1-0/+4
This can construct non-overlapping nested attribute sets (i.e. `{ a.b = 1; b.c = 2; }`, but not `{ a.b = 1; a.c = 2; }`). In order to do the latter, it's necessary to gain the ability to manipulate the in-progress attribute set construction. There's multiple different options for this ... Change-Id: If1a762a720b175e8eb4216cbf96a7434d22640fb Reviewed-on: https://cl.tvl.fyi/c/depot/+/6106 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4440 fix(tvix/eval): Fail on duplicate attribute set keysVincent Ambo1-0/+4
Change-Id: I57373ca76d0e25a5d08a8dfce9d5949099326fc0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6104 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4435 fix(tvix/errors): display a useful intermediate error representationVincent Ambo1-1/+1
Change-Id: If979a2aa21444320427f54e6530a55cab873856b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6099 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4409 feat(tvix/eval): add error variant for runtime type errorsVincent Ambo1-1/+6
Change-Id: I74155cf01766b7a991a69522945bff67fbca5a16 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6073 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4401 chore(tvix/eval): bootstrap some evaluator boilerplateVincent Ambo1-0/+12
Change-Id: I7770a20948d18a8506c2418dea21202aa21a6ddc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6064 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>