Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    UDL Comment Initialization with Whitespace

    Help wanted · · · – – – · · ·
    2
    2
    103
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • John Smith 3
      John Smith 3 last edited by

      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?

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @John Smith 3 last edited by

        @John-Smith-3 ,

        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.py that @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.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors