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

Operator Precedence Atom Finder #16

Merged
merged 6 commits into from
Sep 23, 2017
Merged

Conversation

Normand-1024
Copy link
Contributor

Hopefully all is well?

@dgopstein
Copy link
Owner

dgopstein commented Sep 19, 2017

This PR doesn't look like it actually changes the atom at all? Is that right? Also, why are the tests failing?

Otherwise all the code looks fine. Obviously the stuff in redundant-parens.clj is a little messier, but that's your space to do with however you want.

@@ -78,7 +78,9 @@
(order-insensitive-opt-combination (sort combination))

;;SPECIAL CASE 1: Comma operator in any combination;
(some (partial = :comma) combination)))
(some (partial = :comma) combination)
;SPECIAL CASE 2: note that the pair name is not [:bitwise_bin :bitwise-bin]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad you put a comment here, but what does it mean. What's the difference between bitwise_bin, bitwise-bin, and bitwise--bin?

(and (and (= :bitwise_bin node-group)
(= :bitwise_bin (safe-nth child-groups 1)))
(not (= (.getOperator node) (.getOperator (safe-nth child-nodes 1)))))
[[:bitwise--bin :bitwise--bin]]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now I understand, but its still confusing. What about renaming these to like
[[:non-matching-bitwise :non-matching-bitwise]]
or, since it's impossible to ever have only one appear alone, maybe just
[[:non-matching-bitwise]]
or something?

@dgopstein
Copy link
Owner

I'm merging this because it looks like a good fix, but still please consider addressing the comments.

@dgopstein dgopstein merged commit 56f6680 into dgopstein:master Sep 23, 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.

2 participants