-
Notifications
You must be signed in to change notification settings - Fork 44
Commit 86abfb4
authored
Fix expressions with multiple operators. (#12)
* Fix expressions with multiple operators.
Expressions such as ``1 +2;`` or ``300*200`` work, but expressions which have multiple operations do not work. For example: ``1+2+3+4`` does not work, and has to be put in a chain of parentheses to get it to work. The other valid expressions are getting evaluated to the value of the first operator, for instance, ``1*2*3`` becomes 2, by evaluating 1*2 and so on.
This can be solved by adding a loop, converting the first two expressions into ``lhs`` and continuing until there are no more ``pair``s.
* Added tests
* Fixed test
Fixed mistake in making assertion of ``1 +たす 2 +たす3 =わ=わ 2+たす2+たす3``
* Style correction.
* Update parser.rs
Yet another attempt to make rustfmt happy.1 parent 6f0d232 commit 86abfb4
1 file changed
+31
-4
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 | - | ||
40 | - | ||
39 | + | ||
40 | + | ||
41 | 41 |
| |
42 | - | ||
43 | - | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
44 | 55 |
| |
45 | 56 |
| |
46 | 57 |
| |
| |||
163 | 174 |
| |
164 | 175 |
| |
165 | 176 |
| |
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | ||
184 | + | ||
185 | + | ||
186 | + | ||
187 | + | ||
188 | + | ||
189 | + | ||
190 | + | ||
191 | + | ||
192 | + | ||
166 | 193 |
|
0 commit comments