{"action":"closed","issue":{"url":"https://api.github.com/repos/SebastianJay/Wilderness/issues/28","repository_url":"https://api.github.com/repos/SebastianJay/Wilderness","labels_url":"https://api.github.com/repos/SebastianJay/Wilderness/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/SebastianJay/Wilderness/issues/28/comments","events_url":"https://api.github.com/repos/SebastianJay/Wilderness/issues/28/events","html_url":"https://github.com/SebastianJay/Wilderness/issues/28","id":181179122,"number":28,"title":"Script Interpreter - functions","user":{"login":"SebastianJay","id":2125991,"avatar_url":"https://avatars.githubusercontent.com/u/2125991?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianJay","html_url":"https://github.com/SebastianJay","followers_url":"https://api.github.com/users/SebastianJay/followers","following_url":"https://api.github.com/users/SebastianJay/following{/other_user}","gists_url":"https://api.github.com/users/SebastianJay/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianJay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianJay/subscriptions","organizations_url":"https://api.github.com/users/SebastianJay/orgs","repos_url":"https://api.github.com/users/SebastianJay/repos","events_url":"https://api.github.com/users/SebastianJay/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianJay/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jerichoi224","id":4184001,"avatar_url":"https://avatars.githubusercontent.com/u/4184001?v=3","gravatar_id":"","url":"https://api.github.com/users/jerichoi224","html_url":"https://github.com/jerichoi224","followers_url":"https://api.github.com/users/jerichoi224/followers","following_url":"https://api.github.com/users/jerichoi224/following{/other_user}","gists_url":"https://api.github.com/users/jerichoi224/gists{/gist_id}","starred_url":"https://api.github.com/users/jerichoi224/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerichoi224/subscriptions","organizations_url":"https://api.github.com/users/jerichoi224/orgs","repos_url":"https://api.github.com/users/jerichoi224/repos","events_url":"https://api.github.com/users/jerichoi224/events{/privacy}","received_events_url":"https://api.github.com/users/jerichoi224/received_events","type":"User","site_admin":false},"assignees":[{"login":"jerichoi224","id":4184001,"avatar_url":"https://avatars.githubusercontent.com/u/4184001?v=3","gravatar_id":"","url":"https://api.github.com/users/jerichoi224","html_url":"https://github.com/jerichoi224","followers_url":"https://api.github.com/users/jerichoi224/followers","following_url":"https://api.github.com/users/jerichoi224/following{/other_user}","gists_url":"https://api.github.com/users/jerichoi224/gists{/gist_id}","starred_url":"https://api.github.com/users/jerichoi224/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerichoi224/subscriptions","organizations_url":"https://api.github.com/users/jerichoi224/orgs","repos_url":"https://api.github.com/users/jerichoi224/repos","events_url":"https://api.github.com/users/jerichoi224/events{/privacy}","received_events_url":"https://api.github.com/users/jerichoi224/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-10-05T14:57:22Z","updated_at":"2016-11-07T20:49:39Z","closed_at":"2016-11-07T20:49:39Z","body":"Recognize functions in our custom scripting language.\n\nFunctions start with $, are followed by a series of words separated by underscores (`title` followed by `args`), possibly followed by a body (`inner`) of the function wrapped in curly brackets. Depending on the actual function, additional processing may be done on the function inner. Example:\n\n```\nSome NPC: What's up?\nSome NPC: How's it going?\n$choice{\n  Hello | \n  Kipp: Hello there! \n  | Go away | \n  Kipp: Don't feel like talking.\n}\n```\n\nWrite a Python function that will parse these custom functions -- it will take in a string containing 0 or more functions interleaved with plaintext and produce a `BodyNode` which is a wrapper around a list, where each list element is either an instance of `LangNode` or `FuncNode`. `LangNode` correponds to possibly formatted text (#27), while `FuncNode` corresponds to a function. In many cases function parsing will be recursive, i.e. the inner will also be a string containing 0 or more functions.\n\n```\nBodyNode:\n  Node[] nodes\nLangNode:\n  string text\n  dict formatting\nFuncNode:\n  string title\n  string[] args\n  object inner  # type depends on title (e.g. choice means list of (LangNode option, BodyNode result) tuples)\n```\n\n`inner` will change depending on function:\n- if, elif, else: `BodyNode result`\n- choice: `(LangNode option, BodyNode result)[]`\n- random: `BodyNode[] result`\n- everything else: None\n\nFor the example above, the return value would be\n\n```\nBodyNode[\n  LangNode(text: 'Some NPC: What's up?', formatting: {}),\n  FuncNode(title: 'choice',\n    args: [],\n    inner: [\n      (LangNode(text: 'Hello', formatting: {}), BodyNode[LangNode(text: 'Kipp: Hello there!', formatting: {})]),\n      (LangNode(text: 'Go away', formatting: {}), BodyNode[LangNode(text: 'Kipp: Don't feel like talking.', formatting: {})])\n    ]\n  )\n]\n```\n"}}
{"actor":{"display_login":"SebastianJay"}}