Community
    • Login

    UDL definition for keywords that begin with an operator

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    operatorapdlkeywordudl
    5 Posts 3 Posters 1.7k Views
    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.
    • Nathan PN
      Nathan P
      last edited by

      I’m trying to update a version of the UDL for Ansys APDL to recognize all the operators; specifically including the divide ( / ) and multiply ( * ) symbols, as well as all of the keywords. The problem is that there’s a whole group of keywords used in APDL that begin with both “/” and “*”; so if I include the divide and multiple operators, it doesn’t highlight those keywords. Is there a way to have the operators only recognized if they appear somewhere after the beginning of the line? Something like {wildcard symbol}{the operator}?
      Or, maybe a way to enforce an order of searching. For example: first look for comments, then look for folding, then keywords, and finally operators.

      Anyway, any help or suggestions would be appreciated.

      Thank you.

      1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones
        last edited by

        There is no “wildcard symbol” in the UDL definitions. And there’s no way to enforce order of matching.

        I think if you included the / and * in the “Operators 2 (separators required)” rather than in “Operators 1”, it might do what you want – in that it won’t treat them as operators unless they are separated by a space from surrounding text. Unfortunately, it also means that it would recognize 4 / 2 but not 4/2. As far as I know, you cannot have it both ways.

        1 Reply Last reply Reply Quote 2
        • PeterJonesP
          PeterJones
          last edited by

          In this thread, @Claudia-Frank gives an example of a “custom lexer” that’s written in PythonScript, rather than requiring compiling a new DLL for the custom lexer. You might be able to take those concepts and write up a solution that’s specific to your needs. (I’ve never experimented with that… some day, I really need to, so that I can better help people use it.)

          1 Reply Last reply Reply Quote 2
          • Nathan PN
            Nathan P
            last edited by

            Thanks for the feedback.

            Anyway, it looks like the option of putting spaces around those operators would do what I was looking for. Unfortunately, I think I’d rather leave these operators as unidentified, rather than implementing the extra spaces in the code. The improvement in ability to visually scan through the code isn’t improved that much, I don’t think, to make the extra effort worth it.

            But again, thank you for the responses.

            1 Reply Last reply Reply Quote 0
            • Tobias KriegT
              Tobias Krieg
              last edited by

              Hello Forum,
              I have a very similar problem. I trie to write a xml file to autocomplete ansys apdl syntax. In the case of keyworts without slash and star everything works fine. The Keywords with extra sign * or / are shown in the dropdown box but I can’t autocomplete it.

              Can someone tell me what’s going wrong?

              Thanks Tobias

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors