Setting up User Defined Language Comment Section - exclusion issue



  • I’m working on using User Defined Languages to define comments, a .WoWlua interpreter. I trying to set up the comment section.

    For .lua It seems I can either set up for single line comments with “–” (double dash) as an ‘Open’ in Comment Line Style, and this works fine, or I can set up “–[[” in ‘Open’ as a Comment Style with a “]]” for a ‘Close’ but I can’t figure out how to do both.

    If I include the “–” (double dash) in Comment Line Style, the Comment Style starting with “–[[” does not get interpreted as the “–” takes precedent, and it thinks its a
    –Comment containing “[[” as part of the comment, after the “–” double dash…

    –[[ Comment

    ]]
    – type comment and so only --[[ Comment gets treated as a comment, and the rest is ignored.

    I tried something like ->>- and this worked to make the line comment

    Is this something I’ve overlooked, in understanding in using User Defined Language app, or a bug? If so, what am I misunderstanding in the .doc site instructions; or is there a workaround, if a bug?

    Any help with this? Thanks for your consideration.



  • Wow, so reread documentation again, and it appears that Don of Notepad++, worked with, or had developed a section to handle this exception. I’m seeing that making an interpreter like this is problematic. Kudos for UDL working on that, as I’m sure this wheel gets reinvented for every Language Plugin. So, it’s ironic that the section in UDL doesn’t support operators in the interpretation for forward/reverse logic in the comment section. Not that I know this would help here. In starting the UDL, I picked the comment section as the first part to start with, as it seemed to be the first win I could get, this exception really threw me… till I did what Don had to do for C/C++ that I had to do with .lua which is use the ‘delimiter’ section for the exception. “–” to open/(EOL) as a closer. Worked great, just wish it wasn’t needed, and comments keys could go into comment section.

    So, I ‘resolved’ this… if that’s what one could call it. At least it works now. :-) Can I pat myself on the back, or get admonished for posting a problem I solved simply by RTFM again! lol

    Thanks to those who at least poked in to see if they could help! I think this UDL has a lot of promise! Sure wish I could help; but man, I don’t want to pick up on C/C++ again, it’s been too long. Whereas I’ve had to become more flexible in my old age… I remember C/C++ as very strict, even if as I recall it was one of the most sophisticated ways to write Machine Code!


Log in to reply