{"action":"created","issue":{"url":"https://api.github.com/repos/brownplt/pyret-lang/issues/884","repository_url":"https://api.github.com/repos/brownplt/pyret-lang","labels_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/884/labels{/name}","comments_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/884/comments","events_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/884/events","html_url":"https://github.com/brownplt/pyret-lang/issues/884","id":181076367,"number":884,"title":"`raise` vs `raises`","user":{"login":"shriram","id":75030,"avatar_url":"https://avatars.githubusercontent.com/u/75030?v=3","gravatar_id":"","url":"https://api.github.com/users/shriram","html_url":"https://github.com/shriram","followers_url":"https://api.github.com/users/shriram/followers","following_url":"https://api.github.com/users/shriram/following{/other_user}","gists_url":"https://api.github.com/users/shriram/gists{/gist_id}","starred_url":"https://api.github.com/users/shriram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shriram/subscriptions","organizations_url":"https://api.github.com/users/shriram/orgs","repos_url":"https://api.github.com/users/shriram/repos","events_url":"https://api.github.com/users/shriram/events{/privacy}","received_events_url":"https://api.github.com/users/shriram/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-05T06:43:38Z","updated_at":"2016-10-05T13:40:10Z","closed_at":null,"body":"Student accidentally writes `raises` instead of `raise`, tries several variants, all give relatively useless parsing errors.\r\n\r\nIt would be nice if they at least got feedback saying \"`raises` is a keyword, and its syntax is only valid inside checking contexts. Note that the following program _does_ produce such an error:\r\n```\r\nfun f(x):\r\n  x raises 2\r\nend\r\n```\r\nbut if I accidentally use `raises` without the `x` — i.e., the whole line is `raises 2` or `raises(2)` — I don't get this and the error is much less helpful.\r\n\r\n[Incidentally, the report I filed earlier that it doesn't refer to all checking block forms persists.]"},"comment":{"url":"https://api.github.com/repos/brownplt/pyret-lang/issues/comments/251677387","html_url":"https://github.com/brownplt/pyret-lang/issues/884#issuecomment-251677387","issue_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/884","id":251677387,"user":{"login":"jpolitz","id":119891,"avatar_url":"https://avatars.githubusercontent.com/u/119891?v=3","gravatar_id":"","url":"https://api.github.com/users/jpolitz","html_url":"https://github.com/jpolitz","followers_url":"https://api.github.com/users/jpolitz/followers","following_url":"https://api.github.com/users/jpolitz/following{/other_user}","gists_url":"https://api.github.com/users/jpolitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpolitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpolitz/subscriptions","organizations_url":"https://api.github.com/users/jpolitz/orgs","repos_url":"https://api.github.com/users/jpolitz/repos","events_url":"https://api.github.com/users/jpolitz/events{/privacy}","received_events_url":"https://api.github.com/users/jpolitz/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T13:40:09Z","updated_at":"2016-10-05T13:40:09Z","body":"@blerner, do you agree with my reasoning below?\r\n\r\nThis is the kind of thing a handwritten parser can do well that a generated one cannot.\r\n\r\nThe notion of \"inside a checking context\" is pretty difficult to encode reasonably in a typical parser generator's grammar specification.  You'd end up needing to duplicate a lot of productions to have the production itself \"know\" which context it's in.  Adding state to the actions to track this out-of-band with the parsing itself is also a little fraught, aside from not being possible with our parser infrastructure, which generates the whole parse tree first, and then processes it.\r\n\r\nIf you process the tokens \"by hand,\" though, it's more straightforward to get the nested state right for this kind of contextual information."}}
{"actor":{"display_login":"jpolitz"}}