Get rid of unnecessary grouping operators - #6
Conversation
|
Hey @axion014. Thanks for this and your other commits. I just updated the repo to include tests. Do you suppose you could add a test in Feel free to add simpler .glsl files to the test directory that helps you test your new code. Also add some assertions that validate that no edge-cases or gotchas arise. |
| // remove unnecessary grouping operators | ||
| if(is_unnecessary_group(node)) return | ||
|
|
||
| if(node.parent) for(var current = node.parent; current.parent; current = current.parent) { |
There was a problem hiding this comment.
For stylistic/readability purposes, can you give this if statement braces, and encapsulate the for loop within it?
|
I just found it tricky to get right. For a minifier I would want it to recognize when a operator is commutative. |
|
I updated the tests here as well to be more readable + succinct |
|
Btw, does |
# Conflicts: # tap-snapshots/test-basic.js-TAP.test.js # test/basic.js
It doesn't - |
# Conflicts: # index.js # tap-snapshots/test-basic.js-TAP.test.js # test/basic.js
|
Duh! |
|
Thanks for your time on maintaining this repository. You appear to be going even further, eh? |
Closes #5.