bracket - support for parentheses calculation #3

Open
alexandre wants to merge 10 commits from bracket into master
First-time contributor

Syntax like this is now fully supported:

$./rust-calc "-2*(2+(2+2))"
-12

Note: From cargo this input will produce error:

$cargo run "-2*(-2+(2+2))"
error: Found argument '-2' which wasn't expected, or isn't valid in this context

	If you tried to supply `-2` as a value rather than a flag, use `-- -2`

USAGE:
    cargo run [OPTIONS] [--] [args]...

For more information try --help

But with the escaper:

cargo run -- "-2*(-2+(2+2))"
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/rust-calc '-2*(-2+(2+2))'`
-4
Syntax like this is now fully supported: ``` $./rust-calc "-2*(2+(2+2))" -12 ``` Note: From cargo this input will produce error: ``` $cargo run "-2*(-2+(2+2))" error: Found argument '-2' which wasn't expected, or isn't valid in this context If you tried to supply `-2` as a value rather than a flag, use `-- -2` USAGE: cargo run [OPTIONS] [--] [args]... For more information try --help ``` But with the escaper: ``` cargo run -- "-2*(-2+(2+2))" Finished dev [unoptimized + debuginfo] target(s) in 0.00s Running `target/debug/rust-calc '-2*(-2+(2+2))'` -4 ```
alexandre added 4 commits 2022-11-13 17:04:14 +00:00
alexandre added 2 commits 2022-11-14 15:42:42 +00:00
alexandre added 1 commit 2022-11-22 20:45:43 +00:00
alexandre added 3 commits 2022-12-12 10:18:14 +00:00
Author
First-time contributor

I did some additional work on it and it's functionnal and tested with 1 set of brackets.
@Max, let me know if you still want to work on this.

I did some additional work on it and it's functionnal and tested with 1 set of brackets. @Max, let me know if you still want to work on this.
alexandre force-pushed bracket from cf9ee27149 to 86f08875a8 2022-12-12 10:23:42 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b bracket master
git pull origin bracket

Step 2:

Merge the changes and update on Forgejo.
git checkout master
git merge --no-ff bracket
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Max/calculette#3
No description provided.