{"action":"opened","issue":{"url":"https://api.github.com/repos/metadevpro/ts-pegjs/issues/27","repository_url":"https://api.github.com/repos/metadevpro/ts-pegjs","labels_url":"https://api.github.com/repos/metadevpro/ts-pegjs/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/metadevpro/ts-pegjs/issues/27/comments","events_url":"https://api.github.com/repos/metadevpro/ts-pegjs/issues/27/events","html_url":"https://github.com/metadevpro/ts-pegjs/issues/27","id":374520970,"node_id":"MDU6SXNzdWUzNzQ1MjA5NzA=","number":27,"title":"Allow specifying return types directly in the peg source","user":{"login":"lindner","id":96715,"node_id":"MDQ6VXNlcjk2NzE1","avatar_url":"https://avatars1.githubusercontent.com/u/96715?v=4","gravatar_id":"","url":"https://api.github.com/users/lindner","html_url":"https://github.com/lindner","followers_url":"https://api.github.com/users/lindner/followers","following_url":"https://api.github.com/users/lindner/following{/other_user}","gists_url":"https://api.github.com/users/lindner/gists{/gist_id}","starred_url":"https://api.github.com/users/lindner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindner/subscriptions","organizations_url":"https://api.github.com/users/lindner/orgs","repos_url":"https://api.github.com/users/lindner/repos","events_url":"https://api.github.com/users/lindner/events{/privacy}","received_events_url":"https://api.github.com/users/lindner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-26T19:38:31Z","updated_at":"2018-10-26T19:38:31Z","closed_at":null,"author_association":"NONE","body":"Maintaining the list of output types is a chore and error-prone.\r\n\r\nI would like to propose some enhancements to make this easier.\r\n\r\n1. Allow for adding a Return type of explicit code in action node types.  A simple example would look like this:\r\n\r\n```\r\nInteger \"integer\"\r\n  = _ [0-9]+ { \r\n     return parseInt(text(), 10);\r\n     // @returns number\r\n }\r\n```\r\n\r\nThis would replace the equivalent entry of `{'Integer', 'number'}` in the options.\r\n\r\n2. For a node of type 'choice' return a union type if types for all choices are defined.  For example `Foo = A / B / C` would have a return of `TypeA | TypeB | TypeC` if all choices are typed.\r\n\r\n3. For type 'sequence' return a string type.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"lindner"}}