function checkCommentForSpace(node){var type=node.type.toLowerCase(),rule=styleRules[type],commentIdentifier=type==="block"?"/*":"//";// Ignores empty comments.
if(node.value.length===0){return;}var beginMatch=rule.beginRegex.exec(node.value);var endMatch=rule.endRegex.exec(node.value);// Checks.
if(requireSpace){if(!beginMatch){var hasMarker=rule.markers.exec(node.value);var marker=hasMarker?commentIdentifier+hasMarker[0]:commentIdentifier;if(rule.hasExceptions){reportBegin(node,"Expected exception block, space or tab after '{{refChar}}' in comment.",hasMarker,marker);}else{reportBegin(node,"Expected space or tab after '{{refChar}}' in comment.",hasMarker,marker);}}if(balanced&&type==="block"&&!endMatch){reportEnd(node,"Expected space or tab before '*/' in comment.");}}else{if(beginMatch){if(!beginMatch[1]){reportBegin(node,"Unexpected space or tab after '{{refChar}}' in comment.",beginMatch,commentIdentifier);}else{reportBegin(node,"Unexpected space or tab after marker ({{refChar}}) in comment.",beginMatch,beginMatch[1]);}}if(balanced&&type==="block"&&endMatch){reportEnd(node,"Unexpected space or tab before '*/' in comment.",endMatch);}}}
Reports a given comment if it's invalid.
@param {ASTNode} node - a comment node to check.
@returns {void}