protected function readLiteral($input, $delim = '"', $escaper = NULL)
	{
		$literal = '';
		$escaped = false;
		$terminated = false;
		
		for($size = strlen($input), $i = 1; $i < $size; $i++)
		{
			if($input[$i] == $escaper)
			{
				if($escaped)
				{
					$literal .= $escaper;
					$escaped = false;
					
					continue;
				}
				
				$escaped = true;
				
				continue;
			}
			
			if($input[$i] == $delim)
			{
				if($escaped)
				{
					$escaped = false;
					$literal .= $delim;
					
					continue;
				}
				
				$terminated = true;
				
				break;
			}
			
			$escaped = false;
			$literal .= $input[$i];
		}
		
		if(!$terminated)
		{
			throw new \RuntimeException(sprintf('Unterminated literal: %s%s', $delim, $literal));
		}
		
		return $literal;
	}
protected function readLiteral($input, $delim = '"', $escaper = NULL)
	{
		$literal = '';
		$escaped = false;
		$terminated = false;
		
		for($size = strlen($input), $i = 1; $i < $size; $i++)
		{
			if($input[$i] == $escaper)
			{
				if($escaped)
				{
					$literal .= $escaper;
					$escaped = false;
					
					continue;
				}
				
				$escaped = true;
				
				continue;
			}
			
			if($input[$i] == $delim)
			{
				if($escaped)
				{
					$escaped = false;
					$literal .= $delim;
					
					continue;
				}
				
				$terminated = true;
				
				break;
			}
			
			$escaped = false;
			$literal .= $input[$i];
		}
		
		if(!$terminated)
		{
			throw new \RuntimeException(sprintf('Unterminated literal: %s%s', $delim, $literal));
		}
		
		return $literal;
	}
protected function readLiteral ( $ input , $ delim = '"' , $ escaper = NULL ) { $ literal = '' ; $ escaped = false ; $ terminated = false ; for ( $ size = strlen ( $ input ) , $ i = 1 ; $ i < $ size ; $ i ++ ) { if ( $ input [ $ i ] == $ escaper ) { if ( $ escaped ) { $ literal .= $ escaper ; $ escaped = false ; continue ; } $ escaped = true ; continue ; } if ( $ input [ $ i ] == $ delim ) { if ( $ escaped ) { $ escaped = false ; $ literal .= $ delim ; continue ; } $ terminated = true ; break ; } $ escaped = false ; $ literal .= $ input [ $ i ] ; } if ( ! $ terminated ) { throw new \ RuntimeException ( sprintf ( 'Unterminated literal: %s%s' , $ delim , $ literal ) ) ; } return $ literal ; }
Reads a literal from the input delimited by the given delimiter.

@param string $input
@param string $delim The delimiter character.
@param string $escaper An escaping character.
@return string Parsed literal value without delimters.

@throws \RuntimeException When an unterminated literal is detected.
Reads a literal from the input delimited by the given delimiter .