You are here

public function JSParser::parse in Javascript Aggregator 6

File

./jsminplus.php, line 732

Class

JSParser

Code

public function parse($s, $f, $l) {

  // initialize tokenizer
  $this->t
    ->init($s, $f, $l);
  $x = new JSCompilerContext(false);
  $n = $this
    ->Script($x);
  if (!$this->t
    ->isDone()) {
    throw $this->t
      ->newSyntaxError('Syntax error');
  }
  return $n;
}