nushell/tests/parsing/samples
YizhePKU 6d2cb4382a
Fix circular source causing Nushell to crash (#12262)
# Description

EngineState now tracks the script currently running, instead of the
parent directory of the script. This also provides an easy way to expose
the current running script to the user (Issue #12195).

Similarly, StateWorkingSet now tracks scripts instead of directories.
`parsed_module_files` and `currently_parsed_pwd` are merged into one
variable, `scripts`, which acts like a stack for tracking the current
running script (which is on the top of the stack).

Circular import check is added for `source` operations, in addition to
module import. A simple testcase is added for circular source.

<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->


<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

It shouldn't have any user facing changes.
2024-04-19 09:38:08 +03:00
..
multiline_end_pipe_win.nu Add more multiline pipeline forms (#4740) 2022-03-05 08:20:13 -05:00
multiline_end_pipe.nu Add more multiline pipeline forms (#4740) 2022-03-05 08:20:13 -05:00
multiline_start_pipe_win.nu Add more multiline pipeline forms (#4740) 2022-03-05 08:20:13 -05:00
multiline_start_pipe.nu Add more multiline pipeline forms (#4740) 2022-03-05 08:20:13 -05:00
single_line.nu Add more multiline pipeline forms (#4740) 2022-03-05 08:20:13 -05:00
source_circular_1.nu Fix circular source causing Nushell to crash (#12262) 2024-04-19 09:38:08 +03:00
source_circular_2.nu Fix circular source causing Nushell to crash (#12262) 2024-04-19 09:38:08 +03:00
source_file_relative.nu Change parser cwd when running a file (#7134) 2022-11-15 00:05:27 +01:00