1
1
mirror of https://github.com/tweag/nickel.git synced 2024-09-11 11:47:03 +03:00
Commit Graph

6 Commits

Author SHA1 Message Date
Yann Hamdaoui
d35baaee1c
Add --error-format flag to serialize err diagnostics (#1740)
* Add --error-format flag to serialize err diagnostics

* Make other CLI errors follow --error-format as well
2023-12-19 15:36:57 +00:00
Yann Hamdaoui
a3505a1e02
Print pretty diagnostic when a benchmark fails (#1675) 2023-10-11 16:29:59 +00:00
Yann Hamdaoui
f06bda9239
Implement contract deduplication optimization (#1631)
* Duplicate contrat elision: first tentative

* Fix contract deduplication

The previous attempt wasn't fruitful, because we don't pass the initial
environment to the contract equality checker. This commit thread the
initial environment through the virtual machine and various functions to
make it available to the contract deduplicator

* Use contract deduplication for annotations as well

Use a special contract deduplication to avoid pretty printing many many
identical type annotations when evaluating. The actual contract
applications were already elided as far as evaluation is concerned, but
contracts annotations were still accumulated without deduplication.

* Rename elision->dedup which is better descriptive

* Fix clippy warning

* Fix cargo doc warnings

* Cosmetic improvements

* Mention idempotency assumption in the manual

* Update core/src/typecheck/eq.rs

Co-authored-by: Taeer Bar-Yam <Radvendii@users.noreply.github.com>

* Fix REPL query not working anymore

* Update core/src/typecheck/eq.rs

Co-authored-by: jneem <joeneeman@gmail.com>

* Formatting

* Fix clippy error

* Update core/src/program.rs

Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>

---------

Co-authored-by: Taeer Bar-Yam <Radvendii@users.noreply.github.com>
Co-authored-by: jneem <joeneeman@gmail.com>
Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>
2023-09-28 16:23:43 +00:00
Viktor Kleen
b02961324d
Testing Nickel snippets in the manual (#1611)
* First pass on testing snippets in `manual/syntax.md`

* Remove explicit `TestCase`

* Remove explicit panic

* Add test annotations to the manual

* Stop filtering markdown files

* Update `typing.md` example

* Apply suggestions from code review

Co-authored-by: jneem <joeneeman@gmail.com>

* Some tweaks to multi line string examples

* Move from `nickel-...` info strings to `nickel #...`

---------

Co-authored-by: jneem <joeneeman@gmail.com>
2023-09-19 13:09:58 +00:00
gtsiam
365e14da36
Cleanup the code a bit (a lot) (#1595)
* Removed explicit state from Traverse trait

* Make clippy happy

* Consistent whitespace between documented items

I kept running into this while going through the codebase,
so I thought I'd fix it once and for all.

And no, I did not do this by hand. So I might have missed some cases.

* More formatting.

Mainly includes wrapping of comments to the 100 column mark,
as well as some more formatting on macros and strings.

* restore try_map_state in Traverse impl

* Removed IdentKind

It was technically only used in the PartialEq implmentation of Thunk.
Still, I don't think that had any effect.

* Fix doc comment

Co-authored-by: Yann Hamdaoui <yann.hamdaoui@gmail.com>

---------

Co-authored-by: Taeer Bar-Yam <taeer.bar-yam@tweag.io>
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@gmail.com>
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
2023-09-18 11:38:33 +00:00
Viktor Kleen
78e7a8814b
Rename and move workspace crates (#1399)
* Rename and move workspace crates

nickel-lang -> nickel-lang-cli in cli/
nickel-lang-lib -> nickel-lang-core in core/
nickel-lang-utilities -> nickel-lang-utils in utils/
nickel-repl -> nickel-repl in wasm-repl/

* Finish renaming in rust sources

* Update RELEASING.md

* Move to workspace dependencies

* Rename nickel-repl -> nickel-wasm-repl

* Update RELEASING.md

Co-authored-by: Taeer Bar-Yam <Radvendii@users.noreply.github.com>

* Address suggestions from code review

* Update HACKING.md

Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>

* Elaborate on the versioning scheme in RELEASING.md

---------

Co-authored-by: Taeer Bar-Yam <Radvendii@users.noreply.github.com>
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
2023-06-26 16:58:40 +00:00