Jade\Compiler\CommonUtils::escapedEnd PHP 메소드

escapedEnd() 공개 정적인 메소드

Return true if the ending quote of the string is escaped.
public static escapedEnd ( string $quotedString ) : boolean
$quotedString string
리턴 boolean
    public static function escapedEnd($quotedString)
    {
        $end = substr($quotedString, strlen(rtrim($quotedString, '\\')));
        return substr($end, 0, 1) === '\\' && strlen($end) & 1;
    }

Usage Example

예제 #1
0
파일: Attributes.php 프로젝트: XaBerr/JUICE
 protected function parseString(&$states, &$key, &$val, &$quote, $char)
 {
     if (($char === '"' || $char === "'") && !CommonUtils::escapedEnd($val)) {
         $stringParser = new StringAttribute($char);
         $stringParser->parse($states, $val, $quote);
         return;
     }
     ${in_array($states->current(), array('key', 'key char')) ? 'key' : 'val'} .= $char;
 }