UDL Comment Initialization with Whitespace
Hi! I’m trying to make a UDL for MCNP (Monte Carlo N-Particle Transport Code), and I’m running into issues setting up comments. In MCNP, comment lines typically begin with the letter “c” (not case-sensitive) and are followed by a space before the actual content of the comment begins. This is only really an issue due to the fact that other commands that show up at the beginning of lines start with the letter “c” and keep getting commented out when they should not. Does anyone know how I would specify to look for both a “c” and a space to initialize a comment line?
UDL is nice, but it cannot handle every possible condition. I don’t think it will do that natively.
However, you can add extra highlighting to a User Defined Language (UDL) using regexes via the script
EnhanceAnyLexer.pythat @Ekopalypse shares in his github repo – so with installing the PythonScript plugin and using the linked solution, you could define a regex that will color text matching
r'c\h+'(raw string, with c followed by horizontal space), or similar, in some way to indicate a cmoment.