Skip to content

Commit 6222897

Browse files
committed
Fix
1 parent 9c2364c commit 6222897

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/elements/subword/braced_param.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct BracedParam {
2020
pub name: String,
2121
unknown: String,
2222
is_array: bool,
23+
is_special: bool,
2324
subscript: Option<Subscript>,
2425
has_alternative: bool,
2526
alternative_symbol: Option<String>,
@@ -73,6 +74,10 @@ impl Subword for BracedParam {
7374
}
7475

7576
if self.subscript.is_some() {
77+
if self.is_special {
78+
eprintln!("sush: {}: bad substitution", &self.text);
79+
return false;
80+
}
7681
return self.subscript_operation(core);
7782
}
7883

@@ -292,6 +297,7 @@ impl BracedParam {
292297
if len != 0 {
293298
ans.name = feeder.consume(len);
294299
ans.is_array = ans.name == "@";
300+
ans.is_special = true;
295301
ans.text += &ans.name;
296302
return true;
297303
}

0 commit comments

Comments
 (0)