setState('Comment'); $firstChars = $sql->getData($sql->getPointer() + 3, false); $includeMatch = true; $returnStatement = false; if (substr($firstChars, 0, 2) == '--' || substr($firstChars, 0, 1) == '#') { // one line comment -> match new line $match = "\n"; $includeMatch = false; } else { if ($firstChars == '/*!') { // conditionial statement $match = '*/;'; $returnStatement = true; } else { // multi line comment $match = '*/'; } } $endOfStatement = $sql->getPosition($match, $includeMatch); $statement = $sql->getData($endOfStatement); if ($returnStatement === true) { return $statement; } else { return ''; } } }