{"action":"created","issue":{"url":"https://api.github.com/repos/PebbleTemplates/pebble/issues/205","repository_url":"https://api.github.com/repos/PebbleTemplates/pebble","labels_url":"https://api.github.com/repos/PebbleTemplates/pebble/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/PebbleTemplates/pebble/issues/205/comments","events_url":"https://api.github.com/repos/PebbleTemplates/pebble/issues/205/events","html_url":"https://github.com/PebbleTemplates/pebble/issues/205","id":162845546,"number":205,"title":"Logic error with precedence","user":{"login":"nkavian","id":1127421,"avatar_url":"https://avatars.githubusercontent.com/u/1127421?v=3","gravatar_id":"","url":"https://api.github.com/users/nkavian","html_url":"https://github.com/nkavian","followers_url":"https://api.github.com/users/nkavian/followers","following_url":"https://api.github.com/users/nkavian/following{/other_user}","gists_url":"https://api.github.com/users/nkavian/gists{/gist_id}","starred_url":"https://api.github.com/users/nkavian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkavian/subscriptions","organizations_url":"https://api.github.com/users/nkavian/orgs","repos_url":"https://api.github.com/users/nkavian/repos","events_url":"https://api.github.com/users/nkavian/events{/privacy}","received_events_url":"https://api.github.com/users/nkavian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-29T05:45:44Z","updated_at":"2016-09-22T04:15:01Z","closed_at":null,"body":"The two statements below are logically the same.  Pebble only displays XYZ.\r\n\r\n````\r\n{% set a = false %}\r\n{% set b = true %}\r\n{% if not a and not b %}\r\n  XYZ\r\n{% endif %}\r\n{% if (not a) and (not b) %}\r\n  123\r\n{% endif %}\r\n````\r\n\r\nI think Pebble is evaluating `{% if not a and not b %}` as if it were `{% if not (a and not b) %}`\r\n\r\n`not` should take higher precedence over other things like `and`."},"comment":{"url":"https://api.github.com/repos/PebbleTemplates/pebble/issues/comments/248806835","html_url":"https://github.com/PebbleTemplates/pebble/issues/205#issuecomment-248806835","issue_url":"https://api.github.com/repos/PebbleTemplates/pebble/issues/205","id":248806835,"user":{"login":"mbosecke","id":607425,"avatar_url":"https://avatars.githubusercontent.com/u/607425?v=3","gravatar_id":"","url":"https://api.github.com/users/mbosecke","html_url":"https://github.com/mbosecke","followers_url":"https://api.github.com/users/mbosecke/followers","following_url":"https://api.github.com/users/mbosecke/following{/other_user}","gists_url":"https://api.github.com/users/mbosecke/gists{/gist_id}","starred_url":"https://api.github.com/users/mbosecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbosecke/subscriptions","organizations_url":"https://api.github.com/users/mbosecke/orgs","repos_url":"https://api.github.com/users/mbosecke/repos","events_url":"https://api.github.com/users/mbosecke/events{/privacy}","received_events_url":"https://api.github.com/users/mbosecke/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T04:15:01Z","updated_at":"2016-09-22T04:15:01Z","body":"Out of curiosity, I upped the precedence of the `not` operator and ran all of our unit tests. It broke a bunch of tests because this is a common way of using it:\r\n\r\n`{% if not 2 is odd %}`\r\n...\r\n`{% endif %}`\r\n\r\nI.e. it's used to negate a much larger boolean expression. In my opinion, both use cases seem reasonable but I think I like yours a little better. Unfortunately, it was a design decision made back in 2014 so it would break a lot of templates to change it at this point.\r\n\r\nI'll keep this task open to hear more opinions and have it considered for the next major release of Pebble when we're willing to break backwards compatibility. This may not be for a long time."}}
{"actor":{"display_login":"mbosecke"}}