{"action":"created","issue":{"url":"https://api.github.com/repos/ETHproductions/Japt/issues/6","labels_url":"https://api.github.com/repos/ETHproductions/Japt/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ETHproductions/Japt/issues/6/comments","events_url":"https://api.github.com/repos/ETHproductions/Japt/issues/6/events","html_url":"https://github.com/ETHproductions/Japt/pull/6","id":118159859,"number":6,"title":"String.prototype.d and bug fixes: upgraded unicode shortcuts and String.prototype.e","user":{"login":"vihanb","id":15314511,"avatar_url":"https://avatars.githubusercontent.com/u/15314511?v=3","gravatar_id":"","url":"https://api.github.com/users/vihanb","html_url":"https://github.com/vihanb","followers_url":"https://api.github.com/users/vihanb/followers","following_url":"https://api.github.com/users/vihanb/following{/other_user}","gists_url":"https://api.github.com/users/vihanb/gists{/gist_id}","starred_url":"https://api.github.com/users/vihanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vihanb/subscriptions","organizations_url":"https://api.github.com/users/vihanb/orgs","repos_url":"https://api.github.com/users/vihanb/repos","events_url":"https://api.github.com/users/vihanb/events{/privacy}","received_events_url":"https://api.github.com/users/vihanb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-21T01:27:04Z","updated_at":"2015-11-21T19:00:30Z","closed_at":"2015-11-21T02:44:26Z","pull_request":{"url":"https://api.github.com/repos/ETHproductions/Japt/pulls/6","html_url":"https://github.com/ETHproductions/Japt/pull/6","diff_url":"https://github.com/ETHproductions/Japt/pull/6.diff","patch_url":"https://github.com/ETHproductions/Japt/pull/6.patch"},"body":"The last few commits are mostly bug fixes but the unicode shortcuts now has it's own lexer. I've also fixed a bug in one of the functions.\r\n\r\nI've also added a new string function\r\n\r\n---\r\nUnicode shortcuts would replace *within* strings but now that's fixed!\r\n\r\nUnicode shortcuts now uses it's *own separate* lexer to avoid matching within strings. If you want to avoid matching within other structures, the code can be modified. \r\n\r\nBecause this uses it's own lexer, you might want to merge unicode shortcuts in v0.2 to avoid having multiple lexers which could result in slower processing.\r\n\r\n---\r\n\r\nThe bug in `\"\".e` was potentially problematic.\r\n\r\nWhat the code would do was it would do the replace, store in in variable `t`, in the next recursion it would never pass `t` and instead this would pass `this`.\r\n\r\nThis would cause a stack overflow / infinite recursion.\r\n\r\nThe fix was replacing `this` with `t`.\r\n\r\n---\r\n`\"\".d` performs multiple replaces\r\n\r\nIt has two ways of taking inputs:\r\n\r\n1. It can take a string such as `\"azby\"` which will replace all `a`s with `z` and all `b` with `y`\r\n\r\n2. If they are more than one arguments. Than this is essentially like multiple replaces. So: `ab,cd,de,fg` so all `ab` would be replaced with `cd` and all `de` would be replaced with `fg`"},"comment":{"url":"https://api.github.com/repos/ETHproductions/Japt/issues/comments/158672512","html_url":"https://github.com/ETHproductions/Japt/pull/6#issuecomment-158672512","issue_url":"https://api.github.com/repos/ETHproductions/Japt/issues/6","id":158672512,"user":{"login":"vihanb","id":15314511,"avatar_url":"https://avatars.githubusercontent.com/u/15314511?v=3","gravatar_id":"","url":"https://api.github.com/users/vihanb","html_url":"https://github.com/vihanb","followers_url":"https://api.github.com/users/vihanb/followers","following_url":"https://api.github.com/users/vihanb/following{/other_user}","gists_url":"https://api.github.com/users/vihanb/gists{/gist_id}","starred_url":"https://api.github.com/users/vihanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vihanb/subscriptions","organizations_url":"https://api.github.com/users/vihanb/orgs","repos_url":"https://api.github.com/users/vihanb/repos","events_url":"https://api.github.com/users/vihanb/events{/privacy}","received_events_url":"https://api.github.com/users/vihanb/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T19:00:30Z","updated_at":"2015-11-21T19:00:30Z","body":"1e8 sounds good. I'd tried implementing a limit based on string length but that doesn't seem to work, I'll try to add some more conditions (e.g. `code[i] != undefined`) to avoid problems.\n\nUnicode shortcuts are essentially doing find-replace but not inside strings so `@`, ` `, and `)` could all be made into Unicode shortcuts (i.e. `\"@\": \"((X,Y,Z)=>\"`). \n\nAs for the \"\".e bug, if I can't get the recursion method to work a while/for might work better. TeaScript doesn't seem to have any problems with it's implementation so see where I went wrong \n\nHopefully these will fix most of the bugs."}}