{"action":"created","issue":{"url":"https://api.github.com/repos/adventuregamestudio/ags/issues/323","repository_url":"https://api.github.com/repos/adventuregamestudio/ags","labels_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/323/comments","events_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/323/events","html_url":"https://github.com/adventuregamestudio/ags/pull/323","id":147223423,"number":323,"title":"Scripting: Struct namespacing","user":{"login":"gurok","id":4116829,"avatar_url":"https://avatars.githubusercontent.com/u/4116829?v=3","gravatar_id":"","url":"https://api.github.com/users/gurok","html_url":"https://github.com/gurok","followers_url":"https://api.github.com/users/gurok/followers","following_url":"https://api.github.com/users/gurok/following{/other_user}","gists_url":"https://api.github.com/users/gurok/gists{/gist_id}","starred_url":"https://api.github.com/users/gurok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurok/subscriptions","organizations_url":"https://api.github.com/users/gurok/orgs","repos_url":"https://api.github.com/users/gurok/repos","events_url":"https://api.github.com/users/gurok/events{/privacy}","received_events_url":"https://api.github.com/users/gurok/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/adventuregamestudio/ags/labels/pull:%20under%20review","name":"pull: under review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/adventuregamestudio/ags/milestones/1","html_url":"https://github.com/adventuregamestudio/ags/milestones/3.4.0","labels_url":"https://api.github.com/repos/adventuregamestudio/ags/milestones/1/labels","id":825163,"number":1,"title":"3.4.0","description":"A proposed set of tasks for 3.4.0 release (branch \"develop-3.4.0\").","creator":{"login":"ivan-mogilko","id":1833754,"avatar_url":"https://avatars.githubusercontent.com/u/1833754?v=3","gravatar_id":"","url":"https://api.github.com/users/ivan-mogilko","html_url":"https://github.com/ivan-mogilko","followers_url":"https://api.github.com/users/ivan-mogilko/followers","following_url":"https://api.github.com/users/ivan-mogilko/following{/other_user}","gists_url":"https://api.github.com/users/ivan-mogilko/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan-mogilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan-mogilko/subscriptions","organizations_url":"https://api.github.com/users/ivan-mogilko/orgs","repos_url":"https://api.github.com/users/ivan-mogilko/repos","events_url":"https://api.github.com/users/ivan-mogilko/events{/privacy}","received_events_url":"https://api.github.com/users/ivan-mogilko/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":7,"state":"open","created_at":"2014-10-14T07:57:17Z","updated_at":"2016-04-10T14:47:10Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-04-10T12:59:35Z","updated_at":"2016-04-10T17:22:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/adventuregamestudio/ags/pulls/323","html_url":"https://github.com/adventuregamestudio/ags/pull/323","diff_url":"https://github.com/adventuregamestudio/ags/pull/323.diff","patch_url":"https://github.com/adventuregamestudio/ags/pull/323.patch"},"body":"Continuing the work here:\r\nhttps://github.com/adventuregamestudio/ags/pull/154\r\n\r\nAnd addressing concerns here:\r\nhttp://www.adventuregamestudio.co.uk/forums/index.php?issue=361.0\r\n\r\nI see two other situations where global names might conflict with struct member names.\r\n1. A struct member has the same name as a global variable, e.g. a GUI\r\n2. A struct member has the same name as a type, e.g. `function MyStruct::Object()`\r\n\r\nThis is an attempt to tidy up the namespacing of struct members and allow for both of these cases. \r\n\r\nAllowing global variables was easy to achieve. Most namespacing is done at the tokenise step. We just needed to allow tokens of that type to be prefixed with the struct name.\r\n\r\nAllowing type names had to happen later in the process (during parsing). It's not known at the point of tokenisation whether someone means `Object` as a return type or `Object` as a method name. Furthermore, it's not clear in some cases what the purpose of such a token is until after we've determined that it's an extender method.\r\n\r\nEven though it's technically possible, for the purposes of language clarity, I've left language elements like `for` and `if` disallowed as member names. Similarly, primitive types like `int` and `float` are rejected.\r\n\r\nThese are the only remaining namespacing issues I could think of. If there are any more that come to mind, please mention them here and I'll amend this pull request to allow them.\r\n\r\nAlso, general disclaimer, I don't think this is best merged until after the 3.3.x->3.4.0 merge is complete."},"comment":{"url":"https://api.github.com/repos/adventuregamestudio/ags/issues/comments/208020406","html_url":"https://github.com/adventuregamestudio/ags/pull/323#issuecomment-208020406","issue_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/323","id":208020406,"user":{"login":"ivan-mogilko","id":1833754,"avatar_url":"https://avatars.githubusercontent.com/u/1833754?v=3","gravatar_id":"","url":"https://api.github.com/users/ivan-mogilko","html_url":"https://github.com/ivan-mogilko","followers_url":"https://api.github.com/users/ivan-mogilko/followers","following_url":"https://api.github.com/users/ivan-mogilko/following{/other_user}","gists_url":"https://api.github.com/users/ivan-mogilko/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan-mogilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan-mogilko/subscriptions","organizations_url":"https://api.github.com/users/ivan-mogilko/orgs","repos_url":"https://api.github.com/users/ivan-mogilko/repos","events_url":"https://api.github.com/users/ivan-mogilko/events{/privacy}","received_events_url":"https://api.github.com/users/ivan-mogilko/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T17:22:47Z","updated_at":"2016-04-10T17:22:47Z","body":"I guess these are okay, thank you."}}