1
1
mirror of https://github.com/tweag/nickel.git synced 2024-11-20 20:52:14 +03:00
nickel/core
Yann Hamdaoui 0b251e83b4
Detect infinite recursions in nickel doc (#2055)
* Detect infinite recursions in `nickel doc`

This commit fixes an issue where legit recursive configurations cause
infinite recursion when trying to extract their documentation. Indeed,
`nickel doc` calls to `eval_record_spine`, which is unable to detect
loops that span multiple evaluation step (an evaluation step is
evaluating one field to a weak head normal form).

This commit changes `eval_record_spine` and related methods to lock (in
practice just flip a bit in the thunk's state) the active thunks, that
is the thunks of parents of the field that we are currently evaluating.

If we ever come across a thunk that is already locked, the field is left
unevaluated, avoiding infinite recursion.

* Fix clippy warning

* Fix typo in code comment
2024-10-02 13:25:21 +00:00
..
benches Update to latest topiary-queries (formatting) (#2032) 2024-09-09 10:42:33 +00:00
src Detect infinite recursions in nickel doc (#2055) 2024-10-02 13:25:21 +00:00
stdlib Adds a nickel test subcommand for testing examples in docs. (#2020) 2024-09-26 13:45:03 +00:00
tests Thunks for resolved imports (#2052) 2024-09-26 10:59:49 +00:00
build.rs add %eval_nix% primop (#1465) 2023-10-09 15:08:55 +00:00
Cargo.toml Let blocks (#2010) 2024-09-10 15:06:07 +00:00