-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed print issue #36
Conversation
lib/print.js
Outdated
// contains a div/mul operation | ||
// e.g x^((x + 1)/(2 + 2)) | ||
if (exponent.args){ | ||
if (exponent.op == 'div' || exponent.op == 'mul'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a space between conditionals the opening brace. See #37. It can't be handled in a separate diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could probably add that to the linter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look great. Requesting a minor change in print.js.
lib/print.js
Outdated
bool = true; | ||
} | ||
} | ||
if (bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to if (isMul(exponent) || isDiv(exponent) {
and define those helper functions as necessary. Then you can get rid of the comment above b/c the intent is clear from the code.
package.json
Outdated
@@ -25,6 +25,8 @@ | |||
"babel-plugin-transform-object-rest-spread": "^6.22.0", | |||
"babel-preset-es2015": "^6.22.0", | |||
"eslint": "^3.15.0", | |||
"eslint-config-google": "^0.7.0", | |||
"eslint-plugin-sort-requires": "^2.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave this out. I'm open to changing lint set up for this repo but we should discuss it first and do it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, fixed!
.eslintrc
Outdated
"node": true, | ||
"mocha": true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was there before the diff and shouldn't be removed.
package.json
Outdated
@@ -24,8 +24,6 @@ | |||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | |||
"babel-plugin-transform-object-rest-spread": "^6.22.0", | |||
"babel-preset-es2015": "^6.22.0", | |||
"eslint": "^3.15.0", | |||
"eslint-plugin-flowtype": "^2.30.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have been removed either.
@aliang8 one last change before this can be merged – please revert changes to package.json. |
@aliang8 for an easy way to revert files to a previous commit see http://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git. |
Looks good. Thanks for fixing this. |
Fixed print to display parentheses around exponents. Added appropriate test cases.