{"action":"created","issue":{"url":"https://api.github.com/repos/aseemk/json5/issues/106","repository_url":"https://api.github.com/repos/aseemk/json5","labels_url":"https://api.github.com/repos/aseemk/json5/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/aseemk/json5/issues/106/comments","events_url":"https://api.github.com/repos/aseemk/json5/issues/106/events","html_url":"https://github.com/aseemk/json5/issues/106","id":125411316,"number":106,"title":"Add support for mathematical operations in values","user":{"login":"XGHeaven","id":9291212,"avatar_url":"https://avatars.githubusercontent.com/u/9291212?v=3","gravatar_id":"","url":"https://api.github.com/users/XGHeaven","html_url":"https://github.com/XGHeaven","followers_url":"https://api.github.com/users/XGHeaven/followers","following_url":"https://api.github.com/users/XGHeaven/following{/other_user}","gists_url":"https://api.github.com/users/XGHeaven/gists{/gist_id}","starred_url":"https://api.github.com/users/XGHeaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XGHeaven/subscriptions","organizations_url":"https://api.github.com/users/XGHeaven/orgs","repos_url":"https://api.github.com/users/XGHeaven/repos","events_url":"https://api.github.com/users/XGHeaven/events{/privacy}","received_events_url":"https://api.github.com/users/XGHeaven/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aseemk/json5/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/aseemk/json5/labels/pull-request-welcome","name":"pull-request-welcome","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-01-07T15:08:09Z","updated_at":"2016-03-15T22:19:45Z","closed_at":null,"body":"demo follow\r\n```javascript\r\n{\r\n    num1: 1*2*3,\r\n    num2: 1*2%3,\r\n    num3: 3 / 2,\r\n    num4: 3 << 1,\r\n    num5: 2**3\r\n}\r\n```\r\nthe result is\r\n```javascript\r\n{\r\n    num1: 6,\r\n    num2: 2,\r\n    num3: 1.5\r\n    num4: 6,\r\n    num5: 8\r\n}\r\n```\r\n\r\nthe follow operator should be supported:\r\n- `*`\r\n- `/`\r\n- `+`\r\n- `-`\r\n- `%`\r\n\r\nothers I hope also:\r\n- `**`\r\n- `>>`\r\n- `<<`\r\n- `<<<`\r\n- `>>>`\r\n- `//`? divisible operator or `///`\r\n\r\nWhat think about yours??"},"comment":{"url":"https://api.github.com/repos/aseemk/json5/issues/comments/197050534","html_url":"https://github.com/aseemk/json5/issues/106#issuecomment-197050534","issue_url":"https://api.github.com/repos/aseemk/json5/issues/106","id":197050534,"user":{"login":"jordanbtucker","id":468153,"avatar_url":"https://avatars.githubusercontent.com/u/468153?v=3","gravatar_id":"","url":"https://api.github.com/users/jordanbtucker","html_url":"https://github.com/jordanbtucker","followers_url":"https://api.github.com/users/jordanbtucker/followers","following_url":"https://api.github.com/users/jordanbtucker/following{/other_user}","gists_url":"https://api.github.com/users/jordanbtucker/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanbtucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanbtucker/subscriptions","organizations_url":"https://api.github.com/users/jordanbtucker/orgs","repos_url":"https://api.github.com/users/jordanbtucker/repos","events_url":"https://api.github.com/users/jordanbtucker/events{/privacy}","received_events_url":"https://api.github.com/users/jordanbtucker/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T22:19:45Z","updated_at":"2016-03-15T22:19:45Z","body":"@piranna \r\n> Lol :-P Yes, there are parallels because it depends on the concepts of \"what is data\" and \"what is executable code\". After parsing we would get respectively a number or a RegExp object that both are not executables by themselves (a RegExp is a description that can be used to find some data, the same way a number can be used as an index on an array), so I would accept both. I would not accept functions because if they get parsed they are executables \"as is\", and there's almost no way to sanitize them and know they are secure (a RegExp could be bad written, but it's not a security thread or could erase data by itself...).\r\n\r\nSupporting functions is not just about security. You would have to expect the JSON5 parser be able to parse functions and implementations to be able to represent those functions on their native platforms. If someone wants to implement functions in JSON or JSON5, they might as well write a transpiler for ES5 into *every other programming language*.\r\n\r\nRegarding regular expressions, I wrote a [little more](https://github.com/aseemk/json5/issues/91#issuecomment-197048166) about the subject. "}}