The doc subcommand has been reported to be a bit confusing, because it
generates file in a default location but just returns without further
details upon success. This commits add a print statement that says where
the document has been generated instead.
* Bump version numbers for 1.3 release
* Add release notes (part 1)
* Bump latest version mentioned in READMEs to 1.3
* Bump latest version mentioned in manual to 1.3
* Update RELEASING guide
* Factor out extract_field() from query()
* Add selectable field to Program
* Add --field to supported commands
This commit finishes the series on adding `--field` argument to the CLI.
This argument is factorized as a new Customize implementer which
regroups commands that don't support general customization (overriding)
but still support selecting a specific field from the configuration.
It's added to the full customization as well.
In consequence, commands that didn't support selecting particular field
before now generically support the `--field` argument. The `--path`
argument for `--query` is removed and is just a `--field` argument for
`nickel query`.
* Fix not taking the --field into account when not customizing
* Formatting
* Fix tests for new --field argument
* Fix clippy warning
* Fix compilation errors, tests, and improve error messages
* Avoid duplicating 'field' declaration in clap
* Customize mode new assignment syntax, part 1
* Add StaticPathField parsing rule
* Add cli assignment parsing rule
* Use new assignment parsing rule, refactor common code
* Fix compilation warnings
* Improve the output of `-- list` including type and contracts
* Remove unused datatype
* Formatting
* Fix old tests and add new for customize mode
* Reword documentation of FieldInterface::is_input
* Pass on code documentation
* Remove obsolete comment
* Update cli/tests/snapshot/inputs/customize-mode/unknown_override.ncl
Co-authored-by: jneem <joeneeman@gmail.com>
* Update cli/tests/snapshot/inputs/customize-mode/unkonwn_field_path.ncl
Co-authored-by: jneem <joeneeman@gmail.com>
* Update cli/src/customize/interface.rs
Co-authored-by: jneem <joeneeman@gmail.com>
* Fix typos in snapshot tests
* Add suggestion for customize mode unknown field errors
* Update snapshot tests with new output
* Get rid of '-- show', hint at using query instead
---------
Co-authored-by: jneem <joeneeman@gmail.com>
* Add strsim dependency
* Move error module into its own directory
* Add error::suggest module and fn to find best suggestion
* Add field_names() method to RecordData
* Make find_match more generic
* Add conversion identifier/nickel string
* Add suggestion to missing field errors
* Fix tests and rename item
* Add snapshot test for field suggestion
* Remove debug println and fix code comment
* Review suggestion: improve missing field error message
* Formatting
* Fix unsound ptr eq check in contract equality
For performance reason, the contract equality checker performs a quick
pointer check to see if the two terms to compare are physically equal.
In this case, it used to return `true` directly, eschewing more costly
recursive checks.
However, this is unsound, because the same term (physically) might be in two
different environments, and have two different values. This is typically
the case with function application: when evaluating `f 1` and `f 2`,
both terms will physically point to the body of `f`, but in a different
environment. Thus, we also need to ensure that environment are equals as
well in this quick check.
This commit adds a fast `ptr_eq` check to the environment as well, and
now checks that both terms and their respective environments are
pairwise physically equals.
Passing by, this commits also fix unrelated clippy warning, after the
udpate to clippy 1.73.
* Add regression test for #1700
* Implement env equality during typechecking
* Cosmetic renaming and slight rework of comments
* Fix contract test by deeply evaluating it
* Remove confusing comments
* Fix contract equality for unevaluated recursive records
The previous code failed when trying to check contracts for equality,
when those contracts had been reverted as part of merging (i.e. when
they recursively depend of other fields of the record), when they are
back to a function form.
To do so, we rely on the already existing behavior that contract
equality consider terms to be open, and that unbound variables are
tested for syntactic equality. Doing so, this commit also simplifies a
lot the previous machinery: we can apply the same idea to the initial
environment, and don't need to thread it through contract equality
checks anymore.
* Cleanup and formatting
* Get rid of NoEnvironment; use empty env instead
* Remove useless explicit instantiations
* Remove debug println
* More explicit names for borrow_ and closure_, improve doc
* Update documentation of eval module
* Use shared_term in eval, return Closure instead of tuple
* Clippy warnings
* Remove old pre-matched_shared! code which caused bad performance
* Formatting
* Remove additional clones
* Remove useless clone
* Get rid of more clones
This rewords the implementation of partial_cmp for Ident and LocalIdent in a way that pleases clippy.
Note that the implementation was correct and that this does not change its behaviour.
* add Closure node to AST
* Implement non-looping partial eq for Term
* Fix contracts app
* Use closure within records as well everywhere
* Fix double closurization
* Fix subst to update closurized attrs
* Fix type eq for closures
* More typecheck eq
* More work + formatting
* Get rid of share normal form + move Closurize to dedicated mod
* Accept new snapshots (error msg less noisy)
* Fix compilation warnings
* Fix various small TODOs left
* Cleaning comments and debug println
* Update documentation for new closurize approach
* Apply suggestions from code review
Co-authored-by: jneem <joeneeman@gmail.com>
* Update core/src/closurize.rs
Co-authored-by: jneem <joeneeman@gmail.com>
* Fix various code comments
* Post-rebase fixup
* Formatting + post-rebase fixup
* Restore array contract dedup fix messed up by rebases
---------
Co-authored-by: jneem <joeneeman@gmail.com>
* Make rustfmt work in match_sharedterm!
macros can have syntax that rustfmt doens't know how to deal with, so it
only triggers on macros that
1. are called with `()` or `[]` delimiters (not `{}`)
2. contain only valid rust syntax
our match_sharedterm! failed on both those counts, so this commit fixes
that. we move the `else` clause back inside the match statement as a
wildcard arm, and use the `match` keyword so that rustfmt understands
how we want the code formatted
* Update core/src/term/mod.rs
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
---------
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
* Extend record_op_kind to insertion and deletion
* Fix compilation errors
* Add specialized builtin contracts
* First take at optimizing static contracts
* Optimizing static contracts, second take
* More documentation
* Do not use has_field_all now that record_insert is fixed
* Apply suggestions from code review
Co-authored-by: jneem <joeneeman@gmail.com>
* Fix clippy warning
* Fix cargo doc warning
* Fix manual snippets check
---------
Co-authored-by: jneem <joeneeman@gmail.com>
* add importing nix files behind a nix-experimental feature flag
* add %eval_nix% builtin to evaluate a nix string
* basic error reporting from nix
* error messages
* use pkg-config to find nix dependency
* nice error message when feature disabled
* better errors
* resolve XXX
* put appropriate dependencies in nativeBuildInputs
* explain -sys crate option
* no %% around builtins in error messages
* clippy needs nativeBuildInputs
* clippy
* fix cargo doc
* use nix master
* c++17 -> c++20
* cargo fmt
* review comments
* fixup after merge
* fix after rebase
* revert to (hopefully) known good nix commit
* try using nix's own nixpkgs
* this worked on build02
* debug for mac CI
* debug doesn't work
* cargo fmt
* debug
* don't fail everything if we can't debug
* debug take N
* nix-version
* remove debug
* disable checks for nix on x86_64-darwin