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 if does not work #44

Open
Alex-Lord1 opened this issue Jun 26, 2023 · 0 comments
Open

Else if does not work #44

Alex-Lord1 opened this issue Jun 26, 2023 · 0 comments

Comments

@Alex-Lord1
Copy link

Alex-Lord1 commented Jun 26, 2023

This code is taken from the Stylus documentation

compare(a, b)
  if a > b
    higher
  else if a < b
    lower
  else
    equal

It causes an error "Found an input node of undefined, which had a parent node of {"__type":"If","cond":{"__type":"Expression","lineno":4,"column":15,"filename":null,"nodes":[{"__type":"Expression","lineno":4,"column":15,"filename":null,"nodes":[{"__type":"BinOp","left":{"__type":"Ident","name":"a","val":{"__type":"Null"},"mixin":false,"lineno":4,"column":8,"filename":null},"right":{"__type":"Ident","name":"b","val":{"__type":"Null"},"mixin":false,"lineno":4,"column":13,"filename":null},"op":"<","lineno":4,"column":15,"filename":null}]}]},"elses":[],"negate":{"__type":"Block","scope":false,"lineno":4,"column":15,"filename":null,"nodes":[{"__type":"Ident","name":"lower","val":{"__type":"Null"},"mixin":false,"lineno":4,"column":16,"filename":null}]},"lineno":5,"column":8,"filename":null}"

If you remove

  else if a < b
    lower

Then everything works

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

No branches or pull requests

1 participant