Skip to content
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

Merged
merged 15 commits into from
May 6, 2017
Merged

Fixed print issue #36

merged 15 commits into from
May 6, 2017

Conversation

aliang8
Copy link
Contributor

@aliang8 aliang8 commented May 5, 2017

Fixed print to display parentheses around exponents. Added appropriate test cases.

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'){
Copy link
Member

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.

Copy link
Contributor

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

Copy link
Member

@kevinbarabash kevinbarabash left a 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) {
Copy link
Member

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",
Copy link
Member

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.

Copy link
Contributor Author

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
}
}
Copy link
Member

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",
Copy link
Member

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.

@kevinbarabash
Copy link
Member

@aliang8 one last change before this can be merged – please revert changes to package.json.

@kevinbarabash
Copy link
Member

@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.

@kevinbarabash
Copy link
Member

Looks good. Thanks for fixing this.

@kevinbarabash kevinbarabash merged commit c5392ed into semantic-math:master May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants