Community
    • Login

    MERLIN-PRO ASSEMBLER SYNTAX HIGHLIGHTING

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 821 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.
    • Χρήστος ΚοτζιάςΧ
      Χρήστος Κοτζιάς
      last edited by

      I am making a (retro 8-bit) Merlin-Pro assembler syntax highlighting language and I want to change the color of the words (not fixed keywords but randomly chosen labels) that been first in the line and only them.

      For example:


      MY FIRST PROGRAM


      LOOP EQU $8000
      COUT EQU $FC58

      I want LOOP and COUT to be printed in different color and only these words. (randomly chosen words, not fixed keywords)

      How to do it?

      P.S. If there is a space betwee

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

        The UDL (User Defined Language) lexer is not set up for highlighting random words, or even words that match a certain regular expression.

        If you want any unrecognized word to be a certain color, pick that certain color as the default color for your UDL, and make sure that all known words (like the EQU listed above) are in one of the keyword lists.

        You might want to study this other Topic in the forum, where @Claudia-Frank shared PythonScript code which will do customized highlighting; it was shown with an example of highlighting Python differently than the normal Python lexer does… but you might be able to make it do what you want. (Note: once you get to the post where Claudia shows the screenshot and the PythonScript code, the relevant content of that thread is complete; it kind of went off on a tangent after that. :-) ) I’m sure if you @-mention @Claudia-Frank here or in that thread, she’ll be happy to answer questions you might have on how to make it work for your use case (assuming it’s possible; I’ve never used that code).

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