isSeparator() public static method

Checks if the given character can be a separator for two lexeme.
public static isSeparator ( string $str ) : boolean
$str string String to be checked.
return boolean
Example #1
0
 public function testisSeparator()
 {
     $this->assertTrue(Context::isSeparator('+'));
     $this->assertTrue(Context::isSeparator('.'));
     $this->assertFalse(Context::isSeparator('1'));
     $this->assertFalse(Context::isSeparator('E'));
     $this->assertFalse(Context::isSeparator('_'));
 }
Example #2
0
 /**
  * Parses unknown parts of the query.
  *
  * @return Token
  */
 public function parseUnknown()
 {
     $token = $this->str[$this->last];
     if (Context::isSeparator($token)) {
         return null;
     }
     while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
         $token .= $this->str[$this->last];
     }
     --$this->last;
     return new Token($token);
 }