{"action":"created","comment":{"url":"https://api.github.com/repos/softdevteam/eco/pulls/comments/212680138","pull_request_review_id":149367841,"id":212680138,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjY4MDEzOA==","diff_hunk":"@@ -80,24 +88,54 @@ def match_one(self, pattern):\n         self.exactmatch = False\n         return False\n \n-    def match_star(self, pattern):\n-        while self._inner_match(pattern.c):\n-             pass\n-        return True\n+    def match_star(self, pattern, l=None):\n+        if l is None or len(l) == 1:\n+            while self._inner_match(pattern.c):\n+                pass\n+            return True\n+\n+        if pattern.ng: # non-greedy\n+            while True:\n+                tmp = self.save_state()\n+                if self.match_list(l[1:]):\n+                    return True\n+                self.load_state(tmp)\n+                if self._inner_match(pattern.c):\n+                    continue\n+                return False\n+        else: # greedy\n+            tmp = self.save_state()\n+            if self._inner_match(pattern.c) and self.match_list(l):\n+                return True\n+            # remember how far we looked ahead before backtracking\n+            etmp = (self.la, self.exactmatch)\n+            self.load_state(tmp)\n+            self.la, self.exactmatch = etmp\n+            if self.match_list(l[1:]):","path":"lib/eco/treelexer/lexer.py","position":57,"original_position":57,"commit_id":"b9ddfd7b780dfbd9dcc37e7b2e73ea3b00161382","original_commit_id":"b9ddfd7b780dfbd9dcc37e7b2e73ea3b00161382","user":{"login":"ptersilie","id":375552,"node_id":"MDQ6VXNlcjM3NTU1Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/375552?v=4","gravatar_id":"","url":"https://api.github.com/users/ptersilie","html_url":"https://github.com/ptersilie","followers_url":"https://api.github.com/users/ptersilie/followers","following_url":"https://api.github.com/users/ptersilie/following{/other_user}","gists_url":"https://api.github.com/users/ptersilie/gists{/gist_id}","starred_url":"https://api.github.com/users/ptersilie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptersilie/subscriptions","organizations_url":"https://api.github.com/users/ptersilie/orgs","repos_url":"https://api.github.com/users/ptersilie/repos","events_url":"https://api.github.com/users/ptersilie/events{/privacy}","received_events_url":"https://api.github.com/users/ptersilie/received_events","type":"User","site_admin":false},"body":"Oh I see what you mean now! This happens within `self.load_state(tmp)`, which resets the `self.pos` (the position how far we've matched) to before a single `a` was matched. Due to the recursion this then happens multiple times until we are back at a `pos` where `match(l[1:])` can succeed.","created_at":"2018-08-24T16:15:13Z","updated_at":"2018-08-24T16:15:13Z","html_url":"https://github.com/softdevteam/eco/pull/215#discussion_r212680138","pull_request_url":"https://api.github.com/repos/softdevteam/eco/pulls/215","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/comments/212680138"},"html":{"href":"https://github.com/softdevteam/eco/pull/215#discussion_r212680138"},"pull_request":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/215"}},"in_reply_to_id":212590297},"pull_request":{"url":"https://api.github.com/repos/softdevteam/eco/pulls/215","id":210701213,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNzAxMjEz","html_url":"https://github.com/softdevteam/eco/pull/215","diff_url":"https://github.com/softdevteam/eco/pull/215.diff","patch_url":"https://github.com/softdevteam/eco/pull/215.patch","issue_url":"https://api.github.com/repos/softdevteam/eco/issues/215","number":215,"state":"open","locked":false,"title":"Fix regex parser","user":{"login":"ptersilie","id":375552,"node_id":"MDQ6VXNlcjM3NTU1Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/375552?v=4","gravatar_id":"","url":"https://api.github.com/users/ptersilie","html_url":"https://github.com/ptersilie","followers_url":"https://api.github.com/users/ptersilie/followers","following_url":"https://api.github.com/users/ptersilie/following{/other_user}","gists_url":"https://api.github.com/users/ptersilie/gists{/gist_id}","starred_url":"https://api.github.com/users/ptersilie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptersilie/subscriptions","organizations_url":"https://api.github.com/users/ptersilie/orgs","repos_url":"https://api.github.com/users/ptersilie/repos","events_url":"https://api.github.com/users/ptersilie/events{/privacy}","received_events_url":"https://api.github.com/users/ptersilie/received_events","type":"User","site_admin":false},"body":"Added support for non-greedy star and fixed greedy star.","created_at":"2018-08-24T10:28:00Z","updated_at":"2018-08-24T16:15:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"168fb99554d52400e7d18c7483e0fd893709f993","assignee":{"login":"ltratt","id":20318,"node_id":"MDQ6VXNlcjIwMzE4","avatar_url":"https://avatars1.githubusercontent.com/u/20318?v=4","gravatar_id":"","url":"https://api.github.com/users/ltratt","html_url":"https://github.com/ltratt","followers_url":"https://api.github.com/users/ltratt/followers","following_url":"https://api.github.com/users/ltratt/following{/other_user}","gists_url":"https://api.github.com/users/ltratt/gists{/gist_id}","starred_url":"https://api.github.com/users/ltratt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltratt/subscriptions","organizations_url":"https://api.github.com/users/ltratt/orgs","repos_url":"https://api.github.com/users/ltratt/repos","events_url":"https://api.github.com/users/ltratt/events{/privacy}","received_events_url":"https://api.github.com/users/ltratt/received_events","type":"User","site_admin":false},"assignees":[{"login":"ltratt","id":20318,"node_id":"MDQ6VXNlcjIwMzE4","avatar_url":"https://avatars1.githubusercontent.com/u/20318?v=4","gravatar_id":"","url":"https://api.github.com/users/ltratt","html_url":"https://github.com/ltratt","followers_url":"https://api.github.com/users/ltratt/followers","following_url":"https://api.github.com/users/ltratt/following{/other_user}","gists_url":"https://api.github.com/users/ltratt/gists{/gist_id}","starred_url":"https://api.github.com/users/ltratt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltratt/subscriptions","organizations_url":"https://api.github.com/users/ltratt/orgs","repos_url":"https://api.github.com/users/ltratt/repos","events_url":"https://api.github.com/users/ltratt/events{/privacy}","received_events_url":"https://api.github.com/users/ltratt/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/softdevteam/eco/pulls/215/commits","review_comments_url":"https://api.github.com/repos/softdevteam/eco/pulls/215/comments","review_comment_url":"https://api.github.com/repos/softdevteam/eco/pulls/comments{/number}","comments_url":"https://api.github.com/repos/softdevteam/eco/issues/215/comments","statuses_url":"https://api.github.com/repos/softdevteam/eco/statuses/b9ddfd7b780dfbd9dcc37e7b2e73ea3b00161382","head":{"label":"softdevteam:fixregex","ref":"fixregex","sha":"b9ddfd7b780dfbd9dcc37e7b2e73ea3b00161382","user":{"login":"softdevteam","id":10271085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjcxMDg1","avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"repo":{"id":29346049,"node_id":"MDEwOlJlcG9zaXRvcnkyOTM0NjA0OQ==","name":"eco","full_name":"softdevteam/eco","owner":{"login":"softdevteam","id":10271085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjcxMDg1","avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/softdevteam/eco","description":"Editor for language composition","fork":false,"url":"https://api.github.com/repos/softdevteam/eco","forks_url":"https://api.github.com/repos/softdevteam/eco/forks","keys_url":"https://api.github.com/repos/softdevteam/eco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/softdevteam/eco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/softdevteam/eco/teams","hooks_url":"https://api.github.com/repos/softdevteam/eco/hooks","issue_events_url":"https://api.github.com/repos/softdevteam/eco/issues/events{/number}","events_url":"https://api.github.com/repos/softdevteam/eco/events","assignees_url":"https://api.github.com/repos/softdevteam/eco/assignees{/user}","branches_url":"https://api.github.com/repos/softdevteam/eco/branches{/branch}","tags_url":"https://api.github.com/repos/softdevteam/eco/tags","blobs_url":"https://api.github.com/repos/softdevteam/eco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/softdevteam/eco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/softdevteam/eco/git/refs{/sha}","trees_url":"https://api.github.com/repos/softdevteam/eco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/softdevteam/eco/statuses/{sha}","languages_url":"https://api.github.com/repos/softdevteam/eco/languages","stargazers_url":"https://api.github.com/repos/softdevteam/eco/stargazers","contributors_url":"https://api.github.com/repos/softdevteam/eco/contributors","subscribers_url":"https://api.github.com/repos/softdevteam/eco/subscribers","subscription_url":"https://api.github.com/repos/softdevteam/eco/subscription","commits_url":"https://api.github.com/repos/softdevteam/eco/commits{/sha}","git_commits_url":"https://api.github.com/repos/softdevteam/eco/git/commits{/sha}","comments_url":"https://api.github.com/repos/softdevteam/eco/comments{/number}","issue_comment_url":"https://api.github.com/repos/softdevteam/eco/issues/comments{/number}","contents_url":"https://api.github.com/repos/softdevteam/eco/contents/{+path}","compare_url":"https://api.github.com/repos/softdevteam/eco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/softdevteam/eco/merges","archive_url":"https://api.github.com/repos/softdevteam/eco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/softdevteam/eco/downloads","issues_url":"https://api.github.com/repos/softdevteam/eco/issues{/number}","pulls_url":"https://api.github.com/repos/softdevteam/eco/pulls{/number}","milestones_url":"https://api.github.com/repos/softdevteam/eco/milestones{/number}","notifications_url":"https://api.github.com/repos/softdevteam/eco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/softdevteam/eco/labels{/name}","releases_url":"https://api.github.com/repos/softdevteam/eco/releases{/id}","deployments_url":"https://api.github.com/repos/softdevteam/eco/deployments","created_at":"2015-01-16T11:37:35Z","updated_at":"2018-08-24T10:35:27Z","pushed_at":"2018-08-24T10:40:03Z","git_url":"git://github.com/softdevteam/eco.git","ssh_url":"git@github.com:softdevteam/eco.git","clone_url":"https://github.com/softdevteam/eco.git","svn_url":"https://github.com/softdevteam/eco","homepage":null,"size":3885,"stargazers_count":28,"watchers_count":28,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":7,"open_issues":15,"watchers":28,"default_branch":"master"}},"base":{"label":"softdevteam:master","ref":"master","sha":"ee5131127647db98c79dd765bb3e4c76bf47a468","user":{"login":"softdevteam","id":10271085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjcxMDg1","avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"repo":{"id":29346049,"node_id":"MDEwOlJlcG9zaXRvcnkyOTM0NjA0OQ==","name":"eco","full_name":"softdevteam/eco","owner":{"login":"softdevteam","id":10271085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjcxMDg1","avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/softdevteam/eco","description":"Editor for language composition","fork":false,"url":"https://api.github.com/repos/softdevteam/eco","forks_url":"https://api.github.com/repos/softdevteam/eco/forks","keys_url":"https://api.github.com/repos/softdevteam/eco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/softdevteam/eco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/softdevteam/eco/teams","hooks_url":"https://api.github.com/repos/softdevteam/eco/hooks","issue_events_url":"https://api.github.com/repos/softdevteam/eco/issues/events{/number}","events_url":"https://api.github.com/repos/softdevteam/eco/events","assignees_url":"https://api.github.com/repos/softdevteam/eco/assignees{/user}","branches_url":"https://api.github.com/repos/softdevteam/eco/branches{/branch}","tags_url":"https://api.github.com/repos/softdevteam/eco/tags","blobs_url":"https://api.github.com/repos/softdevteam/eco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/softdevteam/eco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/softdevteam/eco/git/refs{/sha}","trees_url":"https://api.github.com/repos/softdevteam/eco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/softdevteam/eco/statuses/{sha}","languages_url":"https://api.github.com/repos/softdevteam/eco/languages","stargazers_url":"https://api.github.com/repos/softdevteam/eco/stargazers","contributors_url":"https://api.github.com/repos/softdevteam/eco/contributors","subscribers_url":"https://api.github.com/repos/softdevteam/eco/subscribers","subscription_url":"https://api.github.com/repos/softdevteam/eco/subscription","commits_url":"https://api.github.com/repos/softdevteam/eco/commits{/sha}","git_commits_url":"https://api.github.com/repos/softdevteam/eco/git/commits{/sha}","comments_url":"https://api.github.com/repos/softdevteam/eco/comments{/number}","issue_comment_url":"https://api.github.com/repos/softdevteam/eco/issues/comments{/number}","contents_url":"https://api.github.com/repos/softdevteam/eco/contents/{+path}","compare_url":"https://api.github.com/repos/softdevteam/eco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/softdevteam/eco/merges","archive_url":"https://api.github.com/repos/softdevteam/eco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/softdevteam/eco/downloads","issues_url":"https://api.github.com/repos/softdevteam/eco/issues{/number}","pulls_url":"https://api.github.com/repos/softdevteam/eco/pulls{/number}","milestones_url":"https://api.github.com/repos/softdevteam/eco/milestones{/number}","notifications_url":"https://api.github.com/repos/softdevteam/eco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/softdevteam/eco/labels{/name}","releases_url":"https://api.github.com/repos/softdevteam/eco/releases{/id}","deployments_url":"https://api.github.com/repos/softdevteam/eco/deployments","created_at":"2015-01-16T11:37:35Z","updated_at":"2018-08-24T10:35:27Z","pushed_at":"2018-08-24T10:40:03Z","git_url":"git://github.com/softdevteam/eco.git","ssh_url":"git@github.com:softdevteam/eco.git","clone_url":"https://github.com/softdevteam/eco.git","svn_url":"https://github.com/softdevteam/eco","homepage":null,"size":3885,"stargazers_count":28,"watchers_count":28,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":7,"open_issues":15,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/215"},"html":{"href":"https://github.com/softdevteam/eco/pull/215"},"issue":{"href":"https://api.github.com/repos/softdevteam/eco/issues/215"},"comments":{"href":"https://api.github.com/repos/softdevteam/eco/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/215/comments"},"review_comment":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/215/commits"},"statuses":{"href":"https://api.github.com/repos/softdevteam/eco/statuses/b9ddfd7b780dfbd9dcc37e7b2e73ea3b00161382"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ptersilie"}}