{"action":"created","comment":{"url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/comments/43025005","id":43025005,"diff_hunk":"@@ -0,0 +1,331 @@\n+import { matcher, tokenType } from './common';\n+import { TokenCursor } from './token-cursor';\n+\n+function AtRule(name, parameters, block) {\n+  return { type: 'at-rule', name, parameters, block };\n+}\n+\n+function Comment(value) {\n+  return { type: 'comment', value };\n+}\n+\n+function Block(declarations) {\n+  return { type: 'block', declarations };\n+}\n+\n+function Selector(combinator, block) {\n+  return { type: 'selector', combinator, block };\n+}\n+\n+function Property(name, value) {\n+  return { type: 'property', name, value };\n+}\n+\n+function Value(text) {\n+  return { type: 'value', text };\n+}\n+\n+function ParserError(index, error, ...artifacts) {\n+  return { type: 'parser-error', index, error, artifacts };\n+}\n+\n+function Stylesheet(tokenCursor) {\n+  let declarations = [];\n+\n+  while (tokenCursor.next) {\n+    try {\n+      declarations.push(parseDeclaration(tokenCursor));\n+    } catch (error) {","path":"src/shady-css-parser/parser.js","position":38,"original_position":38,"commit_id":"ce7b3df1f79934e0f758be8786fe39ff40d138ec","original_commit_id":"ce7b3df1f79934e0f758be8786fe39ff40d138ec","user":{"login":"justinfagnani","id":522948,"avatar_url":"https://avatars.githubusercontent.com/u/522948?v=3","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"body":"What exceptions do you expect to encounter here? Since you don't throw anywhere, any exception would seem to be an error in the parser, in which case I'm not sure a AST with a ParseError node is the correct thing to return.","created_at":"2015-10-26T17:29:56Z","updated_at":"2015-10-26T17:29:56Z","html_url":"https://github.com/PolymerLabs/shady-css-parser/pull/1#discussion_r43025005","pull_request_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/comments/43025005"},"html":{"href":"https://github.com/PolymerLabs/shady-css-parser/pull/1#discussion_r43025005"},"pull_request":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1","id":43365340,"html_url":"https://github.com/PolymerLabs/shady-css-parser/pull/1","diff_url":"https://github.com/PolymerLabs/shady-css-parser/pull/1.diff","patch_url":"https://github.com/PolymerLabs/shady-css-parser/pull/1.patch","issue_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/1","number":1,"state":"open","locked":false,"title":"Initial implementation.","user":{"login":"cdata","id":240083,"avatar_url":"https://avatars.githubusercontent.com/u/240083?v=3","gravatar_id":"","url":"https://api.github.com/users/cdata","html_url":"https://github.com/cdata","followers_url":"https://api.github.com/users/cdata/followers","following_url":"https://api.github.com/users/cdata/following{/other_user}","gists_url":"https://api.github.com/users/cdata/gists{/gist_id}","starred_url":"https://api.github.com/users/cdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdata/subscriptions","organizations_url":"https://api.github.com/users/cdata/orgs","repos_url":"https://api.github.com/users/cdata/repos","events_url":"https://api.github.com/users/cdata/events{/privacy}","received_events_url":"https://api.github.com/users/cdata/received_events","type":"User","site_admin":false},"body":" - Hooks could be implemented as dependency injections; arguments passed to the parser factory could hook into different parsing stages.\r\n - No module system was used, but this was done in the interest of not expressing an opinion.\r\n - As a first pass, there is still some fairly messy implementation in places that could stand to be formalized or cleaned up.\r\n - There is at least one known failure case right now: parsing data url values for properties.\r\n - Along the lines of the above failure case, more thorough parsing should be added for `property` and `at-rule` values.\r\n - The parser doesn't attempt to do any whitespace trimming around most values, but it probably should.\r\n - Demo dependencies are pulled in from Polygit, so no `bower install` is required.","created_at":"2015-08-26T05:26:47Z","updated_at":"2015-10-26T17:29:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75e045f23b904de8acf6384849665faf6db8c245","assignee":{"login":"justinfagnani","id":522948,"avatar_url":"https://avatars.githubusercontent.com/u/522948?v=3","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1/commits","review_comments_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1/comments","review_comment_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/1/comments","statuses_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/statuses/ce7b3df1f79934e0f758be8786fe39ff40d138ec","head":{"label":"PolymerLabs:initial-implementation","ref":"initial-implementation","sha":"ce7b3df1f79934e0f758be8786fe39ff40d138ec","user":{"login":"PolymerLabs","id":5912903,"avatar_url":"https://avatars.githubusercontent.com/u/5912903?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerLabs","html_url":"https://github.com/PolymerLabs","followers_url":"https://api.github.com/users/PolymerLabs/followers","following_url":"https://api.github.com/users/PolymerLabs/following{/other_user}","gists_url":"https://api.github.com/users/PolymerLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerLabs/subscriptions","organizations_url":"https://api.github.com/users/PolymerLabs/orgs","repos_url":"https://api.github.com/users/PolymerLabs/repos","events_url":"https://api.github.com/users/PolymerLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":41405911,"name":"shady-css-parser","full_name":"PolymerLabs/shady-css-parser","owner":{"login":"PolymerLabs","id":5912903,"avatar_url":"https://avatars.githubusercontent.com/u/5912903?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerLabs","html_url":"https://github.com/PolymerLabs","followers_url":"https://api.github.com/users/PolymerLabs/followers","following_url":"https://api.github.com/users/PolymerLabs/following{/other_user}","gists_url":"https://api.github.com/users/PolymerLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerLabs/subscriptions","organizations_url":"https://api.github.com/users/PolymerLabs/orgs","repos_url":"https://api.github.com/users/PolymerLabs/repos","events_url":"https://api.github.com/users/PolymerLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerLabs/shady-css-parser","description":"","fork":false,"url":"https://api.github.com/repos/PolymerLabs/shady-css-parser","forks_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/forks","keys_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/teams","hooks_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/hooks","issue_events_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/events","assignees_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/tags","blobs_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/languages","stargazers_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/stargazers","contributors_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/contributors","subscribers_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/subscribers","subscription_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/subscription","commits_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/merges","archive_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/downloads","issues_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/labels{/name}","releases_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/releases{/id}","created_at":"2015-08-26T05:18:33Z","updated_at":"2015-08-26T18:05:00Z","pushed_at":"2015-10-26T17:16:41Z","git_url":"git://github.com/PolymerLabs/shady-css-parser.git","ssh_url":"git@github.com:PolymerLabs/shady-css-parser.git","clone_url":"https://github.com/PolymerLabs/shady-css-parser.git","svn_url":"https://github.com/PolymerLabs/shady-css-parser","homepage":null,"size":188,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PolymerLabs:master","ref":"master","sha":"91e45109713bcc5f0e882b27c34c1b8030dd72a9","user":{"login":"PolymerLabs","id":5912903,"avatar_url":"https://avatars.githubusercontent.com/u/5912903?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerLabs","html_url":"https://github.com/PolymerLabs","followers_url":"https://api.github.com/users/PolymerLabs/followers","following_url":"https://api.github.com/users/PolymerLabs/following{/other_user}","gists_url":"https://api.github.com/users/PolymerLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerLabs/subscriptions","organizations_url":"https://api.github.com/users/PolymerLabs/orgs","repos_url":"https://api.github.com/users/PolymerLabs/repos","events_url":"https://api.github.com/users/PolymerLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":41405911,"name":"shady-css-parser","full_name":"PolymerLabs/shady-css-parser","owner":{"login":"PolymerLabs","id":5912903,"avatar_url":"https://avatars.githubusercontent.com/u/5912903?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerLabs","html_url":"https://github.com/PolymerLabs","followers_url":"https://api.github.com/users/PolymerLabs/followers","following_url":"https://api.github.com/users/PolymerLabs/following{/other_user}","gists_url":"https://api.github.com/users/PolymerLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerLabs/subscriptions","organizations_url":"https://api.github.com/users/PolymerLabs/orgs","repos_url":"https://api.github.com/users/PolymerLabs/repos","events_url":"https://api.github.com/users/PolymerLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerLabs/shady-css-parser","description":"","fork":false,"url":"https://api.github.com/repos/PolymerLabs/shady-css-parser","forks_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/forks","keys_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/teams","hooks_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/hooks","issue_events_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/events","assignees_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/tags","blobs_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/languages","stargazers_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/stargazers","contributors_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/contributors","subscribers_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/subscribers","subscription_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/subscription","commits_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/merges","archive_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/downloads","issues_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/labels{/name}","releases_url":"https://api.github.com/repos/PolymerLabs/shady-css-parser/releases{/id}","created_at":"2015-08-26T05:18:33Z","updated_at":"2015-08-26T18:05:00Z","pushed_at":"2015-10-26T17:16:41Z","git_url":"git://github.com/PolymerLabs/shady-css-parser.git","ssh_url":"git@github.com:PolymerLabs/shady-css-parser.git","clone_url":"https://github.com/PolymerLabs/shady-css-parser.git","svn_url":"https://github.com/PolymerLabs/shady-css-parser","homepage":null,"size":188,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1"},"html":{"href":"https://github.com/PolymerLabs/shady-css-parser/pull/1"},"issue":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/1"},"comments":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/PolymerLabs/shady-css-parser/statuses/ce7b3df1f79934e0f758be8786fe39ff40d138ec"}}}}