{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/solidity/issues/3974","repository_url":"https://api.github.com/repos/ethereum/solidity","labels_url":"https://api.github.com/repos/ethereum/solidity/issues/3974/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/3974/comments","events_url":"https://api.github.com/repos/ethereum/solidity/issues/3974/events","html_url":"https://github.com/ethereum/solidity/issues/3974","id":316659881,"number":3974,"title":"Update StateVariableDeclaration Grammar Rule","user":{"login":"sledrho","id":15612641,"avatar_url":"https://avatars0.githubusercontent.com/u/15612641?v=4","gravatar_id":"","url":"https://api.github.com/users/sledrho","html_url":"https://github.com/sledrho","followers_url":"https://api.github.com/users/sledrho/followers","following_url":"https://api.github.com/users/sledrho/following{/other_user}","gists_url":"https://api.github.com/users/sledrho/gists{/gist_id}","starred_url":"https://api.github.com/users/sledrho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledrho/subscriptions","organizations_url":"https://api.github.com/users/sledrho/orgs","repos_url":"https://api.github.com/users/sledrho/repos","events_url":"https://api.github.com/users/sledrho/events{/privacy}","received_events_url":"https://api.github.com/users/sledrho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-23T04:43:08Z","updated_at":"2018-04-23T08:06:49Z","closed_at":null,"author_association":"NONE","body":"The current grammar defines state variable declarations as:\r\n> StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' | 'constant' )? Identifier ('=' Expression)? ';'\r\n\r\nYet the solidity compiler (Version 0.4.23) accepts any of the following:\r\n\r\n         contract test {\r\n               uint constant public MAX_OWNER_COUNT = 50;\r\n               string public constant symbol = \"Example\";\r\n               string public constant name = \"Example String\";\r\n               uint8 public constant decimals = 8;\r\n         }\r\n\r\n\r\nThe grammar explicitly states that there should be zero or one modifiers, thus more than one should not be accepted. Should the grammar then not reflect this and be:\r\n\r\n>StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' | 'constant' )* Identifier ('=' Expression)? ';'\r\n\r\nOR \r\n\r\n>StateVariableDeclaration = TypeName ( 'public | 'internal' | 'private' )? ( 'constant' )? Identifier ('=' Expression)? ';'\r\n\r\nThis was discovered while using the grammar to create my own parser. "},"comment":{"url":"https://api.github.com/repos/ethereum/solidity/issues/comments/383489821","html_url":"https://github.com/ethereum/solidity/issues/3974#issuecomment-383489821","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/3974","id":383489821,"user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars2.githubusercontent.com/u/9073706?v=4","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T08:06:49Z","updated_at":"2018-04-23T08:06:49Z","author_association":"CONTRIBUTOR","body":"Thanks for finding this! Please update the grammar to the first version you mention. It should be similar to what we allow for functions."}}
{"actor":{"display_login":"chriseth"}}