{"action":"opened","issue":{"url":"https://api.github.com/repos/vlasovskikh/funcparserlib/issues/48","repository_url":"https://api.github.com/repos/vlasovskikh/funcparserlib","labels_url":"https://api.github.com/repos/vlasovskikh/funcparserlib/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/vlasovskikh/funcparserlib/issues/48/comments","events_url":"https://api.github.com/repos/vlasovskikh/funcparserlib/issues/48/events","html_url":"https://github.com/vlasovskikh/funcparserlib/issues/48","id":187179336,"number":48,"title":"Problem Combining Operator | and Operator +","user":{"login":"xie-dongping","id":5015775,"avatar_url":"https://avatars.githubusercontent.com/u/5015775?v=3","gravatar_id":"","url":"https://api.github.com/users/xie-dongping","html_url":"https://github.com/xie-dongping","followers_url":"https://api.github.com/users/xie-dongping/followers","following_url":"https://api.github.com/users/xie-dongping/following{/other_user}","gists_url":"https://api.github.com/users/xie-dongping/gists{/gist_id}","starred_url":"https://api.github.com/users/xie-dongping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xie-dongping/subscriptions","organizations_url":"https://api.github.com/users/xie-dongping/orgs","repos_url":"https://api.github.com/users/xie-dongping/repos","events_url":"https://api.github.com/users/xie-dongping/events{/privacy}","received_events_url":"https://api.github.com/users/xie-dongping/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-03T20:21:33Z","updated_at":"2016-11-03T20:21:33Z","closed_at":null,"body":"Consider the following simple and fictive example:\r\n```\r\nfrom funcparserlib.parser import many, some, finished\r\n\r\ncode = \"aa\"\r\n\r\np1 = some(lambda x: x == 'a')\r\np2 = many(p1)\r\n\r\np_or = p1 | p2\r\n\r\nparsed_tokens = (p3+finished).parse(\"aa\") \r\n# Error, since it would short-circuit to p1!\r\n```\r\n\r\nI encounter the case when writing a toy parser for a modeling language.\r\n\r\nI'm not really familiar with the parsing theory, so I was wondering if this is the intended behavior for a parser combinator?\r\n\r\nIf it is not, how may I fix the `__or__` method of the `Parser` class (maybe even more)? I thought about propagating the exceptions back to the `__or__` method, or maybe you would have a better idea?"}}
{"actor":{"display_login":"xie-dongping"}}