{"action":"created","issue":{"url":"https://api.github.com/repos/wenns/sonar-cxx/issues/381","labels_url":"https://api.github.com/repos/wenns/sonar-cxx/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/wenns/sonar-cxx/issues/381/comments","events_url":"https://api.github.com/repos/wenns/sonar-cxx/issues/381/events","html_url":"https://github.com/wenns/sonar-cxx/issues/381","id":54269148,"number":381,"title":"Some rarely used forms of the switch-statement cannot be parsed","user":{"login":"wenns","id":1336856,"avatar_url":"https://avatars.githubusercontent.com/u/1336856?v=3","gravatar_id":"","url":"https://api.github.com/users/wenns","html_url":"https://github.com/wenns","followers_url":"https://api.github.com/users/wenns/followers","following_url":"https://api.github.com/users/wenns/following{/other_user}","gists_url":"https://api.github.com/users/wenns/gists{/gist_id}","starred_url":"https://api.github.com/users/wenns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenns/subscriptions","organizations_url":"https://api.github.com/users/wenns/orgs","repos_url":"https://api.github.com/users/wenns/repos","events_url":"https://api.github.com/users/wenns/events{/privacy}","received_events_url":"https://api.github.com/users/wenns/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wenns/sonar-cxx/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/wenns/sonar-cxx/milestones/4","labels_url":"https://api.github.com/repos/wenns/sonar-cxx/milestones/4/labels","id":920882,"number":4,"title":"M 0.9.3","description":"Reaching this milestone should lead to the 0.9.3 release.","creator":{"login":"guwirth","id":6077367,"avatar_url":"https://avatars.githubusercontent.com/u/6077367?v=3","gravatar_id":"","url":"https://api.github.com/users/guwirth","html_url":"https://github.com/guwirth","followers_url":"https://api.github.com/users/guwirth/followers","following_url":"https://api.github.com/users/guwirth/following{/other_user}","gists_url":"https://api.github.com/users/guwirth/gists{/gist_id}","starred_url":"https://api.github.com/users/guwirth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guwirth/subscriptions","organizations_url":"https://api.github.com/users/guwirth/orgs","repos_url":"https://api.github.com/users/guwirth/repos","events_url":"https://api.github.com/users/guwirth/events{/privacy}","received_events_url":"https://api.github.com/users/guwirth/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":1,"state":"open","created_at":"2015-01-04T08:15:36Z","updated_at":"2015-01-17T17:12:05Z","due_on":"2015-05-30T22:00:00Z","closed_at":null},"comments":2,"created_at":"2015-01-14T00:33:12Z","updated_at":"2015-01-18T08:31:42Z","closed_at":null,"body":"Some of the switch-statement syntax forms are not supported, e.g.:\r\n```C++\r\nswitch (0) { {default : break;} }\r\n```\r\nThis is a regression, which came with: \r\n\r\n```\r\ncommit 46e69b192f79816a3bd66e19f596295261150ecf\r\nAuthor: Bert <bert.k@hotmail.com>\r\nDate:   Wed Jan 1 12:01:56 2014 +0100\r\n\r\n    Improve SQUID for new checks\r\n    \r\n    - split selectionStatement and refine switch statement\r\n    - introduce nullptr rule\r\n```\r\n\r\nPer standard any statements are allowed in the body:\r\n```\r\nswitch ( condition ) statement\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/wenns/sonar-cxx/issues/comments/70400435","html_url":"https://github.com/wenns/sonar-cxx/issues/381#issuecomment-70400435","issue_url":"https://api.github.com/repos/wenns/sonar-cxx/issues/381","id":70400435,"user":{"login":"Bertk","id":2315215,"avatar_url":"https://avatars.githubusercontent.com/u/2315215?v=3","gravatar_id":"","url":"https://api.github.com/users/Bertk","html_url":"https://github.com/Bertk","followers_url":"https://api.github.com/users/Bertk/followers","following_url":"https://api.github.com/users/Bertk/following{/other_user}","gists_url":"https://api.github.com/users/Bertk/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertk/subscriptions","organizations_url":"https://api.github.com/users/Bertk/orgs","repos_url":"https://api.github.com/users/Bertk/repos","events_url":"https://api.github.com/users/Bertk/events{/privacy}","received_events_url":"https://api.github.com/users/Bertk/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T08:31:42Z","updated_at":"2015-01-18T08:31:42Z","body":"I will check to add the ```compoundStatement``` to ```switchBlockStatementGroups``` sequence using ```b.zeroOrMore()``` and the affected part will be the following.\r\n\r\n```\r\n    b.rule(switchStatement).is(CxxKeyword.SWITCH, \"(\", condition, \")\", \"{\", switchBlockStatementGroups, \"}\");\r\n\r\n    b.rule(switchBlockStatementGroups).is(b.zeroOrMore(switchBlockStatementGroup));\r\n\r\n    b.rule(switchBlockStatementGroup).is(switchLabelStatement, b.optional(emptyStatement), b.zeroOrMore(statement), b.optional(jumpStatement));\r\n\r\n```\r\n"}}