{"action":"created","issue":{"url":"https://api.github.com/repos/PhilippeSigaud/Pegged/issues/34","repository_url":"https://api.github.com/repos/PhilippeSigaud/Pegged","labels_url":"https://api.github.com/repos/PhilippeSigaud/Pegged/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/PhilippeSigaud/Pegged/issues/34/comments","events_url":"https://api.github.com/repos/PhilippeSigaud/Pegged/issues/34/events","html_url":"https://github.com/PhilippeSigaud/Pegged/issues/34","id":5446277,"number":34,"title":"Wishlist: debug output for grammar parsing","user":{"login":"yoe","id":42075,"avatar_url":"https://avatars.githubusercontent.com/u/42075?v=3","gravatar_id":"","url":"https://api.github.com/users/yoe","html_url":"https://github.com/yoe","followers_url":"https://api.github.com/users/yoe/followers","following_url":"https://api.github.com/users/yoe/following{/other_user}","gists_url":"https://api.github.com/users/yoe/gists{/gist_id}","starred_url":"https://api.github.com/users/yoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoe/subscriptions","organizations_url":"https://api.github.com/users/yoe/orgs","repos_url":"https://api.github.com/users/yoe/repos","events_url":"https://api.github.com/users/yoe/events{/privacy}","received_events_url":"https://api.github.com/users/yoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2012-07-05T15:23:40Z","updated_at":"2016-03-06T12:36:54Z","closed_at":null,"body":"Hi,\n\nI'm trying to parse a file that has standard Unix-style '#-to-EOL' comments; but it's not working, and I believe at this point it's a bug in Pegged (though I'm not 100% sure).\n\nThis is my grammar:\n\n-----\nENI:\nGrammar                 <- Statement (EOL Statement)* EOL? EOI\nStatement               <- ( AutoStatement / HotplugStatement / EmptyLine / Comment )\nComment                 <: '#'\nEmptyLine               <: S*\nAutoStatement           <- 'auto' S ^Identifier\nHotplugStatement        <- 'allow-hotplug' S ^Identifier\nS                       <: ' ' / '\\t'\n-----\n\nWhen I give that the following file:\n\n-----\n\nauto lo\n#\nallow-hotplug eth0\n-----\n(i.e., the first line is empty, the third line starts with #)\n\nthen it won't parse correctly:\n\n\nParse output: failure\nnamed captures: []\nposition: [index: 0, line: 0, col: 0]\nENI.Grammar failure at pos [index: 9, line: 2, col: 0]\n  Pegged.EOI failure at pos [index: 9, line: 2, col: 0]\n\nWhen taking out the #, it works.\n\nMaybe I'm doing something wrong, but I believe this should just work ,no?"},"comment":{"url":"https://api.github.com/repos/PhilippeSigaud/Pegged/issues/comments/192884082","html_url":"https://github.com/PhilippeSigaud/Pegged/issues/34#issuecomment-192884082","issue_url":"https://api.github.com/repos/PhilippeSigaud/Pegged/issues/34","id":192884082,"user":{"login":"veelo","id":7306553,"avatar_url":"https://avatars.githubusercontent.com/u/7306553?v=3","gravatar_id":"","url":"https://api.github.com/users/veelo","html_url":"https://github.com/veelo","followers_url":"https://api.github.com/users/veelo/followers","following_url":"https://api.github.com/users/veelo/following{/other_user}","gists_url":"https://api.github.com/users/veelo/gists{/gist_id}","starred_url":"https://api.github.com/users/veelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veelo/subscriptions","organizations_url":"https://api.github.com/users/veelo/orgs","repos_url":"https://api.github.com/users/veelo/repos","events_url":"https://api.github.com/users/veelo/events{/privacy}","received_events_url":"https://api.github.com/users/veelo/received_events","type":"User","site_admin":false},"created_at":"2016-03-06T12:36:54Z","updated_at":"2016-03-06T12:36:54Z","body":"> This was made much easier after I changed the code (with a Q&D perl script) so it would write a \"matched foo\" or \"failed to match foo\", followed by the complete parse tree, to stdout every time a match or fail would occur. This generates a huge amount of data, but allows you to trace the parser as it's running.\r\n> \r\n> Perhaps this might be an interesting feature to have in Pegged itself?\r\n\r\nThis is now implemented, see https://github.com/PhilippeSigaud/Pegged/wiki/Grammar-Debugging."}}