UDL Comment Help

2012-10-27
2012-11-13
  • Choonster TheMage

    I'm trying to create a UDL for a very basic language. This language uses a single hash (#) to start a line comment, but I'd also like lines starting with a double hash (##) to display as normal text.

    Is there a better way to do this than setting a hash as the line comment closing character? This displays the double hash as a comment, but not the text after it (ideally the whole line would show as normal text).

    I'd be satisfied if I could use a hash followed by a space or an at ("# " or "#@") as the two line comment openers, but as far as I can tell there's no way to use whitespace in an opener.

    In the previous UDL system I believe I just defined # as the comment opener and ## as a keyword, but that doesn't seem to work with UDL 2.0.

    Is there any way to do this?

     
  • Loreia2

    Loreia2 - 2012-10-29

    Hi choonster,

    do it like this:

    1. don't use "line comments" feature at all

    2. define Delimiter1 as:
    - open: ##
    - close: ((EOL))
    Leave styler with default options.

    3. define Delimiter2 as:
    - open: #
    - close: ((EOL))
    Set styler to match old line comments

    That should do it.

    Thank you and best regards,
    Loreia

     
  • Choonster TheMage

    Thank you, that worked perfectly.