protected function match($code, $line)
    {
        foreach ($this->patterns as $token => $pattern) {
            if (!preg_match($pattern, $code, $matches)) {
                continue;
            }

            return new Token($token, $matches[1], $line);
        }

        return false;
    }