{"action":"created","issue":{"url":"https://api.github.com/repos/csyonghe/Spire/issues/77","repository_url":"https://api.github.com/repos/csyonghe/Spire","labels_url":"https://api.github.com/repos/csyonghe/Spire/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/csyonghe/Spire/issues/77/comments","events_url":"https://api.github.com/repos/csyonghe/Spire/issues/77/events","html_url":"https://github.com/csyonghe/Spire/pull/77","id":197215916,"number":77,"title":"Unify parser handling of declarations","user":{"login":"tfoleyNV","id":10618364,"avatar_url":"https://avatars.githubusercontent.com/u/10618364?v=3","gravatar_id":"","url":"https://api.github.com/users/tfoleyNV","html_url":"https://github.com/tfoleyNV","followers_url":"https://api.github.com/users/tfoleyNV/followers","following_url":"https://api.github.com/users/tfoleyNV/following{/other_user}","gists_url":"https://api.github.com/users/tfoleyNV/gists{/gist_id}","starred_url":"https://api.github.com/users/tfoleyNV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfoleyNV/subscriptions","organizations_url":"https://api.github.com/users/tfoleyNV/orgs","repos_url":"https://api.github.com/users/tfoleyNV/repos","events_url":"https://api.github.com/users/tfoleyNV/events{/privacy}","received_events_url":"https://api.github.com/users/tfoleyNV/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-22T16:44:08Z","updated_at":"2016-12-23T00:09:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/csyonghe/Spire/pulls/77","html_url":"https://github.com/csyonghe/Spire/pull/77","diff_url":"https://github.com/csyonghe/Spire/pull/77.diff","patch_url":"https://github.com/csyonghe/Spire/pull/77.patch"},"body":"Note: this has been tested against the automated tests (such as they are), but not against the engine example (since it seems to be in a state of flux). Let me know if I should try to test against the engine before checking this in.\r\n\r\nThe big picture here is that any flavor of declaration is now allowed in any context where declarations are expected (global scope, body of a `struct`, body of a `shader`, etc.), and also any modifier keywords or attributes are allowed on any declaration (you can declare a `public param int foo;` at global scope).\r\n\r\nIt is (or rather, will be) up to later semantic analysis steps to rule out the cases that shouldn't be allowed, but we know that the parser won't stop us from supporting scenarios like:\r\n\r\n- Global variables\r\n- Member functions in `struct` types\r\n- Having component functions just be functions nested inside shader/module declarations\r\n- Struct declarations local to a module/shader\r\n- Typedefs within functions\r\n- Modules within modules\r\n\r\nYou get the point."},"comment":{"url":"https://api.github.com/repos/csyonghe/Spire/issues/comments/268918362","html_url":"https://github.com/csyonghe/Spire/pull/77#issuecomment-268918362","issue_url":"https://api.github.com/repos/csyonghe/Spire/issues/77","id":268918362,"user":{"login":"tfoleyNV","id":10618364,"avatar_url":"https://avatars.githubusercontent.com/u/10618364?v=3","gravatar_id":"","url":"https://api.github.com/users/tfoleyNV","html_url":"https://github.com/tfoleyNV","followers_url":"https://api.github.com/users/tfoleyNV/followers","following_url":"https://api.github.com/users/tfoleyNV/following{/other_user}","gists_url":"https://api.github.com/users/tfoleyNV/gists{/gist_id}","starred_url":"https://api.github.com/users/tfoleyNV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfoleyNV/subscriptions","organizations_url":"https://api.github.com/users/tfoleyNV/orgs","repos_url":"https://api.github.com/users/tfoleyNV/repos","events_url":"https://api.github.com/users/tfoleyNV/events{/privacy}","received_events_url":"https://api.github.com/users/tfoleyNV/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T00:09:40Z","updated_at":"2016-12-23T00:09:40Z","body":"Just pushed some bug fixes, so this should be clear to merge."}}
{"actor":{"display_login":"tfoleyNV"}}