You are here

protected function JSMin::get in Javascript Aggregator 5

Same name and namespace in other branches
  1. 6 jsmin.php \JSMin::get()
3 calls to JSMin::get()
JSMin::action in ./jsmin.php
JSMin::next in ./jsmin.php
JSMin::peek in ./jsmin.php

File

./jsmin.php, line 135

Class

JSMin
jsmin.php - PHP implementation of Douglas Crockford's JSMin.

Code

protected function get() {
  $c = $this->lookAhead;
  $this->lookAhead = null;
  if ($c === null) {
    if ($this->inputIndex < $this->inputLength) {
      $c = $this->input[$this->inputIndex];
      $this->inputIndex += 1;
    }
    else {
      $c = null;
    }
  }
  if ($c === "\r") {
    return "\n";
  }
  if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
    return $c;
  }
  return ' ';
}