Community
    • Login

    User Defined Lanaguage - creating a style for LABEL names ending with colon ':'

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 321 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.
    • Antonio GuerrieroA
      Antonio Guerriero
      last edited by

      Hi
      I’m trying to create a User Defined Language,
      However have run into a problem with a style I’m trying to implement.
      the Language has defined LABELS which end in the ‘:’ colon character.
      Much like the Windows Batch files where the label starts with a ‘:’.

      I cannot get npp to implement this either as a comment or anything else I’ve tried.

      Is their any articles out there for this?

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

        @Antonio-Guerriero ,

        You just want it to be “any token that ends in a : should be considered a LABEL”? Yeah, the User Defined Language lexer isn’t designed to be that complicated: it is intended for a specific list of keywords

        The EnhanceAnyLexer plugin will allow you to add a regex to change the foreground of matching text on a per language (per UDL, or per builtin lexer). Assuming that the LABEL has to be the first non-whitespace sequence on a line, and must be only alphanumeric-and-underscore-before-:, then the following should make your LABEL green.

        [your_udl_name_here]
        0x00CC00 = ^\h*\w+:
        
        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors