{"action":"created","issue":{"url":"https://api.github.com/repos/trentm/json/issues/97","labels_url":"https://api.github.com/repos/trentm/json/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/trentm/json/issues/97/comments","events_url":"https://api.github.com/repos/trentm/json/issues/97/events","html_url":"https://github.com/trentm/json/issues/97","id":119228622,"number":97,"title":"no context for syntax error due to a literal TAB in string","user":{"login":"trentm","id":46866,"avatar_url":"https://avatars.githubusercontent.com/u/46866?v=3","gravatar_id":"","url":"https://api.github.com/users/trentm","html_url":"https://github.com/trentm","followers_url":"https://api.github.com/users/trentm/followers","following_url":"https://api.github.com/users/trentm/following{/other_user}","gists_url":"https://api.github.com/users/trentm/gists{/gist_id}","starred_url":"https://api.github.com/users/trentm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentm/subscriptions","organizations_url":"https://api.github.com/users/trentm/orgs","repos_url":"https://api.github.com/users/trentm/repos","events_url":"https://api.github.com/users/trentm/events{/privacy}","received_events_url":"https://api.github.com/users/trentm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-27T17:30:31Z","updated_at":"2015-11-27T17:57:38Z","closed_at":null,"body":"peterg noticed this. If a JSON file has a literal tab character in a string, that is invalid syntax. However, `json` doesn't give context on the error like it does for other cases.\r\n\r\nSee for the test files: https://gist.github.com/trentm/45940fadbfaace8d2f50\r\n\r\n```\r\n$ json -nf foo.json\r\njson: error: \"foo.json\" is not JSON: SyntaxError: Unexpected token\r\n\r\n$ json -nf comma.json\r\njson: error: \"comma.json\" is not JSON: Unexpected ']' at line 1, column 16:\r\n        [{\"foo\":\"bar\"},]\r\n        ...............^\r\n```\r\n\r\nWhy no context on the error in foo.json that has an illegal literal tab in the string?"},"comment":{"url":"https://api.github.com/repos/trentm/json/issues/comments/160182678","html_url":"https://github.com/trentm/json/issues/97#issuecomment-160182678","issue_url":"https://api.github.com/repos/trentm/json/issues/97","id":160182678,"user":{"login":"trentm","id":46866,"avatar_url":"https://avatars.githubusercontent.com/u/46866?v=3","gravatar_id":"","url":"https://api.github.com/users/trentm","html_url":"https://github.com/trentm","followers_url":"https://api.github.com/users/trentm/followers","following_url":"https://api.github.com/users/trentm/following{/other_user}","gists_url":"https://api.github.com/users/trentm/gists{/gist_id}","starred_url":"https://api.github.com/users/trentm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentm/subscriptions","organizations_url":"https://api.github.com/users/trentm/orgs","repos_url":"https://api.github.com/users/trentm/repos","events_url":"https://api.github.com/users/trentm/events{/privacy}","received_events_url":"https://api.github.com/users/trentm/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T17:57:38Z","updated_at":"2015-11-27T17:57:38Z","body":"The `json_parse` from https://github.com/douglascrockford/JSON-js doesn't balk at the literal TAB. I wonder if it should.\r\n\r\n```\r\n$ ./lib/json.js -nf tab.json\r\nXXX getting detail\r\nXXX json_parse: normBuffer=\"{\\\"foo\\\": \\\"baa\\ttab\\\"}\\n\"\r\nXXX json_parse no exception\r\njson: error: \"tab.json\" is not JSON: SyntaxError: Unexpected token\r\n[09:56:39 trentm@danger0:~/tm/json (master)]\r\n$ ./lib/json.js -nf comma.json\r\nXXX getting detail\r\nXXX json_parse: normBuffer=\"[{\\\"foo\\\":\\\"bar\\\"},]\\n\"\r\nXXX json_parse err { name: 'SyntaxError',\r\n  message: 'Unexpected \\']\\'',\r\n  at: 16,\r\n  text: '[{\"foo\":\"bar\"},]\\n' }\r\njson: error: \"comma.json\" is not JSON: Unexpected ']' at line 1, column 16:\r\n        [{\"foo\":\"bar\"},]\r\n        ...............^\r\n```"}}