{"action":"created","issue":{"url":"https://api.github.com/repos/nikomatsakis/lalrpop/issues/160","repository_url":"https://api.github.com/repos/nikomatsakis/lalrpop","labels_url":"https://api.github.com/repos/nikomatsakis/lalrpop/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/nikomatsakis/lalrpop/issues/160/comments","events_url":"https://api.github.com/repos/nikomatsakis/lalrpop/issues/160/events","html_url":"https://github.com/nikomatsakis/lalrpop/pull/160","id":188111828,"number":160,"title":"feat: Implement error recovery","user":{"login":"Marwes","id":957312,"avatar_url":"https://avatars.githubusercontent.com/u/957312?v=3","gravatar_id":"","url":"https://api.github.com/users/Marwes","html_url":"https://github.com/Marwes","followers_url":"https://api.github.com/users/Marwes/followers","following_url":"https://api.github.com/users/Marwes/following{/other_user}","gists_url":"https://api.github.com/users/Marwes/gists{/gist_id}","starred_url":"https://api.github.com/users/Marwes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marwes/subscriptions","organizations_url":"https://api.github.com/users/Marwes/orgs","repos_url":"https://api.github.com/users/Marwes/repos","events_url":"https://api.github.com/users/Marwes/events{/privacy}","received_events_url":"https://api.github.com/users/Marwes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-11-08T21:44:09Z","updated_at":"2016-11-23T09:13:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nikomatsakis/lalrpop/pulls/160","html_url":"https://github.com/nikomatsakis/lalrpop/pull/160","diff_url":"https://github.com/nikomatsakis/lalrpop/pull/160.diff","patch_url":"https://github.com/nikomatsakis/lalrpop/pull/160.patch"},"body":"Work in progress branch which aims to allow parsers to recover from parse errors.\r\n\r\nThis adds the `error` keyword (bikesheddable) to LALRPOPs syntax. If `error` is encountered during parsing the parser goes into recovery mode where it will first pop states until it finds a state which it can potentially recover from. After finding a recoverable state the next step is to skip tokens until a token is found which allows the parser to continue. Recovering from an error acts as a successful parse so it is up to the user to record this error in some way.\r\n\r\n### Unresolved questions\r\n- [x] ~~Is it possible to have recovery for LALR grammars as well? (Need to look into this but haven't found anything concrete yet)~~ I guess his might come for free actually?\r\n\r\n### TODO\r\n- [x] Recover from errors at EOF\r\n- [x] Allow the error recovered from to be inspected in its action `\"+\" <e: error> => { /* use `e` */ }`\r\n- [x] ~~Implement recovery for recursive ascent parsers~~ Skipping this until later when the parse_table implementation has seen some use.\r\n- [x] Implement `unimplemented!()` stubs (example generation)\r\n- [x] Documentation\r\n- [x] Clean up commits\r\n\r\n### Reading\r\nhttps://arxiv.org/pdf/1010.1234.pdf\r\nhttps://www.cs.clemson.edu/course/cpsc827/material/LRk/LR%20Error%20Recovery.pdf\r\nhttps://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0ahUKEwjt9cTt6JjQAhVGjSwKHV0bAigQFgg7MAQ&url=http%3A%2F%2Fwww.cs.princeton.edu%2Fcourses%2Farchive%2Fspr05%2Fcos320%2Fnotes%2F7-parsing-error.ppt&usg=AFQjCNF0I2l3VAMVyT47DIYGv6wZOUzP2A&sig2=0-c3w6nOFevP5nTamen3dg&cad=rja\r\n\r\ncc #156\r\n\r\nBREAKING CHANGE\r\n\r\nThis adds the `error` keyword to grammar definitions."},"comment":{"url":"https://api.github.com/repos/nikomatsakis/lalrpop/issues/comments/262463886","html_url":"https://github.com/nikomatsakis/lalrpop/pull/160#issuecomment-262463886","issue_url":"https://api.github.com/repos/nikomatsakis/lalrpop/issues/160","id":262463886,"user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T09:13:16Z","updated_at":"2016-11-23T09:13:16Z","body":"> Was thinking I would submit a PR with rustfmt run on the source afterwards if that is alright, possibly with a rustfmt.toml to preserve formatting as much as possible?\r\n\r\nYes, that's fine, I've been meaning to do that for a while. I'd prefer to just use standard settings and not mess with a rustfmt.toml."}}
{"actor":{"display_login":"nikomatsakis"}}