You are here

function csstidy_print::_seeknocomment in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 6 advagg_css_compress/csstidy/class.csstidy_print.inc \csstidy_print::_seeknocomment()

Gets the next token type which is $move away from $key, excluding comments

@access private @version 1.0

Parameters

integer $key current position:

integer $move move this far:

Return value

mixed a token type

1 call to csstidy_print::_seeknocomment()
csstidy_print::_print in advagg_css_compress/csstidy/class.csstidy_print.inc
Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain

File

advagg_css_compress/csstidy/class.csstidy_print.inc, line 287

Class

csstidy_print
CSS Printing class

Code

function _seeknocomment($key, $move) {
  $go = $move > 0 ? 1 : -1;
  for ($i = $key + 1; abs($key - $i) - 1 < abs($move); $i += $go) {
    if (!isset($this->tokens[$i])) {
      return;
    }
    if ($this->tokens[$i][0] == COMMENT) {
      $move += 1;
      continue;
    }
    return $this->tokens[$i][0];
  }
}