serenity/Userland/Shell
AnotherTest 3b8fa5a753 Shell: Add support for indexing into variables
Now a variable may have an optional slice (only _one_ slice), which can
also use negative indices to index from the end.
This works on both lists and strings.
The contents of the slice have the same semantics as brace expansions.
For example:
```sh
$ x=(1 2 3 4 5 6)
$ echo $x[1..3] # select indices 1, 2, 3
2 3 4
$ echo $x[3,4,1,0] # select indices 3, 4, 1, 0 (in that order)
4 5 2 1
$ x="Well Hello Friends!"
$ echo $x[5..9]
Hello
```
2021-03-22 13:15:08 +01:00
..
Tests Shell: Add support for enumerating lists in for loops 2021-03-07 10:59:51 +01:00
AST.cpp Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
AST.h Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Builtin.cpp Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
CMakeLists.txt Shell: Add support for 'immediate' expressions as variable substitutions 2021-03-07 10:59:51 +01:00
Execution.h Shell: Move to Userland/Shell/ 2021-01-12 12:04:07 +01:00
Formatter.cpp Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Formatter.h Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Forward.h Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
ImmediateFunctions.cpp Shell: Add support for 'immediate' expressions as variable substitutions 2021-03-07 10:59:51 +01:00
Job.cpp Shell: Move to Userland/Shell/ 2021-01-12 12:04:07 +01:00
Job.h Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
main.cpp Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
NodeVisitor.cpp Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
NodeVisitor.h Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Parser.cpp Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Parser.h Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Shell.cpp Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
Shell.h Shell: Add support for indexing into variables 2021-03-22 13:15:08 +01:00
SyntaxHighlighter.cpp Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
SyntaxHighlighter.h LibSyntax: Make rehighlight() take Gfx::Palette as by const-reference 2021-02-11 23:52:39 +01:00