{"action":"created","comment":{"url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/comments/236201356","pull_request_review_id":178224848,"id":236201356,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjIwMTM1Ng==","diff_hunk":"@@ -469,13 +472,12 @@ pub fn parse_expr<T: Field>(\n             },\n             Err(err) => Err(err),\n         },\n-        (Token::Ide(x), s1, p1) => match next_token::<T>(&s1, &p1) {\n-            (Token::Open, s2, p2) => parse_function_call(x, s2, p2),\n-            (Token::LeftBracket, s2, p2) => parse_array_select(x, s2, p2),\n-            _ => match parse_term1(Expression::Identifier(x), s1, p1) {\n-                Ok((e2, s2, p2)) => parse_expr1(e2, s2, p2),\n-                Err(err) => Err(err),\n+        (Token::Ide(x), s1, p1) => match parse_identified1(x, s1, p1) {","path":"zokrates_core/src/parser/parse/expression.rs","position":85,"original_position":85,"commit_id":"ab159321deeea148f0b9092d435f610a12f3d000","original_commit_id":"ab159321deeea148f0b9092d435f610a12f3d000","user":{"login":"Schaeff","id":7441798,"node_id":"MDQ6VXNlcjc0NDE3OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/7441798?v=4","gravatar_id":"","url":"https://api.github.com/users/Schaeff","html_url":"https://github.com/Schaeff","followers_url":"https://api.github.com/users/Schaeff/followers","following_url":"https://api.github.com/users/Schaeff/following{/other_user}","gists_url":"https://api.github.com/users/Schaeff/gists{/gist_id}","starred_url":"https://api.github.com/users/Schaeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schaeff/subscriptions","organizations_url":"https://api.github.com/users/Schaeff/orgs","repos_url":"https://api.github.com/users/Schaeff/repos","events_url":"https://api.github.com/users/Schaeff/events{/privacy}","received_events_url":"https://api.github.com/users/Schaeff/received_events","type":"User","site_admin":false},"body":"@GuthL this is the main issue here imo, the one that cause the bug you witnessed: before this change in `parse_expr`, we only run `parse_term1`(which is \"parse term starting with expression x\") when x is an identifier. Otherwise (when x is a function call or an array access), it just returns x. Therefore we end up with `Sub(x, Sub(y, z)) == x - (y - z)` instead of the expected `Sub(Sub(x, y), z) == (x - y) - z`","created_at":"2018-11-26T10:42:21Z","updated_at":"2018-11-26T10:42:21Z","html_url":"https://github.com/Zokrates/ZoKrates/pull/173#discussion_r236201356","pull_request_url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/comments/236201356"},"html":{"href":"https://github.com/Zokrates/ZoKrates/pull/173#discussion_r236201356"},"pull_request":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173","id":233251371,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMjUxMzcx","html_url":"https://github.com/Zokrates/ZoKrates/pull/173","diff_url":"https://github.com/Zokrates/ZoKrates/pull/173.diff","patch_url":"https://github.com/Zokrates/ZoKrates/pull/173.patch","issue_url":"https://api.github.com/repos/Zokrates/ZoKrates/issues/173","number":173,"state":"open","locked":false,"title":"Fix terms precedence","user":{"login":"Schaeff","id":7441798,"node_id":"MDQ6VXNlcjc0NDE3OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/7441798?v=4","gravatar_id":"","url":"https://api.github.com/users/Schaeff","html_url":"https://github.com/Schaeff","followers_url":"https://api.github.com/users/Schaeff/followers","following_url":"https://api.github.com/users/Schaeff/following{/other_user}","gists_url":"https://api.github.com/users/Schaeff/gists{/gist_id}","starred_url":"https://api.github.com/users/Schaeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schaeff/subscriptions","organizations_url":"https://api.github.com/users/Schaeff/orgs","repos_url":"https://api.github.com/users/Schaeff/repos","events_url":"https://api.github.com/users/Schaeff/events{/privacy}","received_events_url":"https://api.github.com/users/Schaeff/received_events","type":"User","site_admin":false},"body":"#167 \r\n\r\nTodo\r\n- [ ] check if we can use `parse_identified1` in `parse_statement` to avoid code rewrite","created_at":"2018-11-23T17:04:24Z","updated_at":"2018-11-26T10:42:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"397b16b59487d77a8a92b3e95b3b96d00d9e4844","assignee":null,"assignees":[],"requested_reviewers":[{"login":"JacobEberhardt","id":4325158,"node_id":"MDQ6VXNlcjQzMjUxNTg=","avatar_url":"https://avatars2.githubusercontent.com/u/4325158?v=4","gravatar_id":"","url":"https://api.github.com/users/JacobEberhardt","html_url":"https://github.com/JacobEberhardt","followers_url":"https://api.github.com/users/JacobEberhardt/followers","following_url":"https://api.github.com/users/JacobEberhardt/following{/other_user}","gists_url":"https://api.github.com/users/JacobEberhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/JacobEberhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JacobEberhardt/subscriptions","organizations_url":"https://api.github.com/users/JacobEberhardt/orgs","repos_url":"https://api.github.com/users/JacobEberhardt/repos","events_url":"https://api.github.com/users/JacobEberhardt/events{/privacy}","received_events_url":"https://api.github.com/users/JacobEberhardt/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173/commits","review_comments_url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173/comments","review_comment_url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Zokrates/ZoKrates/issues/173/comments","statuses_url":"https://api.github.com/repos/Zokrates/ZoKrates/statuses/ab159321deeea148f0b9092d435f610a12f3d000","head":{"label":"Schaeff:fix-terms-precedence","ref":"fix-terms-precedence","sha":"ab159321deeea148f0b9092d435f610a12f3d000","user":{"login":"Schaeff","id":7441798,"node_id":"MDQ6VXNlcjc0NDE3OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/7441798?v=4","gravatar_id":"","url":"https://api.github.com/users/Schaeff","html_url":"https://github.com/Schaeff","followers_url":"https://api.github.com/users/Schaeff/followers","following_url":"https://api.github.com/users/Schaeff/following{/other_user}","gists_url":"https://api.github.com/users/Schaeff/gists{/gist_id}","starred_url":"https://api.github.com/users/Schaeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schaeff/subscriptions","organizations_url":"https://api.github.com/users/Schaeff/orgs","repos_url":"https://api.github.com/users/Schaeff/repos","events_url":"https://api.github.com/users/Schaeff/events{/privacy}","received_events_url":"https://api.github.com/users/Schaeff/received_events","type":"User","site_admin":false},"repo":{"id":110575753,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA1NzU3NTM=","name":"ZoKrates","full_name":"Schaeff/ZoKrates","private":false,"owner":{"login":"Schaeff","id":7441798,"node_id":"MDQ6VXNlcjc0NDE3OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/7441798?v=4","gravatar_id":"","url":"https://api.github.com/users/Schaeff","html_url":"https://github.com/Schaeff","followers_url":"https://api.github.com/users/Schaeff/followers","following_url":"https://api.github.com/users/Schaeff/following{/other_user}","gists_url":"https://api.github.com/users/Schaeff/gists{/gist_id}","starred_url":"https://api.github.com/users/Schaeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schaeff/subscriptions","organizations_url":"https://api.github.com/users/Schaeff/orgs","repos_url":"https://api.github.com/users/Schaeff/repos","events_url":"https://api.github.com/users/Schaeff/events{/privacy}","received_events_url":"https://api.github.com/users/Schaeff/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Schaeff/ZoKrates","description":"A toolbox for zkSNARKS on Ethereum","fork":true,"url":"https://api.github.com/repos/Schaeff/ZoKrates","forks_url":"https://api.github.com/repos/Schaeff/ZoKrates/forks","keys_url":"https://api.github.com/repos/Schaeff/ZoKrates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Schaeff/ZoKrates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Schaeff/ZoKrates/teams","hooks_url":"https://api.github.com/repos/Schaeff/ZoKrates/hooks","issue_events_url":"https://api.github.com/repos/Schaeff/ZoKrates/issues/events{/number}","events_url":"https://api.github.com/repos/Schaeff/ZoKrates/events","assignees_url":"https://api.github.com/repos/Schaeff/ZoKrates/assignees{/user}","branches_url":"https://api.github.com/repos/Schaeff/ZoKrates/branches{/branch}","tags_url":"https://api.github.com/repos/Schaeff/ZoKrates/tags","blobs_url":"https://api.github.com/repos/Schaeff/ZoKrates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Schaeff/ZoKrates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Schaeff/ZoKrates/git/refs{/sha}","trees_url":"https://api.github.com/repos/Schaeff/ZoKrates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Schaeff/ZoKrates/statuses/{sha}","languages_url":"https://api.github.com/repos/Schaeff/ZoKrates/languages","stargazers_url":"https://api.github.com/repos/Schaeff/ZoKrates/stargazers","contributors_url":"https://api.github.com/repos/Schaeff/ZoKrates/contributors","subscribers_url":"https://api.github.com/repos/Schaeff/ZoKrates/subscribers","subscription_url":"https://api.github.com/repos/Schaeff/ZoKrates/subscription","commits_url":"https://api.github.com/repos/Schaeff/ZoKrates/commits{/sha}","git_commits_url":"https://api.github.com/repos/Schaeff/ZoKrates/git/commits{/sha}","comments_url":"https://api.github.com/repos/Schaeff/ZoKrates/comments{/number}","issue_comment_url":"https://api.github.com/repos/Schaeff/ZoKrates/issues/comments{/number}","contents_url":"https://api.github.com/repos/Schaeff/ZoKrates/contents/{+path}","compare_url":"https://api.github.com/repos/Schaeff/ZoKrates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Schaeff/ZoKrates/merges","archive_url":"https://api.github.com/repos/Schaeff/ZoKrates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Schaeff/ZoKrates/downloads","issues_url":"https://api.github.com/repos/Schaeff/ZoKrates/issues{/number}","pulls_url":"https://api.github.com/repos/Schaeff/ZoKrates/pulls{/number}","milestones_url":"https://api.github.com/repos/Schaeff/ZoKrates/milestones{/number}","notifications_url":"https://api.github.com/repos/Schaeff/ZoKrates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Schaeff/ZoKrates/labels{/name}","releases_url":"https://api.github.com/repos/Schaeff/ZoKrates/releases{/id}","deployments_url":"https://api.github.com/repos/Schaeff/ZoKrates/deployments","created_at":"2017-11-13T16:56:27Z","updated_at":"2018-10-28T20:08:39Z","pushed_at":"2018-11-23T17:03:19Z","git_url":"git://github.com/Schaeff/ZoKrates.git","ssh_url":"git@github.com:Schaeff/ZoKrates.git","clone_url":"https://github.com/Schaeff/ZoKrates.git","svn_url":"https://github.com/Schaeff/ZoKrates","homepage":null,"size":6413,"stargazers_count":2,"watchers_count":2,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":3,"open_issues":0,"watchers":2,"default_branch":"develop"}},"base":{"label":"Zokrates:develop","ref":"develop","sha":"82db56cdef464eaaaa135f6ffc5d11f89ec1721c","user":{"login":"Zokrates","id":38394829,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Mzk0ODI5","avatar_url":"https://avatars2.githubusercontent.com/u/38394829?v=4","gravatar_id":"","url":"https://api.github.com/users/Zokrates","html_url":"https://github.com/Zokrates","followers_url":"https://api.github.com/users/Zokrates/followers","following_url":"https://api.github.com/users/Zokrates/following{/other_user}","gists_url":"https://api.github.com/users/Zokrates/gists{/gist_id}","starred_url":"https://api.github.com/users/Zokrates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zokrates/subscriptions","organizations_url":"https://api.github.com/users/Zokrates/orgs","repos_url":"https://api.github.com/users/Zokrates/repos","events_url":"https://api.github.com/users/Zokrates/events{/privacy}","received_events_url":"https://api.github.com/users/Zokrates/received_events","type":"Organization","site_admin":false},"repo":{"id":107952203,"node_id":"MDEwOlJlcG9zaXRvcnkxMDc5NTIyMDM=","name":"ZoKrates","full_name":"Zokrates/ZoKrates","private":false,"owner":{"login":"Zokrates","id":38394829,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Mzk0ODI5","avatar_url":"https://avatars2.githubusercontent.com/u/38394829?v=4","gravatar_id":"","url":"https://api.github.com/users/Zokrates","html_url":"https://github.com/Zokrates","followers_url":"https://api.github.com/users/Zokrates/followers","following_url":"https://api.github.com/users/Zokrates/following{/other_user}","gists_url":"https://api.github.com/users/Zokrates/gists{/gist_id}","starred_url":"https://api.github.com/users/Zokrates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zokrates/subscriptions","organizations_url":"https://api.github.com/users/Zokrates/orgs","repos_url":"https://api.github.com/users/Zokrates/repos","events_url":"https://api.github.com/users/Zokrates/events{/privacy}","received_events_url":"https://api.github.com/users/Zokrates/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Zokrates/ZoKrates","description":"A toolbox for zkSNARKS on Ethereum","fork":false,"url":"https://api.github.com/repos/Zokrates/ZoKrates","forks_url":"https://api.github.com/repos/Zokrates/ZoKrates/forks","keys_url":"https://api.github.com/repos/Zokrates/ZoKrates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zokrates/ZoKrates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zokrates/ZoKrates/teams","hooks_url":"https://api.github.com/repos/Zokrates/ZoKrates/hooks","issue_events_url":"https://api.github.com/repos/Zokrates/ZoKrates/issues/events{/number}","events_url":"https://api.github.com/repos/Zokrates/ZoKrates/events","assignees_url":"https://api.github.com/repos/Zokrates/ZoKrates/assignees{/user}","branches_url":"https://api.github.com/repos/Zokrates/ZoKrates/branches{/branch}","tags_url":"https://api.github.com/repos/Zokrates/ZoKrates/tags","blobs_url":"https://api.github.com/repos/Zokrates/ZoKrates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zokrates/ZoKrates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zokrates/ZoKrates/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zokrates/ZoKrates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zokrates/ZoKrates/statuses/{sha}","languages_url":"https://api.github.com/repos/Zokrates/ZoKrates/languages","stargazers_url":"https://api.github.com/repos/Zokrates/ZoKrates/stargazers","contributors_url":"https://api.github.com/repos/Zokrates/ZoKrates/contributors","subscribers_url":"https://api.github.com/repos/Zokrates/ZoKrates/subscribers","subscription_url":"https://api.github.com/repos/Zokrates/ZoKrates/subscription","commits_url":"https://api.github.com/repos/Zokrates/ZoKrates/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zokrates/ZoKrates/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zokrates/ZoKrates/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zokrates/ZoKrates/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zokrates/ZoKrates/contents/{+path}","compare_url":"https://api.github.com/repos/Zokrates/ZoKrates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zokrates/ZoKrates/merges","archive_url":"https://api.github.com/repos/Zokrates/ZoKrates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zokrates/ZoKrates/downloads","issues_url":"https://api.github.com/repos/Zokrates/ZoKrates/issues{/number}","pulls_url":"https://api.github.com/repos/Zokrates/ZoKrates/pulls{/number}","milestones_url":"https://api.github.com/repos/Zokrates/ZoKrates/milestones{/number}","notifications_url":"https://api.github.com/repos/Zokrates/ZoKrates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zokrates/ZoKrates/labels{/name}","releases_url":"https://api.github.com/repos/Zokrates/ZoKrates/releases{/id}","deployments_url":"https://api.github.com/repos/Zokrates/ZoKrates/deployments","created_at":"2017-10-23T08:18:23Z","updated_at":"2018-11-26T10:28:36Z","pushed_at":"2018-11-26T10:28:33Z","git_url":"git://github.com/Zokrates/ZoKrates.git","ssh_url":"git@github.com:Zokrates/ZoKrates.git","clone_url":"https://github.com/Zokrates/ZoKrates.git","svn_url":"https://github.com/Zokrates/ZoKrates","homepage":null,"size":4678,"stargazers_count":485,"watchers_count":485,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":99,"open_issues":19,"watchers":485,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173"},"html":{"href":"https://github.com/Zokrates/ZoKrates/pull/173"},"issue":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/issues/173"},"comments":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/Zokrates/ZoKrates/statuses/ab159321deeea148f0b9092d435f610a12f3d000"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Schaeff"}}