Remove NOT in IfStatement with EmptyStatement (-s) #408

Merged
merged 1 commit into from Jun 5, 2012

Conversation

Projects
None yet
2 participants
@RGustBardon
Contributor

RGustBardon commented Jun 5, 2012

If the only statement of a nonterminal IfStatement is a nonterminal
EmptyStatement or a nonterminal IfStatement consists of two
nonterminal EmptyStatement symbols, such a statement is transformed
into a nonterminal ExpressionStatement that consists of a
UnaryExpression with the logical NOT operator and the expression found
in the nonterminal IfStatement. The operator in question is
superfluous.

This patch omits the negation by detecting the described case earlier.

Remove NOT in IfStatement with EmptyStatement (-s)
If the only statement of a nonterminal IfStatement is a nonterminal
EmptyStatement or a nonterminal IfStatement consists of two
nonterminal EmptyStatement symbols, such a statement is transformed
into a nonterminal ExpressionStatement that consists of a
UnaryExpression with the logical NOT operator and the expression found
in the nonterminal IfStatement.  The operator in question is
superfluous.

This patch omits the negation by detecting the described case earlier.

mishoo added a commit that referenced this pull request Jun 5, 2012

Merge pull request #408 from RGustBardon/if-not
Remove NOT in IfStatement with EmptyStatement (-s)

@mishoo mishoo merged commit 4c72a63 into mishoo:master Jun 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment