{"action":"created","issue":{"url":"https://api.github.com/repos/redox-os/ion/issues/158","repository_url":"https://api.github.com/repos/redox-os/ion","labels_url":"https://api.github.com/repos/redox-os/ion/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/redox-os/ion/issues/158/comments","events_url":"https://api.github.com/repos/redox-os/ion/issues/158/events","html_url":"https://github.com/redox-os/ion/issues/158","id":140581526,"number":158,"title":"if-else does not work properly (regression)","user":{"login":"skylerberg","id":4156131,"avatar_url":"https://avatars.githubusercontent.com/u/4156131?v=3","gravatar_id":"","url":"https://api.github.com/users/skylerberg","html_url":"https://github.com/skylerberg","followers_url":"https://api.github.com/users/skylerberg/followers","following_url":"https://api.github.com/users/skylerberg/following{/other_user}","gists_url":"https://api.github.com/users/skylerberg/gists{/gist_id}","starred_url":"https://api.github.com/users/skylerberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skylerberg/subscriptions","organizations_url":"https://api.github.com/users/skylerberg/orgs","repos_url":"https://api.github.com/users/skylerberg/repos","events_url":"https://api.github.com/users/skylerberg/events{/privacy}","received_events_url":"https://api.github.com/users/skylerberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/redox-os/ion/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-14T05:42:28Z","updated_at":"2016-03-14T20:50:26Z","closed_at":null,"body":"Running this script:\r\n```\r\nif a == a\r\n  echo true a == a\r\n  if b != b\r\n    echo true b != b\r\n  else\r\n    echo false b != b\r\n    if 3 > 2\r\n      echo true 3 > 2\r\n    else\r\n      echo false 3 > 2\r\n    end\r\n  end\r\nelse\r\n  echo false a == a\r\nend\r\n```\r\nResults in:\r\n```\r\ntrue a == a\r\nfalse b != b\r\nNo comparison operator\r\nSyntax error: else found with no previous if\r\nfalse a == a\r\nSyntax error: end found outside of a block\r\n```\r\n\r\nThis is really wrong. \r\n\r\nI think this answer is to move this into the grammar, but it is not going to be easy: https://github.com/redox-os/ion/issues/119. Also, https://github.com/redox-os/ion/issues/66 could have prevented this regression."},"comment":{"url":"https://api.github.com/repos/redox-os/ion/issues/comments/196515936","html_url":"https://github.com/redox-os/ion/issues/158#issuecomment-196515936","issue_url":"https://api.github.com/repos/redox-os/ion/issues/158","id":196515936,"user":{"login":"skylerberg","id":4156131,"avatar_url":"https://avatars.githubusercontent.com/u/4156131?v=3","gravatar_id":"","url":"https://api.github.com/users/skylerberg","html_url":"https://github.com/skylerberg","followers_url":"https://api.github.com/users/skylerberg/followers","following_url":"https://api.github.com/users/skylerberg/following{/other_user}","gists_url":"https://api.github.com/users/skylerberg/gists{/gist_id}","starred_url":"https://api.github.com/users/skylerberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skylerberg/subscriptions","organizations_url":"https://api.github.com/users/skylerberg/orgs","repos_url":"https://api.github.com/users/skylerberg/repos","events_url":"https://api.github.com/users/skylerberg/events{/privacy}","received_events_url":"https://api.github.com/users/skylerberg/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T20:50:26Z","updated_at":"2016-03-14T20:50:26Z","body":"@mmstick Unfortunately, the grammar is a real mess and it is hard to follow. It is in peg.rs and the best documentation for understanding how it works is to read up on Parsing Expression Grammars and rust-peg (a dependencies for Ion).\r\n\r\n@nounoursheureux Ah, that is a good guess."}}