Skip to content

Commit 6f60259

Browse files
committed
Simplify
1 parent 7a7ec25 commit 6f60259

File tree

3 files changed

+9
-32
lines changed

3 files changed

+9
-32
lines changed

src/elements/command/arithmetic.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,16 @@ impl ArithmeticCommand {
6060
let mut ans = Self::new();
6161
ans.text = feeder.consume(2);
6262

63-
loop {
64-
if let Some(c) = ArithmeticExpr::parse(feeder, core) {
65-
if feeder.starts_with(",") {
66-
ans.text += &c.text;
67-
ans.text += &feeder.consume(1);
68-
ans.expressions.push(c);
69-
continue;
70-
}
71-
72-
if feeder.starts_with("))") {
73-
ans.text += &c.text;
74-
ans.text += &feeder.consume(2);
75-
ans.expressions.push(c);
76-
feeder.pop_backup();
77-
return Some(ans);
78-
}
63+
if let Some(c) = ArithmeticExpr::parse(feeder, core) {
64+
if feeder.starts_with("))") {
65+
ans.text += &c.text;
66+
ans.text += &feeder.consume(2);
67+
ans.expressions.push(c);
68+
feeder.pop_backup();
69+
return Some(ans);
7970
}
80-
feeder.rewind();
81-
return None;
8271
}
72+
feeder.rewind();
73+
return None;
8374
}
8475
}

test/error

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
../test/test_compound.bash
2-
../test/test_others.bash
3-
../test/test_others.bash
4-
../../test/test_others.bash
5-
../../../test/test_others.bash
6-
../../../test/test_others.bash
7-
../../../test/test_others.bash

test/ok

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,3 @@
44
./test_compound.bash
55
./test_others.bash
66
./test_job.bash
7-
../test/test_compound.bash
8-
../test/test_compound.bash
9-
../test/test_compound.bash
10-
../../test/test_others.bash
11-
../../test/test_others.bash
12-
../../../test/test_others.bash
13-
../../../test/test_others.bash

0 commit comments

Comments
 (0)