{"action":"created","issue":{"url":"https://api.github.com/repos/barsoom/sie/issues/5","labels_url":"https://api.github.com/repos/barsoom/sie/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/barsoom/sie/issues/5/comments","events_url":"https://api.github.com/repos/barsoom/sie/issues/5/events","html_url":"https://github.com/barsoom/sie/pull/5","id":58909359,"number":5,"title":"Introduced option to make parser more lenient regarding unknown entry types","user":{"login":"johangrufman","id":749932,"avatar_url":"https://avatars.githubusercontent.com/u/749932?v=3","gravatar_id":"","url":"https://api.github.com/users/johangrufman","html_url":"https://github.com/johangrufman","followers_url":"https://api.github.com/users/johangrufman/followers","following_url":"https://api.github.com/users/johangrufman/following{/other_user}","gists_url":"https://api.github.com/users/johangrufman/gists{/gist_id}","starred_url":"https://api.github.com/users/johangrufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johangrufman/subscriptions","organizations_url":"https://api.github.com/users/johangrufman/orgs","repos_url":"https://api.github.com/users/johangrufman/repos","events_url":"https://api.github.com/users/johangrufman/events{/privacy}","received_events_url":"https://api.github.com/users/johangrufman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-02-25T14:31:06Z","updated_at":"2015-03-06T07:48:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/barsoom/sie/pulls/5","html_url":"https://github.com/barsoom/sie/pull/5","diff_url":"https://github.com/barsoom/sie/pull/5.diff","patch_url":"https://github.com/barsoom/sie/pull/5.patch"},"body":"I had some trouble parsing a SIE file with entries like `#MOMSKOD 2611 10`. When parsing such a file I get\r\n\r\n    key not found: \"momskod\"\r\n    sie (2.1.0) lib/sie/parser/tokenizer/token.rb:14:in `fetch'\r\n    sie (2.1.0) lib/sie/parser/tokenizer/token.rb:14:in `entry_type'\r\n    sie (2.1.0) lib/sie/parser/line_parser.rb:15:in `parse'\r\n    sie (2.1.0) lib/sie/parser.rb:37:in `parse_line'\r\n    sie (2.1.0) lib/sie/parser.rb:27:in `block in parse'\r\n    sie (2.1.0) lib/sie/parser.rb:17:in `each_line'\r\n    sie (2.1.0) lib/sie/parser.rb:17:in `parse'\r\n\r\nThis is understandable because as far as I can tell #MOMSKOD is not mentioned in the spec. The file I tried to parse is exported from iOrdning and I don't know if MOMSKOD is some custom extension or if it's from an older version of the spec. \r\n\r\nAnyway, I still need to be able to parse files like these so I tried to introduce an option to make the parser more lenient regarding unknown entry types. Given `lenient: true` the parser now handles unknown entry types without raising any error. Without the option it still raises an error. See the updated specs for details.\r\n\r\nThere might be things to discuss regarding the implementation but first of all I'd like to know if you'd consider such an option useful.\r\n"},"comment":{"url":"https://api.github.com/repos/barsoom/sie/issues/comments/77519510","html_url":"https://github.com/barsoom/sie/pull/5#issuecomment-77519510","issue_url":"https://api.github.com/repos/barsoom/sie/issues/5","id":77519510,"user":{"login":"henrik","id":216,"avatar_url":"https://avatars.githubusercontent.com/u/216?v=3","gravatar_id":"","url":"https://api.github.com/users/henrik","html_url":"https://github.com/henrik","followers_url":"https://api.github.com/users/henrik/followers","following_url":"https://api.github.com/users/henrik/following{/other_user}","gists_url":"https://api.github.com/users/henrik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrik/subscriptions","organizations_url":"https://api.github.com/users/henrik/orgs","repos_url":"https://api.github.com/users/henrik/repos","events_url":"https://api.github.com/users/henrik/events{/privacy}","received_events_url":"https://api.github.com/users/henrik/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T07:48:11Z","updated_at":"2015-03-06T07:48:11Z","body":"@joakimk Just to be explicit, I consider this to be \"your\" PR since it's in the sie repo. "}}