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

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

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

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

nddrylliog opened this issue Dec 30, 2012 · 2 comments

Comments

@nddrylliog
Copy link
Member

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

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
Copy link
Collaborator

alexnask commented Nov 2, 2013

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

horasal added a commit to horasal/rock 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
Projects
None yet
Development

No branches or pull requests

2 participants