jade-php icon indicating copy to clipboard operation
jade-php copied to clipboard

parse php function error

Open rokite opened this issue 8 years ago • 1 comments

protected function handleArgumentValue($arg)
{
   //fix parse php function error, add **strlen($arg) == 1**
    if (preg_match('/^([\'"]).*?\1/', $arg) && strlen($arg) == 1) {
        return $this->handleString(trim($arg));
    }

    try {
        return $this->handleCode($arg);
    } catch (\Exception $e) {
        // if a bug occur, try to remove comments
        try {
            return $this->handleCode(preg_replace('#/\*(.*)\*/#', '', $arg));
        } catch (\Exception $e) {
            throw new \Exception('Pug.php did not understand ' . $arg, 10, $e);
        }
    }
}

rokite avatar Jul 20 '16 10:07 rokite

Please provide a template to get the parse error to occur.

Thanks.

kylekatarnls avatar Jul 20 '16 13:07 kylekatarnls