{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/26340365","id":26340365,"diff_hunk":"@@ -254,15 +255,20 @@ def tokenize(self):\n         \"\"\"\n         Return a list of tokens from a given template_string.\n         \"\"\"\n-        in_tag = False\n-        result = []\n-        for bit in tag_re.split(self.template_string):\n-            if bit:\n-                result.append(self.create_token(bit, in_tag))\n-            in_tag = not in_tag\n+        result, upto = [], 0\n+        for match in tag_re.finditer(self.template_string):\n+            start, end = match.span()\n+            if start > upto:\n+                result.append(self.create_token(self.template_string[upto:start], (upto, start), False))\n+                upto = start\n+            result.append(self.create_token(self.template_string[start:end], (start, end), True))\n+            upto = end\n+        last_bit = self.template_string[upto:]\n+        if last_bit:\n+            result.append(self.create_token(last_bit, (upto, upto + len(last_bit)), False))","path":"django/template/base.py","position":62,"original_position":62,"commit_id":"eeb709191121f637763945472ce7e4653b56e4ab","original_commit_id":"eeb709191121f637763945472ce7e4653b56e4ab","user":{"login":"aaugustin","id":788910,"avatar_url":"https://avatars.githubusercontent.com/u/788910?v=3","gravatar_id":"","url":"https://api.github.com/users/aaugustin","html_url":"https://github.com/aaugustin","followers_url":"https://api.github.com/users/aaugustin/followers","following_url":"https://api.github.com/users/aaugustin/following{/other_user}","gists_url":"https://api.github.com/users/aaugustin/gists{/gist_id}","starred_url":"https://api.github.com/users/aaugustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaugustin/subscriptions","organizations_url":"https://api.github.com/users/aaugustin/orgs","repos_url":"https://api.github.com/users/aaugustin/repos","events_url":"https://api.github.com/users/aaugustin/events{/privacy}","received_events_url":"https://api.github.com/users/aaugustin/received_events","type":"User","site_admin":false},"body":"It's hard to assess the correctness of this change through visual inspection. I'll trust you (and the test suite) on this.","created_at":"2015-03-12T20:21:08Z","updated_at":"2015-03-12T20:21:08Z","html_url":"https://github.com/django/django/pull/4254#discussion_r26340365","pull_request_url":"https://api.github.com/repos/django/django/pulls/4254","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/26340365"},"html":{"href":"https://github.com/django/django/pull/4254#discussion_r26340365"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/4254"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/4254","id":30699259,"html_url":"https://github.com/django/django/pull/4254","diff_url":"https://github.com/django/django/pull/4254.diff","patch_url":"https://github.com/django/django/pull/4254.patch","issue_url":"https://api.github.com/repos/django/django/issues/4254","number":4254,"state":"open","locked":false,"title":"Cleaned up the template debug implementation.","user":{"login":"prestontimmons","id":207051,"avatar_url":"https://avatars.githubusercontent.com/u/207051?v=3","gravatar_id":"","url":"https://api.github.com/users/prestontimmons","html_url":"https://github.com/prestontimmons","followers_url":"https://api.github.com/users/prestontimmons/followers","following_url":"https://api.github.com/users/prestontimmons/following{/other_user}","gists_url":"https://api.github.com/users/prestontimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/prestontimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestontimmons/subscriptions","organizations_url":"https://api.github.com/users/prestontimmons/orgs","repos_url":"https://api.github.com/users/prestontimmons/repos","events_url":"https://api.github.com/users/prestontimmons/events{/privacy}","received_events_url":"https://api.github.com/users/prestontimmons/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-07T07:41:16Z","updated_at":"2015-03-12T20:21:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cef355e29d4b59cf6f2867d34b72bc55684d4807","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/4254/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/4254/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/4254/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/eeb709191121f637763945472ce7e4653b56e4ab","head":{"label":"prestontimmons:cleanup-template-debug","ref":"cleanup-template-debug","sha":"eeb709191121f637763945472ce7e4653b56e4ab","user":{"login":"prestontimmons","id":207051,"avatar_url":"https://avatars.githubusercontent.com/u/207051?v=3","gravatar_id":"","url":"https://api.github.com/users/prestontimmons","html_url":"https://github.com/prestontimmons","followers_url":"https://api.github.com/users/prestontimmons/followers","following_url":"https://api.github.com/users/prestontimmons/following{/other_user}","gists_url":"https://api.github.com/users/prestontimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/prestontimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestontimmons/subscriptions","organizations_url":"https://api.github.com/users/prestontimmons/orgs","repos_url":"https://api.github.com/users/prestontimmons/repos","events_url":"https://api.github.com/users/prestontimmons/events{/privacy}","received_events_url":"https://api.github.com/users/prestontimmons/received_events","type":"User","site_admin":false},"repo":{"id":8862914,"name":"django","full_name":"prestontimmons/django","owner":{"login":"prestontimmons","id":207051,"avatar_url":"https://avatars.githubusercontent.com/u/207051?v=3","gravatar_id":"","url":"https://api.github.com/users/prestontimmons","html_url":"https://github.com/prestontimmons","followers_url":"https://api.github.com/users/prestontimmons/followers","following_url":"https://api.github.com/users/prestontimmons/following{/other_user}","gists_url":"https://api.github.com/users/prestontimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/prestontimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestontimmons/subscriptions","organizations_url":"https://api.github.com/users/prestontimmons/orgs","repos_url":"https://api.github.com/users/prestontimmons/repos","events_url":"https://api.github.com/users/prestontimmons/events{/privacy}","received_events_url":"https://api.github.com/users/prestontimmons/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/prestontimmons/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/prestontimmons/django","forks_url":"https://api.github.com/repos/prestontimmons/django/forks","keys_url":"https://api.github.com/repos/prestontimmons/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestontimmons/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestontimmons/django/teams","hooks_url":"https://api.github.com/repos/prestontimmons/django/hooks","issue_events_url":"https://api.github.com/repos/prestontimmons/django/issues/events{/number}","events_url":"https://api.github.com/repos/prestontimmons/django/events","assignees_url":"https://api.github.com/repos/prestontimmons/django/assignees{/user}","branches_url":"https://api.github.com/repos/prestontimmons/django/branches{/branch}","tags_url":"https://api.github.com/repos/prestontimmons/django/tags","blobs_url":"https://api.github.com/repos/prestontimmons/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestontimmons/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestontimmons/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestontimmons/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestontimmons/django/statuses/{sha}","languages_url":"https://api.github.com/repos/prestontimmons/django/languages","stargazers_url":"https://api.github.com/repos/prestontimmons/django/stargazers","contributors_url":"https://api.github.com/repos/prestontimmons/django/contributors","subscribers_url":"https://api.github.com/repos/prestontimmons/django/subscribers","subscription_url":"https://api.github.com/repos/prestontimmons/django/subscription","commits_url":"https://api.github.com/repos/prestontimmons/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestontimmons/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestontimmons/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestontimmons/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestontimmons/django/contents/{+path}","compare_url":"https://api.github.com/repos/prestontimmons/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestontimmons/django/merges","archive_url":"https://api.github.com/repos/prestontimmons/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestontimmons/django/downloads","issues_url":"https://api.github.com/repos/prestontimmons/django/issues{/number}","pulls_url":"https://api.github.com/repos/prestontimmons/django/pulls{/number}","milestones_url":"https://api.github.com/repos/prestontimmons/django/milestones{/number}","notifications_url":"https://api.github.com/repos/prestontimmons/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestontimmons/django/labels{/name}","releases_url":"https://api.github.com/repos/prestontimmons/django/releases{/id}","created_at":"2013-03-18T20:02:22Z","updated_at":"2015-02-16T23:35:25Z","pushed_at":"2015-03-12T03:44:34Z","git_url":"git://github.com/prestontimmons/django.git","ssh_url":"git@github.com:prestontimmons/django.git","clone_url":"https://github.com/prestontimmons/django.git","svn_url":"https://github.com/prestontimmons/django","homepage":"http://www.djangoproject.com/","size":114001,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"28e8c54d7d2800a8ac98cf646a9e074055bc1b1b","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-03-12T19:36:35Z","pushed_at":"2015-03-12T13:41:08Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":267139,"stargazers_count":13251,"watchers_count":13251,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5193,"mirror_url":null,"open_issues_count":105,"forks":5193,"open_issues":105,"watchers":13251,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/4254"},"html":{"href":"https://github.com/django/django/pull/4254"},"issue":{"href":"https://api.github.com/repos/django/django/issues/4254"},"comments":{"href":"https://api.github.com/repos/django/django/issues/4254/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/4254/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/4254/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/eeb709191121f637763945472ce7e4653b56e4ab"}}}}