{"action":"created","issue":{"url":"https://api.github.com/repos/federicobond/solidity-parser-antlr/issues/20","repository_url":"https://api.github.com/repos/federicobond/solidity-parser-antlr","labels_url":"https://api.github.com/repos/federicobond/solidity-parser-antlr/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/federicobond/solidity-parser-antlr/issues/20/comments","events_url":"https://api.github.com/repos/federicobond/solidity-parser-antlr/issues/20/events","html_url":"https://github.com/federicobond/solidity-parser-antlr/issues/20","id":323134257,"node_id":"MDU6SXNzdWUzMjMxMzQyNTc=","number":20,"title":"Ability to parse NatSpec comments","user":{"login":"chmanie","id":2174084,"node_id":"MDQ6VXNlcjIxNzQwODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2174084?v=4","gravatar_id":"","url":"https://api.github.com/users/chmanie","html_url":"https://github.com/chmanie","followers_url":"https://api.github.com/users/chmanie/followers","following_url":"https://api.github.com/users/chmanie/following{/other_user}","gists_url":"https://api.github.com/users/chmanie/gists{/gist_id}","starred_url":"https://api.github.com/users/chmanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chmanie/subscriptions","organizations_url":"https://api.github.com/users/chmanie/orgs","repos_url":"https://api.github.com/users/chmanie/repos","events_url":"https://api.github.com/users/chmanie/events{/privacy}","received_events_url":"https://api.github.com/users/chmanie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-15T09:22:16Z","updated_at":"2018-07-06T16:57:18Z","closed_at":null,"author_association":"NONE","body":"First of all thanks for creating this fine tool. It's been helping us a lot already!\r\n\r\nIn our effort to generate documentation from [Ethereum NatSpec comments](https://github.com/ethereum/wiki/wiki/Ethereum-Natural-Specification-Format) I decided to take a crack at adding the ability to parse those to this tool. I have to admit I am quite new to Antlr and for quite some time it felt like I was just messing around with it. But I got to a state where I am able to successfully parse single line and multiline NatSpec comments and add them to the AST. That didn't come without any caveats though:\r\n\r\n- Quotes (single or double) break the parsing (it just won't pick it up)\r\n- The regex used to pick up multiline comments is just embarrassingly simple (it will just ignore any comments without an `@` in them)\r\n- Also there definitely must be some room for improvement and/or simplification in both the grammar and the AST builder\r\n\r\nThese are things I couldn't figure out yet (also sadly due to the sparse JS runtime documentation) and if this is a thing you might want to include I'd highly appreciate a little push in the correct direction.\r\n\r\nHere's my attempt so far:\r\n\r\nThe antlr grammar:\r\nhttps://github.com/solidityj/solidity-antlr4/compare/master...chmanie:feature/add-natspec\r\n\r\nThe AST builder:\r\nhttps://github.com/federicobond/solidity-parser-antlr/compare/master...chmanie:feature/add-natspec\r\n"},"comment":{"url":"https://api.github.com/repos/federicobond/solidity-parser-antlr/issues/comments/403090514","html_url":"https://github.com/federicobond/solidity-parser-antlr/issues/20#issuecomment-403090514","issue_url":"https://api.github.com/repos/federicobond/solidity-parser-antlr/issues/20","id":403090514,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzA5MDUxNA==","user":{"login":"federicobond","id":138426,"node_id":"MDQ6VXNlcjEzODQyNg==","avatar_url":"https://avatars1.githubusercontent.com/u/138426?v=4","gravatar_id":"","url":"https://api.github.com/users/federicobond","html_url":"https://github.com/federicobond","followers_url":"https://api.github.com/users/federicobond/followers","following_url":"https://api.github.com/users/federicobond/following{/other_user}","gists_url":"https://api.github.com/users/federicobond/gists{/gist_id}","starred_url":"https://api.github.com/users/federicobond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/federicobond/subscriptions","organizations_url":"https://api.github.com/users/federicobond/orgs","repos_url":"https://api.github.com/users/federicobond/repos","events_url":"https://api.github.com/users/federicobond/events{/privacy}","received_events_url":"https://api.github.com/users/federicobond/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T16:57:18Z","updated_at":"2018-07-06T16:57:18Z","author_association":"OWNER","body":"Hi @chmanie, this is starting to become more of a priority for me too. Are you still working on it?"}}
{"actor":{"display_login":"federicobond"}}