Open
Conversation
c6716c2 to
456cebe
Compare
alexkutsan
reviewed
Dec 19, 2019
|
|
||
| std::vector<long double> numbers; | ||
| double rec = 0; | ||
| for(;;) { |
Owner
There was a problem hiding this comment.
this for definitely should be splitted
| } else { //operation | ||
|
|
||
| long double result = numbers[0]; | ||
| for(int i = 1; i < numbers.size(); ++i) { |
Owner
There was a problem hiding this comment.
Start splitting from internal scopes.
| rec = result; | ||
| } | ||
|
|
||
| if(!rc) break; |
|
|
||
| void Parser::parse() | ||
| { | ||
| for(size_t i = 0; i < rawLines.size(); ++i) { |
| currentPosition = i+1; | ||
| //check for operator | ||
| ///TODO: check Factory applicance | ||
| if(rawLines[i] == std::string("+")) { |
Owner
There was a problem hiding this comment.
Looks like good place for factory
| ///TODO: split to different constructors | ||
| Token(const bool is_number, const TOper::Operand opr, const long double num); | ||
| Token(const long double num); | ||
| Token(const TOper::Operand opr); |
Owner
There was a problem hiding this comment.
3 constructs with partial initialization confuses.
| Token(const bool is_number, const TOper::Operand opr, const long double num); | ||
| Token(const long double num); | ||
| Token(const TOper::Operand opr); | ||
| bool is_number(); |
|
|
||
| try { | ||
| if (argc < 2 /*|| argc >= 12*/) { | ||
| show_usage(); |
| } | ||
|
|
||
| std::vector <std::string> sources; | ||
| for (int i = 1; i < argc; ++i) { |
Owner
There was a problem hiding this comment.
I would put htis for in separate function
| ASSERT_EQ(4, stk.getSize()); | ||
|
|
||
| t = stk.pop(rc); | ||
| ASSERT_EQ(1, rc); |
Owner
There was a problem hiding this comment.
Long test. Probably can be splitted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.