Same name in other branches
  1. 5.0.x advagg_js_minify/jshrink.inc \JShrink\Minifier::saveRegex()
  2. 7.x-2.x advagg_js_compress/jshrink.inc \JShrink\Minifier::saveRegex()
  3. 8.x-2.x advagg_js_minify/jshrink.inc \JShrink\Minifier::saveRegex()
  4. 8.x-3.x advagg_js_minify/jshrink.inc \JShrink\Minifier::saveRegex()
  5. 8.x-4.x advagg_js_minify/jshrink.inc \JShrink\Minifier::saveRegex()

When a regular expression is detected this function crawls for the end of it and saves the whole regex.

Throws

\RuntimeException Unclosed regex will throw an error

1 call to Minifier::saveRegex()
Minifier::loop dans advagg_js_minify/jshrink.inc
The primary action occurs here. This function loops through the input string, outputting anything that's relevant and discarding anything that is not.

Fichier

advagg_js_minify/jshrink.inc, line 578

Classe

Minifier
Minifier

Namespace

JShrink

Code

protected function saveRegex() {
    echo $this->a . $this->b;
    while (($this->a = $this->getChar()) !== false) {
        if ($this->a === '/') {
            break;
        }
        if ($this->a === '\\') {
            echo $this->a;
            $this->a = $this->getChar();
        }
        if ($this->a === "\n") {
            throw new \RuntimeException('Unclosed regex pattern at position: ' . $this->index);
        }
        echo $this->a;
    }
    $this->b = $this->getReal();
}