{"action":"created","issue":{"url":"https://api.github.com/repos/whitequark/parser/issues/252","repository_url":"https://api.github.com/repos/whitequark/parser","labels_url":"https://api.github.com/repos/whitequark/parser/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/whitequark/parser/issues/252/comments","events_url":"https://api.github.com/repos/whitequark/parser/issues/252/events","html_url":"https://github.com/whitequark/parser/issues/252","id":128435701,"number":252,"title":"Crash when parsing symbols","user":{"login":"mbj","id":117966,"avatar_url":"https://avatars.githubusercontent.com/u/117966?v=3","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":47,"created_at":"2016-01-25T00:16:13Z","updated_at":"2016-03-16T16:08:16Z","closed_at":null,"body":"The following file (reduced from: https://github.com/ruby/spec/blob/master/core/symbol/casecmp_spec.rb) crashes parser:\r\n\r\n```ruby\r\n# -*- encoding: us-ascii -*-\r\n\r\np :\"\\xC3\"\r\n```\r\n\r\nBacktrace:\r\n\r\n```\r\n/home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/builders/default.rb:172:in `to_sym': invalid encoding symbol (EncodingError)\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/builders/default.rb:172:in `symbol_compose'\r\n        from ruby23.y:1839:in `_reduce_467'\r\n        from /home/mbj/.rubies/ruby-2.3.0/lib/ruby/2.3.0/racc/parser.rb:259:in `_racc_do_parse_c'\r\n        from /home/mbj/.rubies/ruby-2.3.0/lib/ruby/2.3.0/racc/parser.rb:259:in `do_parse'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/base.rb:162:in `parse'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner/ruby_parse.rb:132:in `process'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:202:in `process_buffer'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:195:in `block in process_files'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:181:in `each'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:181:in `process_files'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:159:in `block in process_all_input'\r\n        from /home/mbj/.rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:293:in `measure'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:157:in `process_all_input'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner/ruby_parse.rb:128:in `process_all_input'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:33:in `execute'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/lib/parser/runner.rb:11:in `go'\r\n        from /home/mbj/.gem/ruby/2.3.0/gems/parser-2.3.0.2/bin/ruby-parse:6:in `<top (required)>'\r\n        from /home/mbj/.gem/ruby/2.3.0/bin/ruby-parse:23:in `load'\r\n        from /home/mbj/.gem/ruby/2.3.0/bin/ruby-parse:23:in `<main>'\r\n```\r\n\r\nRuby 2.3.0-p0 accepts it and prints:\r\n```\r\n:\"\\xC3\"\r\n```"},"comment":{"url":"https://api.github.com/repos/whitequark/parser/issues/comments/197401328","html_url":"https://github.com/whitequark/parser/issues/252#issuecomment-197401328","issue_url":"https://api.github.com/repos/whitequark/parser/issues/252","id":197401328,"user":{"login":"mbj","id":117966,"avatar_url":"https://avatars.githubusercontent.com/u/117966?v=3","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T16:08:16Z","updated_at":"2016-03-16T16:08:16Z","body":"@whitequark So to be more explicit for my wall of text / rantish thing above: Can we detect this case in a way a dedicated exception from the `Parser::*` namespace can be raised instead of the generic `EncodingError`? If parser would be changed to do so, and the issue is documented: I think this issue is closed.\r\n\r\nI do not prevent @alexdowad to try to fix this issue, but as I understand it takes a long time, and the class of \"not explicitly handled by parser\" syntax needs to be made explicit in the API."}}