diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-03-05 18:25:09 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-07 10:59:51 +0100 |
commit | 13b65b632af48db0bd84d49799dcf22b411a6e24 (patch) | |
tree | 92cb67027f2e38eca70e6f24a31533d881de3beb /Userland/Shell/Parser.h | |
parent | a45b2ea6fb1917de9c2833764f3acf0cdf4e7eab (diff) | |
download | serenity-13b65b632af48db0bd84d49799dcf22b411a6e24.zip |
Shell: Add support for enumerating lists in for loops
With some odd syntax to boot:
```sh
$ for index i x in $whatever {}
```
Diffstat (limited to 'Userland/Shell/Parser.h')
-rw-r--r-- | Userland/Shell/Parser.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Shell/Parser.h b/Userland/Shell/Parser.h index dfc253cfed..4d70ec83ae 100644 --- a/Userland/Shell/Parser.h +++ b/Userland/Shell/Parser.h @@ -207,7 +207,7 @@ control_structure[c] :: for_expr continuation_control :: 'break' | 'continue' -for_expr :: 'for' ws+ (identifier ' '+ 'in' ws*)? expression ws+ '{' [c] toplevel '}' +for_expr :: 'for' ws+ (('index' ' '+ identifier ' '+)? identifier ' '+ 'in' ws*)? expression ws+ '{' [c] toplevel '}' loop_expr :: 'loop' ws* '{' [c] toplevel '}' |