2021-09-29 20:25:05 +02:00
|
|
|
mod alias;
|
2022-08-26 21:48:48 +02:00
|
|
|
mod ast;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
mod break_;
|
2022-09-09 22:31:32 +02:00
|
|
|
mod commandline;
|
2022-12-21 23:21:03 +01:00
|
|
|
mod const_;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
mod continue_;
|
2021-11-19 06:00:29 +01:00
|
|
|
mod debug;
|
2021-09-29 20:25:05 +02:00
|
|
|
mod def;
|
2022-01-29 21:45:46 +01:00
|
|
|
mod def_env;
|
2021-11-19 06:00:29 +01:00
|
|
|
mod describe;
|
2021-09-29 20:25:05 +02:00
|
|
|
mod do_;
|
2021-11-01 09:12:48 +01:00
|
|
|
mod echo;
|
2022-02-05 15:39:51 +01:00
|
|
|
mod error_make;
|
2021-11-16 00:16:06 +01:00
|
|
|
mod export;
|
2022-03-19 19:58:01 +01:00
|
|
|
mod export_alias;
|
2021-09-29 20:56:59 +02:00
|
|
|
mod export_def;
|
2022-01-29 21:45:46 +01:00
|
|
|
mod export_def_env;
|
2022-03-19 19:58:01 +01:00
|
|
|
mod export_extern;
|
2022-07-29 10:57:10 +02:00
|
|
|
mod export_use;
|
2022-02-11 19:38:10 +01:00
|
|
|
mod extern_;
|
2021-10-09 18:10:46 +02:00
|
|
|
mod for_;
|
2022-07-20 17:09:33 +02:00
|
|
|
pub mod help;
|
2022-12-30 16:44:37 +01:00
|
|
|
pub mod help_aliases;
|
|
|
|
pub mod help_commands;
|
|
|
|
pub mod help_modules;
|
2022-11-27 09:03:17 +01:00
|
|
|
mod help_operators;
|
2021-10-02 19:16:02 +02:00
|
|
|
mod hide;
|
2022-08-13 11:55:06 +02:00
|
|
|
mod hide_env;
|
2021-09-29 20:25:05 +02:00
|
|
|
mod if_;
|
2021-12-30 05:54:33 +01:00
|
|
|
mod ignore;
|
2021-09-29 20:25:05 +02:00
|
|
|
mod let_;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
mod loop_;
|
2021-12-24 01:16:50 +01:00
|
|
|
mod metadata;
|
2021-09-29 20:25:05 +02:00
|
|
|
mod module;
|
2022-11-11 07:51:08 +01:00
|
|
|
mod mut_;
|
2022-05-07 21:39:22 +02:00
|
|
|
pub(crate) mod overlay;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
mod return_;
|
2022-11-24 05:52:11 +01:00
|
|
|
mod try_;
|
2021-09-29 20:25:05 +02:00
|
|
|
mod use_;
|
2021-12-11 21:08:17 +01:00
|
|
|
mod version;
|
2022-11-11 19:21:45 +01:00
|
|
|
mod while_;
|
2021-09-29 20:25:05 +02:00
|
|
|
|
|
|
|
pub use alias::Alias;
|
2022-08-26 21:48:48 +02:00
|
|
|
pub use ast::Ast;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
pub use break_::Break;
|
2022-09-09 22:31:32 +02:00
|
|
|
pub use commandline::Commandline;
|
2022-12-21 23:21:03 +01:00
|
|
|
pub use const_::Const;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
pub use continue_::Continue;
|
2021-11-19 06:00:29 +01:00
|
|
|
pub use debug::Debug;
|
2021-09-29 20:25:05 +02:00
|
|
|
pub use def::Def;
|
2022-01-29 21:45:46 +01:00
|
|
|
pub use def_env::DefEnv;
|
2021-11-19 06:00:29 +01:00
|
|
|
pub use describe::Describe;
|
2021-09-29 20:25:05 +02:00
|
|
|
pub use do_::Do;
|
2021-11-01 09:12:48 +01:00
|
|
|
pub use echo::Echo;
|
2022-02-05 15:39:51 +01:00
|
|
|
pub use error_make::ErrorMake;
|
2021-11-16 00:16:06 +01:00
|
|
|
pub use export::ExportCommand;
|
2022-03-19 19:58:01 +01:00
|
|
|
pub use export_alias::ExportAlias;
|
2021-09-29 20:56:59 +02:00
|
|
|
pub use export_def::ExportDef;
|
2022-01-29 21:45:46 +01:00
|
|
|
pub use export_def_env::ExportDefEnv;
|
2022-03-19 19:58:01 +01:00
|
|
|
pub use export_extern::ExportExtern;
|
2022-07-29 10:57:10 +02:00
|
|
|
pub use export_use::ExportUse;
|
2022-02-11 19:38:10 +01:00
|
|
|
pub use extern_::Extern;
|
2021-10-09 18:10:46 +02:00
|
|
|
pub use for_::For;
|
2021-10-01 23:53:13 +02:00
|
|
|
pub use help::Help;
|
2022-12-30 16:44:37 +01:00
|
|
|
pub use help_aliases::HelpAliases;
|
|
|
|
pub use help_commands::HelpCommands;
|
|
|
|
pub use help_modules::HelpModules;
|
2022-11-27 09:03:17 +01:00
|
|
|
pub use help_operators::HelpOperators;
|
2021-10-02 19:16:02 +02:00
|
|
|
pub use hide::Hide;
|
2022-08-13 11:55:06 +02:00
|
|
|
pub use hide_env::HideEnv;
|
2021-09-29 20:25:05 +02:00
|
|
|
pub use if_::If;
|
2021-12-30 05:54:33 +01:00
|
|
|
pub use ignore::Ignore;
|
2021-09-29 20:25:05 +02:00
|
|
|
pub use let_::Let;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
pub use loop_::Loop;
|
2021-12-24 01:16:50 +01:00
|
|
|
pub use metadata::Metadata;
|
2021-09-29 20:25:05 +02:00
|
|
|
pub use module::Module;
|
2022-11-11 07:51:08 +01:00
|
|
|
pub use mut_::Mut;
|
2022-05-07 21:39:22 +02:00
|
|
|
pub use overlay::*;
|
New commands: `break`, `continue`, `return`, and `loop` (#7230)
# Description
This adds `break`, `continue`, `return`, and `loop`.
* `break` - breaks out a loop
* `continue` - continues a loop at the next iteration
* `return` - early return from a function call
* `loop` - loop forever (until the loop hits a break)
Examples:
```
for i in 1..10 {
if $i == 5 {
continue
}
print $i
}
```
```
for i in 1..10 {
if $i == 5 {
break
}
print $i
}
```
```
def foo [x] {
if true {
return 2
}
$x
}
foo 100
```
```
loop { print "hello, forever" }
```
```
[1, 2, 3, 4, 5] | each {|x|
if $x > 3 { break }
$x
}
```
# User-Facing Changes
Adds the above commands.
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2022-11-24 21:39:16 +01:00
|
|
|
pub use return_::Return;
|
2022-11-24 05:52:11 +01:00
|
|
|
pub use try_::Try;
|
2021-09-29 20:25:05 +02:00
|
|
|
pub use use_::Use;
|
2021-12-11 21:08:17 +01:00
|
|
|
pub use version::Version;
|
2022-11-11 19:21:45 +01:00
|
|
|
pub use while_::While;
|
2021-11-02 21:56:00 +01:00
|
|
|
#[cfg(feature = "plugin")]
|
|
|
|
mod register;
|
|
|
|
|
|
|
|
#[cfg(feature = "plugin")]
|
|
|
|
pub use register::Register;
|