(What is happening is that, the \lstinline looks for an optional list of key=value pairs, when it first encounters [.) I am posting this answer, mostly for the reason that, using \verb, you end up with different font family, which may well be your desire!