jade-php
jade-php copied to clipboard
parse php function error
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);
}
}
}
Please provide a template to get the parse error to occur.
Thanks.