LazyRecord\TableParser\SqliteTableDefinitionParser::tryParseIdentifier PHP Method

tryParseIdentifier() protected method

protected tryParseIdentifier ( )
    protected function tryParseIdentifier()
    {
        $this->skipSpaces();
        if ($this->str[$this->p] == '`') {
            ++$this->p;
            // find the quote pair position
            $p2 = strpos($this->str, '`', $this->p);
            if ($p2 === false) {
                throw new Exception('Expecting identifier quote (`): ' . $this->currentWindow());
            }
            $token = substr($this->str, $this->p, $p2 - $this->p);
            $this->p = $p2 + 1;
            return new Token('identifier', $token);
        }
        if (preg_match('/^(\\w+)/', substr($this->str, $this->p), $matches)) {
            $this->p += strlen($matches[0]);
            return new Token('identifier', $matches[1]);
        }
        return;
    }