1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-06 01:27:35 +00:00
Commit graph

23 commits

Author SHA1 Message Date
Emanuele Torre
ef782c805f TextEditor+Meta+Ports+Shell: Remove blank lines at the end of some files 2021-01-03 17:12:50 +01:00
AnotherTest
2caf4e66ea Shell: Stop running the backgrounding test
This test is breaking the build all the time, let's just turn it off for
now. we can enable it again once we know it won't fail.
2021-01-02 21:02:15 +01:00
AnotherTest
5e5eb615ec Shell: Add runtime errors and implement break/continue
Such errors are raised when SyntaxError nodes are executed, and are also
used for internal control flow.
The 'break' and 'continue' commands are currently only allowed inside
for loops, and outside function bodies.

This also adds a 'loop' keyword for infinite loops.
2020-12-29 16:55:43 +01:00
AnotherTest
9bd81f34a5 Shell: Make for/match/functions put their variables only in the new scope
Otherwise, a function would, for example, overwrite its parent scope:
```sh
foo(x) { }
x=1
foo 2 # would make x=2 otherwise
```
2020-12-29 16:55:43 +01:00
AnotherTest
1aed61964a Shell: Do not leak the value of ARGV in nested function calls 2020-11-01 18:45:05 +01:00
AnotherTest
1a4ac3531f Shell: Allow parts of globs to be named in match expressions
This patchset allows a match expression to have a list of names for its
glob parts, which are assigned to the matched values in the body of the
match.
For example,
```sh
stuff=foobarblahblah/target_{1..30}
for $stuff {
    match $it {
        */* as (dir sub) {
            echo "doing things with $sub in $dir"
            make -C $dir $sub # or whatever...
        }
    }
}
```

With this, match expressions are now significantly more powerful!
2020-10-29 11:53:01 +01:00
AnotherTest
2d6d1ca67f Shell: Add some basic tests for backgrounding 2020-10-29 11:53:01 +01:00
AnotherTest
f7dbd14a87 Shell: Add some tests for brace expansions 2020-10-25 10:09:27 +01:00
AnotherTest
e94ee08eca Shell: Fix a FIXME in the a test about using functions 2020-09-26 21:28:35 +02:00
AnotherTest
4f223793c0 Shell: Add some tests for 'match' 2020-09-15 20:36:59 +02:00
AnotherTest
b7661dee46 Shell: Add some tests for functions 2020-09-14 17:40:18 +02:00
AnotherTest
519aa2048a Shell: Use a subshell instead of explicitly calling a shell binary in a test
This commit fixes a FIXME in a test, as we have subshells now.
2020-09-14 17:40:18 +02:00
AnotherTest
2488815bdb Shell: Add some tests for subshells 2020-09-09 20:35:21 +02:00
AnotherTest
0fd8d5ad3d Shell: Add a test for control structures as commands 2020-09-09 20:35:21 +02:00
AnotherTest
715e11f692 Shell: Fix job control and backgrounding
This patchset makes the shell capable of lazily resolving and executing
sequences of commands, to allow for putting logical sequences in the
background.
In particular, it enables And/Or/Sequence nodes to be run in the background,
and consequently unmarks them as `would_execute`.
Doing so also fixes job control to an extent, as jobs are now capable of
having 'tails', so sequences can be put in the background while
preserving their following sequences.
2020-09-09 20:35:21 +02:00
AnotherTest
db18e75a09 Shell: Add tests for 'if' 2020-08-22 20:53:21 +02:00
AnotherTest
154ffa3f5f Shell: Add some tests for builtin redirection 2020-08-15 20:48:17 +02:00
Nico Weber
924951e426 Shell: Add test for 37d5e3e0df / #3073 2020-08-13 18:45:39 +02:00
AnotherTest
12af65c1c9 Shell: Add support for ARGV (and $*, $#)
This patchset also adds the 'shift' builtin, as well as the usual tests.
closes #2948.
2020-08-04 13:40:58 +02:00
AnotherTest
07ea2b672b Shell: Tweak tests to use 'echo -n' when newlines are significant 2020-07-30 18:47:41 +02:00
AnotherTest
3b3e90714f Shell: Add tests for '&&' and '||' parsing and evaluation 2020-07-30 18:47:41 +02:00
AnotherTest
2f731150a2 Shell: Add a test for loops 2020-07-16 16:01:10 +02:00
AnotherTest
3a072332f4 Shell: Add some tests 2020-07-05 15:43:14 +02:00