There's a few related questions.
Anyway, in summary,
- if you are okay with disabling ligatures globally for Fira Mono font, just use 4th question above (if XeLaTeX/LuaLaTeX) or 5th question above (PDFLaTeX)
Otherwise, keep reading.
As mentioned by egreg in the comment, it's because of the matching of the \@xverbatim macro.

The only way I can think of is to selectively redefine \@xverbatim when needed.
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{fontspec}
\setmonofont{FiraCode-Regular.ttf}[ % https://github.com/tonsky/FiraCode/releases
Contextuals=Alternate
]
\makeatletter
% Snippets of lstfiracode.sty, v0.1b
\let\lstfiracode@verbatim@nolig@list\verbatim@nolig@list
\usepackage{precattl}
\precattlExec{
\newcommand\ActivateVerbatimLigatures{%
\gdef@xverbatim##1\cO\end\cO{verbatim\cO}{##1\end{verbatim}}%
\def\verbatim@nolig@list{\do`\do,\do'}%
}
\newcommand\DeactivateVerbatimLigatures{%
\gdef@xverbatim##1\cO\end\cA{verbatim\cA}{##1\end{verbatim}}%
\expandafter\def\expandafter\verbatim@nolig@list\expandafter{%
\lstfiracode@verbatim@nolig@list
\do\w\do*\do/\do:\do=\do!\do~\do[%
\do#\do(\do?\do_\do.\do;\do&\do|%
\do+\do$\do@\do%\do]\do{\do}%
}%
}
}
\makeatother
\begin{document}
\ActivateVerbatimLigatures
\begin{verbatim}
A<-www>>=B#{C|}D
\end{verbatim}
\DeactivateVerbatimLigatures
\begin{verbatim}
A<-www>>=B#{C|}D
\end{verbatim}
\end{document}
Of course, this monkey-patches the verbatim environment, so if at any point in time the LaTeX kernel is modified, this will break horribly.
Explanation
Basically, the normal definition of \@xverbatim is:
\gdef\@xverbatim#1\cO\\end\cO\{verbatim\cO\}{#1\end{verbatim}}
where \cO\⟨character⟩ represents a other-category token with charcode = that character.
That matches the document until the specified token list is seen.
When { and } are made active, then you want to modify the definition to:
\gdef\@xverbatim#1\cO\\end\cA\{verbatim\cA\}{#1\end{verbatim}}
where \cA\⟨character⟩ represents a active-category token with charcode = that character.
If you don't want to use my package precattl, there are other ways to insert the weird-catcode tokens in. One is to use the catcode-changing trick.
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{fontspec}
\setmonofont{FiraCode-Regular.ttf}[ % https://github.com/tonsky/FiraCode/releases
Contextuals=Alternate
]
\makeatletter
% Snippets of lstfiracode.sty, v0.1b
\let\lstfiracode@verbatim@nolig@list\verbatim@nolig@list
\begingroup \catcode |=0 \catcode[=1
\catcode ]=2 \catcode{=12 \catcode \}=12 \catcode\=12
|gdef|ActivateVerbatimLigatures[%
|gdef|@xverbatim##1\end{verbatim}[##1|end[verbatim]]%
|def|verbatim@nolig@list[|do|`|do|,|do|']%
]
|catcode |{|active |catcode|}|active
|gdef|DeactivateVerbatimLigatures[%
|gdef|@xverbatim##1\end{verbatim}[##1|end[verbatim]]%
|expandafter|def|expandafter|verbatim@nolig@list|expandafter[%
|lstfiracode@verbatim@nolig@list
|do|w|do|*|do|/|do|:|do|=|do|!|do|~|do|[%
|do|#|do|(|do|?|do|_|do|.|do|;|do|&|do||%
|do|+|do|$|do|@|do|%|do|]|do|{|do|}%
]%
]
|endgroup
\makeatother
\begin{document}
\ActivateVerbatimLigatures
\begin{verbatim}
A<-www>>=B#{C|}D
\end{verbatim}
\DeactivateVerbatimLigatures
\begin{verbatim}
A<-www>>=B#{C|}D
\end{verbatim}
\end{document}
The other is to use \lowercase trick.
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{fontspec}
\setmonofont{FiraCode-Regular.ttf}[ % https://github.com/tonsky/FiraCode/releases
Contextuals=Alternate
]
\makeatletter
% Snippets of lstfiracode.sty, v0.1b
\let\lstfiracode@verbatim@nolig@list\verbatim@nolig@list
\begingroup
\catcodeX\active \catcodeY\active
\lccode[={
\lccode]=}
\lccodeX={
\lccodeY=}
\lccode/=\
\lowercase{\endgroup
\newcommand\ActivateVerbatimLigatures{%
\gdef@xverbatim##1/end[verbatim]{##1\end{verbatim}}
\def\verbatim@nolig@list{\do`\do,\do'}%
}
\newcommand\DeactivateVerbatimLigatures{%
\gdef@xverbatim##1/endXverbatimY{##1\end{verbatim}}
\expandafter\def\expandafter\verbatim@nolig@list\expandafter{%
\lstfiracode@verbatim@nolig@list
\do\w\do*\do/\do:\do=\do!\do~\do[%
\do#\do(\do?\do_\do.\do;\do&\do|%
\do+\do$\do@\do%\do]\do{\do}%
}%
}
}
\makeatother
\begin{document}
\ActivateVerbatimLigatures
\begin{verbatim}
A<-www>>=B#{C|}D
\end{verbatim}
\DeactivateVerbatimLigatures
\begin{verbatim}
A<-www>>=B#{C|}D
\end{verbatim}
\end{document}
Contextuals=Alternateif you want to suppress them? – Ulrike Fischer Dec 21 '18 at 17:00\end{verbatim}doesn't match the terminator sequence, which is expecting{and}with category code 12. – egreg Dec 21 '18 at 17:05\ActivateVerbatimLigaturesis possible. – Ruixi Zhang Dec 21 '18 at 17:40\end{verbatim}does not contain the lowercase letterw. – Ruixi Zhang Dec 21 '18 at 17:44