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

else on version blocks is buggy if after another else #534

Closed
nddrylliog opened this Issue Dec 30, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@nddrylliog
Member

nddrylliog commented Dec 30, 2012

Example:

version(windows) {
  if (something) {
    // something
  } else {
    // something else
  }
} else {
  // should be equivalent to version(!windows) but isn't
}

The generated code actually has two dangling elses.

nddrylliog added a commit that referenced this issue Dec 30, 2012

@nddrylliog

This comment has been minimized.

Member

nddrylliog commented Nov 2, 2013

In my opinion, else should actually be children nodes of their predecessor. So, the first else should be a children of the if, and the second else should be a children of the version node.

It shouldn't interfere much with our AST transformations, but it should make it a lot clearer what else belongs to what.

@alexnask

This comment has been minimized.

Collaborator

alexnask commented Nov 2, 2013

Agreed, more stuff for .98!
Btw, you are on a roll today!

zhaihj added a commit to zhaihj/rock that referenced this issue Jul 10, 2015

fasterthanlime added a commit that referenced this issue Jul 10, 2015

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