SassParser::createToken PHP Method

createToken() public method

If the statement is just and end block we update the meta data and return null.
public createToken ( string $statement ) : object | null
$statement string source statement
return object | null
    public function createToken($statement)
    {
        $this->line += substr_count($statement, "\n");
        $statement = trim($statement);
        if (substr($statement, 0, self::BEGIN_CSS_COMMENT_STRLEN) !== self::BEGIN_CSS_COMMENT) {
            $statement = str_replace(array("\n", "\r"), '', $statement);
        }
        $last = substr($statement, -1);
        // Trim the statement removing whitespace, end statement (;), begin block ({), and (unless the statement ends in an interpolation block) end block (})
        $statement = rtrim($statement, ' ' . self::BEGIN_BLOCK . self::END_STATEMENT);
        $statement = preg_match('/#\\{.+?\\}$/i', $statement) ? $statement : rtrim($statement, self::END_BLOCK);
        $token = $statement ? (object) array('source' => $statement, 'level' => $this->_tokenLevel, 'filename' => $this->filename, 'line' => $this->line) : null;
        $this->_tokenLevel += $last === self::BEGIN_BLOCK ? 1 : ($last === self::END_BLOCK ? -1 : 0);
        return $token;
    }