{"action":"created","comment":{"url":"https://api.github.com/repos/softdevteam/eco/pulls/comments/52607467","id":52607467,"diff_hunk":"@@ -149,21 +190,45 @@ def parse_precedence_symbols(self, symbol):\n         return s\n \n     def create_parser(self, pickle_id = None):\n-        startrule = self.ast.children[1] # startrule\n-        grammar = startrule.children[1]\n-        parser = grammar.children[0]\n-        assert parser.symbol.name == \"parser\"\n-        self.parse_rules(parser)\n+        self.all_terminals.update(self.terminals)\n+\n+        for fname, terminals, parentrule in self.functions:\n+            if fname.startswith(\"*match_until\"):\n+                if Nonterminal(fname) not in self.rules:\n+                    r = Rule(Nonterminal(fname))\n+                    for t in self.all_terminals:\n+                        if t not in terminals:\n+                            r.add_alternative([Nonterminal(fname), Terminal(t)], None, t)\n+                    r.add_alternative([])\n+                    self.rules[r.symbol] = r\n+                # remove whitespace before special rule from parent rule, e.g.\n+                # multistring ::= \"MLS\" WS *match_until \"MLS\" WS\n+                #                       ^ this WS causes shift/reduce conflicts\n+                prule = self.rules[Nonterminal(parentrule)]\n+                for a in prule.alternatives:\n+                    for i in range(len(a)):\n+                        sym = a[i]\n+                        if sym.name == \"WS\":","path":"lib/eco/grammar_parser/bootstrap.py","position":107,"original_position":107,"commit_id":"54f8c6f40e8fdc5b789a675351236a576b63e561","original_commit_id":"54f8c6f40e8fdc5b789a675351236a576b63e561","user":{"login":"ltratt","id":20318,"avatar_url":"https://avatars.githubusercontent.com/u/20318?v=3","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},"body":"Can this not be `if len(a) > i + 1` and remove the `try ... except`?","created_at":"2016-02-11T14:30:42Z","updated_at":"2016-02-11T14:30:42Z","html_url":"https://github.com/softdevteam/eco/pull/73#discussion_r52607467","pull_request_url":"https://api.github.com/repos/softdevteam/eco/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/comments/52607467"},"html":{"href":"https://github.com/softdevteam/eco/pull/73#discussion_r52607467"},"pull_request":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/softdevteam/eco/pulls/73","id":58773605,"html_url":"https://github.com/softdevteam/eco/pull/73","diff_url":"https://github.com/softdevteam/eco/pull/73.diff","patch_url":"https://github.com/softdevteam/eco/pull/73.patch","issue_url":"https://api.github.com/repos/softdevteam/eco/issues/73","number":73,"state":"open","locked":false,"title":"Supporting comments/strings through grammar rewriting","user":{"login":"ptersilie","id":375552,"avatar_url":"https://avatars.githubusercontent.com/u/375552?v=3","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":"Replaced the previous \"AnySymbol\"-approach with a new approach that rewrites the grammars to allow the use of multiline structures such as strings and comments while keeping changes to the parser minimal.","created_at":"2016-02-09T16:40:16Z","updated_at":"2016-02-11T14:30:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7cb78d27c6f67733b48664d936e8e4129afe5a1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/softdevteam/eco/pulls/73/commits","review_comments_url":"https://api.github.com/repos/softdevteam/eco/pulls/73/comments","review_comment_url":"https://api.github.com/repos/softdevteam/eco/pulls/comments{/number}","comments_url":"https://api.github.com/repos/softdevteam/eco/issues/73/comments","statuses_url":"https://api.github.com/repos/softdevteam/eco/statuses/54f8c6f40e8fdc5b789a675351236a576b63e561","head":{"label":"softdevteam:multilinegrammarrewrite","ref":"multilinegrammarrewrite","sha":"54f8c6f40e8fdc5b789a675351236a576b63e561","user":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars.githubusercontent.com/u/10271085?v=3","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,"name":"eco","full_name":"softdevteam/eco","owner":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars.githubusercontent.com/u/10271085?v=3","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":"2016-01-12T15:43:46Z","pushed_at":"2016-02-10T15:33:48Z","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":2667,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":11,"forks":3,"open_issues":11,"watchers":11,"default_branch":"master"}},"base":{"label":"softdevteam:master","ref":"master","sha":"da05456361bc9ca149a7dced6e6f27385526fcce","user":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars.githubusercontent.com/u/10271085?v=3","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,"name":"eco","full_name":"softdevteam/eco","owner":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars.githubusercontent.com/u/10271085?v=3","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":"2016-01-12T15:43:46Z","pushed_at":"2016-02-10T15:33:48Z","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":2667,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":11,"forks":3,"open_issues":11,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/73"},"html":{"href":"https://github.com/softdevteam/eco/pull/73"},"issue":{"href":"https://api.github.com/repos/softdevteam/eco/issues/73"},"comments":{"href":"https://api.github.com/repos/softdevteam/eco/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/softdevteam/eco/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/softdevteam/eco/statuses/54f8c6f40e8fdc5b789a675351236a576b63e561"}}}}