{"action":"created","issue":{"url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/251","labels_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/251/labels{/name}","comments_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/251/comments","events_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/251/events","html_url":"https://github.com/sandstorm-io/capnproto/issues/251","id":109669614,"number":251,"title":"parser complains about a missing ID although the ID is present","user":{"login":"eriksjolund","id":106877,"avatar_url":"https://avatars.githubusercontent.com/u/106877?v=3","gravatar_id":"","url":"https://api.github.com/users/eriksjolund","html_url":"https://github.com/eriksjolund","followers_url":"https://api.github.com/users/eriksjolund/followers","following_url":"https://api.github.com/users/eriksjolund/following{/other_user}","gists_url":"https://api.github.com/users/eriksjolund/gists{/gist_id}","starred_url":"https://api.github.com/users/eriksjolund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriksjolund/subscriptions","organizations_url":"https://api.github.com/users/eriksjolund/orgs","repos_url":"https://api.github.com/users/eriksjolund/repos","events_url":"https://api.github.com/users/eriksjolund/events{/privacy}","received_events_url":"https://api.github.com/users/eriksjolund/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sandstorm-io/capnproto/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-04T08:28:52Z","updated_at":"2015-10-06T17:16:27Z","closed_at":null,"body":"I've encountered a confusing error message when parsing a syntactically incorrect schema file.\r\nThis is very low priority but anyway:\r\n \r\nThe parser complained about a missing ID although the ID was present in the file. It would have been better if the parser would only have complained about line 4 where the syntax error was.\r\n\r\n    user@ubuntu:/tmp$ capnp --version\r\n    Cap'n Proto version 0.5.3\r\n    user@ubuntu:/tmp$ cat a.capnp\r\n    @0xdbb9ad1f14bf0b36;\r\n    \r\n    struct Person {\r\n      name @0 :Text; // A mistake, I should have used # for comments\r\n    }\r\n    user@ubuntu:/tmp$ capnp compile -oc++ a.capnp\r\n      a.capnp:4:30: error: Parse error.\r\n      a.capnp:1:1: error: File does not declare an ID.  I've generated one for you.  Add this line to your file:  @0xbe52960005d73d32;\r\n    user@ubuntu:/tmp$\r\n"},"comment":{"url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/comments/145931884","html_url":"https://github.com/sandstorm-io/capnproto/issues/251#issuecomment-145931884","issue_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/251","id":145931884,"user":{"login":"kentonv","id":4001805,"avatar_url":"https://avatars.githubusercontent.com/u/4001805?v=3","gravatar_id":"","url":"https://api.github.com/users/kentonv","html_url":"https://github.com/kentonv","followers_url":"https://api.github.com/users/kentonv/followers","following_url":"https://api.github.com/users/kentonv/following{/other_user}","gists_url":"https://api.github.com/users/kentonv/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonv/subscriptions","organizations_url":"https://api.github.com/users/kentonv/orgs","repos_url":"https://api.github.com/users/kentonv/repos","events_url":"https://api.github.com/users/kentonv/events{/privacy}","received_events_url":"https://api.github.com/users/kentonv/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T17:16:27Z","updated_at":"2015-10-06T17:16:27Z","body":"Problem is that when compilation fails in the lexing stage, no parse tree is returned at all. Solution: don't check for the ID if compilation already failed. Or maybe don't complain about the missing ID if the file appears empty."}}