mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
parent
6a92571a23
commit
4b218d9859
|
@ -16,8 +16,12 @@ or compiled, even if it is not executed:
|
|||
- The `dir-history` command is deprecated. Use `store:dirs` instead.
|
||||
|
||||
- The legacy assignment form is deprecated. Depending on whether the left-hand
|
||||
variable already exists or not, use `var` or `set` instead. There is a
|
||||
dedicated program to help migrate scripts; see https://go.elv.sh/u0.17.
|
||||
variable already exists or not, use `var` or `set` instead. Use the
|
||||
[upgrader](https://go.elv.sh/u0.17) to migrate scripts.
|
||||
|
||||
- The lambda syntax that declares arguments and options within `[]` before `{`
|
||||
has been deprecated. The new syntax now declares arguments and options
|
||||
within a pair of `|`, after `{`.
|
||||
|
||||
# Notable new features
|
||||
|
||||
|
|
|
@ -367,6 +367,9 @@ func (op outputCaptureOp) exec(fm *Frame) ([]interface{}, Exception) {
|
|||
}
|
||||
|
||||
func (cp *compiler) lambda(n *parse.Primary) valuesOp {
|
||||
if n.LegacyLambda {
|
||||
cp.deprecate(n, "legacy lambda syntax is deprecated; migrate scripts with https://go.elv.sh/u0.17", 17)
|
||||
}
|
||||
// Parse signature.
|
||||
var (
|
||||
argNames []string
|
||||
|
|
|
@ -234,3 +234,7 @@ func TestClosure(t *testing.T) {
|
|||
That("[@a @b]{ }").DoesNotCompile(),
|
||||
)
|
||||
}
|
||||
|
||||
func TestClosure_LegacySyntaxIsDeprecated(t *testing.T) {
|
||||
testCompileTimeDeprecation(t, "a = []{ }", "legacy lambda syntax is deprecated", 17)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user