You are here

public function JSTokenizer::peek in Advanced CSS/JS Aggregation 8.2

Same name and namespace in other branches
  1. 8.4 advagg_js_minify/jsminplus.inc \JSTokenizer::peek()
  2. 8.3 advagg_js_minify/jsminplus.inc \JSTokenizer::peek()
  3. 6 advagg_js_compress/jsminplus.inc \JSTokenizer::peek()
  4. 7.2 advagg_js_compress/jsminplus.inc \JSTokenizer::peek()
  5. 7 advagg_js_compress/jsminplus.inc \JSTokenizer::peek()
2 calls to JSTokenizer::peek()
JSTokenizer::isDone in advagg_js_minify/jsminplus.inc
JSTokenizer::peekOnSameLine in advagg_js_minify/jsminplus.inc

File

advagg_js_minify/jsminplus.inc, line 1988
JSMinPlus version 1.4

Class

JSTokenizer

Code

public function peek() {
  if ($this->lookahead) {
    $next = $this->tokens[$this->tokenIndex + $this->lookahead & 3];
    if ($this->scanNewlines && $next->lineno != $this->lineno) {
      $tt = TOKEN_NEWLINE;
    }
    else {
      $tt = $next->type;
    }
  }
  else {
    $tt = $this
      ->get();
    $this
      ->unget();
  }
  return $tt;
}