File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -177,10 +177,10 @@ Stdout = ${ "|" ~ !"|" ~ !"&"}
177
177
StdoutStderr = { "|&" }
178
178
179
179
RESERVED_WORD = _{
180
- If | Then | Else | Elif | Fi | Do | Done |
180
+ ( If | Then | Else | Elif | Fi | Done | Do |
181
181
Case | Esac | While | Until | For |
182
182
Lbrace | Rbrace | Bang | In |
183
- StdoutStderr | Stdout
183
+ StdoutStderr | Stdout) ~ &(WHITESPACE | NEWLINE | EOI)
184
184
}
185
185
186
186
// Main grammar rules
Original file line number Diff line number Diff line change @@ -1463,6 +1463,22 @@ async fn test_set() {
1463
1463
. await ;
1464
1464
}
1465
1465
1466
+ #[ tokio:: test]
1467
+ async fn test_reserved_substring ( ) {
1468
+ // Test that there is no panic (prefix-dev/shell#256)
1469
+ TestBuilder :: new ( )
1470
+ . command ( r#"fiqwertymnbvc bla"# )
1471
+ . assert_exit_code ( 127 )
1472
+ . run ( )
1473
+ . await ;
1474
+
1475
+ TestBuilder :: new ( )
1476
+ . command ( r#"forplmoknib bla"# )
1477
+ . assert_exit_code ( 127 )
1478
+ . run ( )
1479
+ . await ;
1480
+ }
1481
+
1466
1482
#[ cfg( test) ]
1467
1483
fn no_such_file_error_text ( ) -> & ' static str {
1468
1484
if cfg ! ( windows) {
You can’t perform that action at this time.
0 commit comments