I am using the listings package in order to typeset JVMIS code in LaTeX. Is there a chance to highlight the labels in such code? At the moment I have with the default definition JVMIS
Lab:
iconst_2
iconst_3
iadd
where the keywords (iconst, iadd, etc) are highlighted nicely, but the Lab: is not. The syntax of labels is as usual in assembly "some_string:". Is there a way to tweak the language definition so that labels are highlighted also (preferably in a different colour)?
Thanks a lot!
Update Sorry, a code sample would be
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\definecolor{codegreen}{rgb}{0.25,0.5,0.35} % comments
\definecolor{codepurple}{rgb}{0.5,0,0.35} % keywords
\lstset{basicstyle=\ttfamily,
keywordstyle=\color{codepurple},
stringstyle=\color{codegreen}
}
\begin{document}
\begin{lstlisting}[language=JVMIS]
Label:
ldc 3
iconst_3
iadd
\end{lstlisting}
\end{document}
This produces
where Label is not highlighted.

:. – Marijn Feb 03 '20 at 12:04