Checks if the given character can be a separator for two lexeme.
public static isSeparator ( string $str ) : boolean | ||
$str | string | String to be checked. |
리턴 | boolean |
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('_')); }
/** * 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); }