{"action":"created","comment":{"url":"https://api.github.com/repos/catberry/catberry/pulls/comments/33243499","id":33243499,"diff_hunk":"@@ -0,0 +1,281 @@\n+#include <node.h>\n+#include <string>\n+#include <nan.h>\n+#include <stdio.h>\n+#include <iostream>\n+\n+#include \"HTMLTokenizer.h\"\n+\n+using namespace v8;\n+\n+enum STATES {\n+\tILLEGAL = -1,\n+\tINITIAL,\n+\tCONTENT,\n+\tCOMPONENT,\n+\tCOMMENT,\n+\tEND\n+};\n+\n+std::string v8_to_std_string(v8::Local<v8::Value> v8Val) {\n+    String::Utf8Value UtfValue(v8Val->ToString());\n+    std::string str = std::string(*UtfValue);\n+    \n+    return str;\n+}\n+\n+Persistent<Function> HTMLTokenizer::constructor;\n+\n+HTMLTokenizer::~HTMLTokenizer() {\n+}\n+\n+HTMLTokenizer::HTMLTokenizer() {\n+}\n+\n+void HTMLTokenizer::Init(Handle<Object> exports, Handle<Object> module) {\n+    NanScope();\n+\n+    Local<FunctionTemplate> tpl = NanNew<FunctionTemplate>(New);\n+    tpl->SetClassName(NanNew(\"HTMLTokenizer\"));\n+    tpl->InstanceTemplate()->SetInternalFieldCount(3);\n+\n+    NODE_SET_PROTOTYPE_METHOD(tpl, \"setHTMLString\", setHTMLString);\n+    NODE_SET_PROTOTYPE_METHOD(tpl, \"next\", next);\n+    // NODE_SET_PROTOTYPE_METHOD(tpl, \"content\", content);\n+    // NODE_SET_PROTOTYPE_METHOD(tpl, \"component\", component);\n+    // NODE_SET_PROTOTYPE_METHOD(tpl, \"comment\", comment);\n+    // NODE_SET_PROTOTYPE_METHOD(tpl, \"initial\", initial);","path":"src/HTMLTokenizer/HTMLTokenizer.cc","position":47,"original_position":47,"commit_id":"2bb838daf78a8c5ccd98efdebeb8c7901fd89194","original_commit_id":"2bb838daf78a8c5ccd98efdebeb8c7901fd89194","user":{"login":"zarkone","id":1899654,"avatar_url":"https://avatars.githubusercontent.com/u/1899654?v=3","gravatar_id":"","url":"https://api.github.com/users/zarkone","html_url":"https://github.com/zarkone","followers_url":"https://api.github.com/users/zarkone/followers","following_url":"https://api.github.com/users/zarkone/following{/other_user}","gists_url":"https://api.github.com/users/zarkone/gists{/gist_id}","starred_url":"https://api.github.com/users/zarkone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zarkone/subscriptions","organizations_url":"https://api.github.com/users/zarkone/orgs","repos_url":"https://api.github.com/users/zarkone/repos","events_url":"https://api.github.com/users/zarkone/events{/privacy}","received_events_url":"https://api.github.com/users/zarkone/received_events","type":"User","site_admin":false},"body":"just decided to make it hidden from JS, because otherwise it couldn't be simply called from C++ code -- you have to pass specific args from V8 constructor conventions and other staff...","created_at":"2015-06-25T11:05:07Z","updated_at":"2015-06-25T11:05:07Z","html_url":"https://github.com/catberry/catberry/pull/179#discussion_r33243499","pull_request_url":"https://api.github.com/repos/catberry/catberry/pulls/179","_links":{"self":{"href":"https://api.github.com/repos/catberry/catberry/pulls/comments/33243499"},"html":{"href":"https://github.com/catberry/catberry/pull/179#discussion_r33243499"},"pull_request":{"href":"https://api.github.com/repos/catberry/catberry/pulls/179"}}},"pull_request":{"url":"https://api.github.com/repos/catberry/catberry/pulls/179","id":38522749,"html_url":"https://github.com/catberry/catberry/pull/179","diff_url":"https://github.com/catberry/catberry/pull/179.diff","patch_url":"https://github.com/catberry/catberry/pull/179.patch","issue_url":"https://api.github.com/repos/catberry/catberry/issues/179","number":179,"state":"open","locked":false,"title":"C++ html tokenizer","user":{"login":"zarkone","id":1899654,"avatar_url":"https://avatars.githubusercontent.com/u/1899654?v=3","gravatar_id":"","url":"https://api.github.com/users/zarkone","html_url":"https://github.com/zarkone","followers_url":"https://api.github.com/users/zarkone/followers","following_url":"https://api.github.com/users/zarkone/following{/other_user}","gists_url":"https://api.github.com/users/zarkone/gists{/gist_id}","starred_url":"https://api.github.com/users/zarkone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zarkone/subscriptions","organizations_url":"https://api.github.com/users/zarkone/orgs","repos_url":"https://api.github.com/users/zarkone/repos","events_url":"https://api.github.com/users/zarkone/events{/privacy}","received_events_url":"https://api.github.com/users/zarkone/received_events","type":"User","site_admin":false},"body":"C++ version of HTMLTokenizer module.","created_at":"2015-06-25T08:24:33Z","updated_at":"2015-06-25T11:05:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e21d992cbe5e95679cd8a8fe26ff2818abe8f901","assignee":{"login":"pragmadash","id":887952,"avatar_url":"https://avatars.githubusercontent.com/u/887952?v=3","gravatar_id":"","url":"https://api.github.com/users/pragmadash","html_url":"https://github.com/pragmadash","followers_url":"https://api.github.com/users/pragmadash/followers","following_url":"https://api.github.com/users/pragmadash/following{/other_user}","gists_url":"https://api.github.com/users/pragmadash/gists{/gist_id}","starred_url":"https://api.github.com/users/pragmadash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pragmadash/subscriptions","organizations_url":"https://api.github.com/users/pragmadash/orgs","repos_url":"https://api.github.com/users/pragmadash/repos","events_url":"https://api.github.com/users/pragmadash/events{/privacy}","received_events_url":"https://api.github.com/users/pragmadash/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/catberry/catberry/pulls/179/commits","review_comments_url":"https://api.github.com/repos/catberry/catberry/pulls/179/comments","review_comment_url":"https://api.github.com/repos/catberry/catberry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/catberry/catberry/issues/179/comments","statuses_url":"https://api.github.com/repos/catberry/catberry/statuses/2bb838daf78a8c5ccd98efdebeb8c7901fd89194","head":{"label":"zarkone:c++-html-tokenizer","ref":"c++-html-tokenizer","sha":"2bb838daf78a8c5ccd98efdebeb8c7901fd89194","user":{"login":"zarkone","id":1899654,"avatar_url":"https://avatars.githubusercontent.com/u/1899654?v=3","gravatar_id":"","url":"https://api.github.com/users/zarkone","html_url":"https://github.com/zarkone","followers_url":"https://api.github.com/users/zarkone/followers","following_url":"https://api.github.com/users/zarkone/following{/other_user}","gists_url":"https://api.github.com/users/zarkone/gists{/gist_id}","starred_url":"https://api.github.com/users/zarkone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zarkone/subscriptions","organizations_url":"https://api.github.com/users/zarkone/orgs","repos_url":"https://api.github.com/users/zarkone/repos","events_url":"https://api.github.com/users/zarkone/events{/privacy}","received_events_url":"https://api.github.com/users/zarkone/received_events","type":"User","site_admin":false},"repo":{"id":38035032,"name":"catberry","full_name":"zarkone/catberry","owner":{"login":"zarkone","id":1899654,"avatar_url":"https://avatars.githubusercontent.com/u/1899654?v=3","gravatar_id":"","url":"https://api.github.com/users/zarkone","html_url":"https://github.com/zarkone","followers_url":"https://api.github.com/users/zarkone/followers","following_url":"https://api.github.com/users/zarkone/following{/other_user}","gists_url":"https://api.github.com/users/zarkone/gists{/gist_id}","starred_url":"https://api.github.com/users/zarkone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zarkone/subscriptions","organizations_url":"https://api.github.com/users/zarkone/orgs","repos_url":"https://api.github.com/users/zarkone/repos","events_url":"https://api.github.com/users/zarkone/events{/privacy}","received_events_url":"https://api.github.com/users/zarkone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zarkone/catberry","description":"Catberry is a framework with Flux architecture, isomorphic web-components and progressive rendering.","fork":true,"url":"https://api.github.com/repos/zarkone/catberry","forks_url":"https://api.github.com/repos/zarkone/catberry/forks","keys_url":"https://api.github.com/repos/zarkone/catberry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zarkone/catberry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zarkone/catberry/teams","hooks_url":"https://api.github.com/repos/zarkone/catberry/hooks","issue_events_url":"https://api.github.com/repos/zarkone/catberry/issues/events{/number}","events_url":"https://api.github.com/repos/zarkone/catberry/events","assignees_url":"https://api.github.com/repos/zarkone/catberry/assignees{/user}","branches_url":"https://api.github.com/repos/zarkone/catberry/branches{/branch}","tags_url":"https://api.github.com/repos/zarkone/catberry/tags","blobs_url":"https://api.github.com/repos/zarkone/catberry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zarkone/catberry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zarkone/catberry/git/refs{/sha}","trees_url":"https://api.github.com/repos/zarkone/catberry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zarkone/catberry/statuses/{sha}","languages_url":"https://api.github.com/repos/zarkone/catberry/languages","stargazers_url":"https://api.github.com/repos/zarkone/catberry/stargazers","contributors_url":"https://api.github.com/repos/zarkone/catberry/contributors","subscribers_url":"https://api.github.com/repos/zarkone/catberry/subscribers","subscription_url":"https://api.github.com/repos/zarkone/catberry/subscription","commits_url":"https://api.github.com/repos/zarkone/catberry/commits{/sha}","git_commits_url":"https://api.github.com/repos/zarkone/catberry/git/commits{/sha}","comments_url":"https://api.github.com/repos/zarkone/catberry/comments{/number}","issue_comment_url":"https://api.github.com/repos/zarkone/catberry/issues/comments{/number}","contents_url":"https://api.github.com/repos/zarkone/catberry/contents/{+path}","compare_url":"https://api.github.com/repos/zarkone/catberry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zarkone/catberry/merges","archive_url":"https://api.github.com/repos/zarkone/catberry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zarkone/catberry/downloads","issues_url":"https://api.github.com/repos/zarkone/catberry/issues{/number}","pulls_url":"https://api.github.com/repos/zarkone/catberry/pulls{/number}","milestones_url":"https://api.github.com/repos/zarkone/catberry/milestones{/number}","notifications_url":"https://api.github.com/repos/zarkone/catberry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zarkone/catberry/labels{/name}","releases_url":"https://api.github.com/repos/zarkone/catberry/releases{/id}","created_at":"2015-06-25T07:34:06Z","updated_at":"2015-06-25T07:34:07Z","pushed_at":"2015-06-25T08:53:31Z","git_url":"git://github.com/zarkone/catberry.git","ssh_url":"git@github.com:zarkone/catberry.git","clone_url":"https://github.com/zarkone/catberry.git","svn_url":"https://github.com/zarkone/catberry","homepage":"http://catberry.org","size":3984,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"catberry:performance-tweaks","ref":"performance-tweaks","sha":"f2cf79f824527bbf137c1dd6eac47d283f5150bc","user":{"login":"catberry","id":8207786,"avatar_url":"https://avatars.githubusercontent.com/u/8207786?v=3","gravatar_id":"","url":"https://api.github.com/users/catberry","html_url":"https://github.com/catberry","followers_url":"https://api.github.com/users/catberry/followers","following_url":"https://api.github.com/users/catberry/following{/other_user}","gists_url":"https://api.github.com/users/catberry/gists{/gist_id}","starred_url":"https://api.github.com/users/catberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catberry/subscriptions","organizations_url":"https://api.github.com/users/catberry/orgs","repos_url":"https://api.github.com/users/catberry/repos","events_url":"https://api.github.com/users/catberry/events{/privacy}","received_events_url":"https://api.github.com/users/catberry/received_events","type":"Organization","site_admin":false},"repo":{"id":17735839,"name":"catberry","full_name":"catberry/catberry","owner":{"login":"catberry","id":8207786,"avatar_url":"https://avatars.githubusercontent.com/u/8207786?v=3","gravatar_id":"","url":"https://api.github.com/users/catberry","html_url":"https://github.com/catberry","followers_url":"https://api.github.com/users/catberry/followers","following_url":"https://api.github.com/users/catberry/following{/other_user}","gists_url":"https://api.github.com/users/catberry/gists{/gist_id}","starred_url":"https://api.github.com/users/catberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catberry/subscriptions","organizations_url":"https://api.github.com/users/catberry/orgs","repos_url":"https://api.github.com/users/catberry/repos","events_url":"https://api.github.com/users/catberry/events{/privacy}","received_events_url":"https://api.github.com/users/catberry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/catberry/catberry","description":"Catberry is a framework with Flux architecture, isomorphic web-components and progressive rendering.","fork":false,"url":"https://api.github.com/repos/catberry/catberry","forks_url":"https://api.github.com/repos/catberry/catberry/forks","keys_url":"https://api.github.com/repos/catberry/catberry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catberry/catberry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catberry/catberry/teams","hooks_url":"https://api.github.com/repos/catberry/catberry/hooks","issue_events_url":"https://api.github.com/repos/catberry/catberry/issues/events{/number}","events_url":"https://api.github.com/repos/catberry/catberry/events","assignees_url":"https://api.github.com/repos/catberry/catberry/assignees{/user}","branches_url":"https://api.github.com/repos/catberry/catberry/branches{/branch}","tags_url":"https://api.github.com/repos/catberry/catberry/tags","blobs_url":"https://api.github.com/repos/catberry/catberry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catberry/catberry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catberry/catberry/git/refs{/sha}","trees_url":"https://api.github.com/repos/catberry/catberry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catberry/catberry/statuses/{sha}","languages_url":"https://api.github.com/repos/catberry/catberry/languages","stargazers_url":"https://api.github.com/repos/catberry/catberry/stargazers","contributors_url":"https://api.github.com/repos/catberry/catberry/contributors","subscribers_url":"https://api.github.com/repos/catberry/catberry/subscribers","subscription_url":"https://api.github.com/repos/catberry/catberry/subscription","commits_url":"https://api.github.com/repos/catberry/catberry/commits{/sha}","git_commits_url":"https://api.github.com/repos/catberry/catberry/git/commits{/sha}","comments_url":"https://api.github.com/repos/catberry/catberry/comments{/number}","issue_comment_url":"https://api.github.com/repos/catberry/catberry/issues/comments{/number}","contents_url":"https://api.github.com/repos/catberry/catberry/contents/{+path}","compare_url":"https://api.github.com/repos/catberry/catberry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catberry/catberry/merges","archive_url":"https://api.github.com/repos/catberry/catberry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catberry/catberry/downloads","issues_url":"https://api.github.com/repos/catberry/catberry/issues{/number}","pulls_url":"https://api.github.com/repos/catberry/catberry/pulls{/number}","milestones_url":"https://api.github.com/repos/catberry/catberry/milestones{/number}","notifications_url":"https://api.github.com/repos/catberry/catberry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catberry/catberry/labels{/name}","releases_url":"https://api.github.com/repos/catberry/catberry/releases{/id}","created_at":"2014-03-14T04:57:35Z","updated_at":"2015-06-25T04:54:41Z","pushed_at":"2015-06-25T08:53:32Z","git_url":"git://github.com/catberry/catberry.git","ssh_url":"git@github.com:catberry/catberry.git","clone_url":"https://github.com/catberry/catberry.git","svn_url":"https://github.com/catberry/catberry","homepage":"http://catberry.org","size":3984,"stargazers_count":335,"watchers_count":335,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":2,"forks":18,"open_issues":2,"watchers":335,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/catberry/catberry/pulls/179"},"html":{"href":"https://github.com/catberry/catberry/pull/179"},"issue":{"href":"https://api.github.com/repos/catberry/catberry/issues/179"},"comments":{"href":"https://api.github.com/repos/catberry/catberry/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/catberry/catberry/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/catberry/catberry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/catberry/catberry/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/catberry/catberry/statuses/2bb838daf78a8c5ccd98efdebeb8c7901fd89194"}}}}