jj/cli
Yuya Nishihara a7bff04af8 revset, templater: implement arity-based alias overloading
Still alias function shadows builtin function (of any arity) by name. This
allows to detect argument error as such, but might be a bit inconvenient if
user wants to overload heads() for example. If needed, maybe we can add some
config/revset syntax to import builtin function to alias namespace.

The functions table is keyed by name, not by (name, arity) pair. That's mainly
because std collections require keys to be Borrow, and a pair of borrowed
values is incompatible with owned pair. Another reason is it makes easy to look
up overloads by name.

Alias overloading could also be achieved by adding default parameters, but that
will complicate the implementation a bit more, and can't prevent shadowing of
0-ary immutable_heads().

Closes #2966
2024-06-14 23:11:29 +09:00
..
examples revset: replace ParseState with &RevsetParseContext 2024-06-05 10:39:32 +09:00
src revset, templater: implement arity-based alias overloading 2024-06-14 23:11:29 +09:00
testing cli: add a fake code formatter tool for testing 2024-06-04 14:28:21 -05:00
tests revset, templater: implement arity-based alias overloading 2024-06-14 23:11:29 +09:00
build.rs build: update rerun-if conditions to watch .git/HEAD in colocated repo 2023-08-06 12:16:11 +09:00
Cargo.toml cli: implement enough of jj fix to run a single tool on all files 2024-06-04 14:28:21 -05:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00