{"action":"opened","issue":{"url":"https://api.github.com/repos/SAP/chevrotain/issues/475","repository_url":"https://api.github.com/repos/SAP/chevrotain","labels_url":"https://api.github.com/repos/SAP/chevrotain/issues/475/labels{/name}","comments_url":"https://api.github.com/repos/SAP/chevrotain/issues/475/comments","events_url":"https://api.github.com/repos/SAP/chevrotain/issues/475/events","html_url":"https://github.com/SAP/chevrotain/issues/475","id":231675346,"number":475,"title":"How do I prevent a rule from creating CST nodes? I don't want method lineBreaks in my visitor","user":{"login":"deltaidea","id":4950036,"avatar_url":"https://avatars1.githubusercontent.com/u/4950036?v=3","gravatar_id":"","url":"https://api.github.com/users/deltaidea","html_url":"https://github.com/deltaidea","followers_url":"https://api.github.com/users/deltaidea/followers","following_url":"https://api.github.com/users/deltaidea/following{/other_user}","gists_url":"https://api.github.com/users/deltaidea/gists{/gist_id}","starred_url":"https://api.github.com/users/deltaidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deltaidea/subscriptions","organizations_url":"https://api.github.com/users/deltaidea/orgs","repos_url":"https://api.github.com/users/deltaidea/repos","events_url":"https://api.github.com/users/deltaidea/events{/privacy}","received_events_url":"https://api.github.com/users/deltaidea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-26T16:30:54Z","updated_at":"2017-05-26T16:30:54Z","closed_at":null,"body":"In my grammar new lines can't be ignored as they may only appear in certain places. They also can't be collected into a single token because an ignored token (comment) can be inserted between them:\r\n\r\n```Ruby\r\n# newline\r\n/* comment */ # ignored token\r\n# newline - goes into a separate token, even if defined as \\n+\r\n```\r\n\r\nI have a convenience rule for this reason, to avoid duplication and dealing with CONSUME indexes:\r\n```TypeScript\r\nprivate lineBreaks = this.RULE('lineBreaks', () => {\r\n  this.AT_LEAST_ONE(() => { this.CONSUME(LineBreak) })\r\n})\r\n```\r\n\r\nHow do I prevent this rule from creating CST nodes? It forces me to have `lineBreaks` method in my CST visitor because `this.validateVisitor()` says so:\r\n\r\n```TypeScript\r\nlineBreaks () {\r\n  return\r\n}\r\n```\r\n\r\nIt looks confusing and also is never called which affects test coverage.\r\n\r\nWhat is the correct way to deal with this?\r\nMaybe I'm entirely wrong with my approach. I'd appreciate any pointers.\r\n\r\nFull source code if necessary: https://github.com/deltaidea/mangudai/tree/master/src/parseRms"}}
{"actor":{"display_login":"deltaidea"}}