You are here

public function JSTokenizer::peek in Javascript Aggregator 6

2 calls to JSTokenizer::peek()
JSTokenizer::isDone in ./jsminplus.php
JSTokenizer::peekOnSameLine in ./jsminplus.php

File

./jsminplus.php, line 1793

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;
}