• Login
Community
  • Login

String before symbol formatted in my User Defined Language UDL

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
9 Posts 3 Posters 5.4k 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.
  • E
    Eli Chavez
    last edited by Aug 10, 2016, 9:32 PM

    What I am trying to do I think is simple. I want to have properties in my language a different color from the standard text. Properties are defined as this
    [ANYTEXT]:

    That is any text followed by a colon then usually a space but it doesn’t have to be. Examples are
    Id:
    Text:
    text:
    height:

    This is similar to what the standard PowerShell style does when N++ is installed except backwards. Its bold anything after the dollar sign $ANYVARIABLENAME

    Even when you use the dot(.) the bold stops.

    Can someone tell me how to implement these within my UDL?

    C 1 Reply Last reply Aug 10, 2016, 11:56 PM Reply Quote 0
    • C
      Claudia Frank @Eli Chavez
      last edited by Aug 10, 2016, 11:56 PM

      @Eli-Chavez

      how is the property glued to the object?
      I’m thinking of using these “glue”-chars as delimiters.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • E
        Eli Chavez
        last edited by Aug 11, 2016, 5:31 PM

        Not sure i know exactly what you mean by glued? That might be another thing about UDLs i dont understand. however the structure is as follows

        Object {
            property1: value 1
            property2: value2
            InnerObject {
                Innerproperty1: innervalue1
            }
            property3: value3
        }
        
        C 1 Reply Last reply Aug 11, 2016, 11:49 PM Reply Quote 0
        • M
          MAPJe71
          last edited by Aug 11, 2016, 7:07 PM

          Looks a lot like JSON.

          1 Reply Last reply Reply Quote 0
          • C
            Claudia Frank @Eli Chavez
            last edited by Aug 11, 2016, 11:49 PM

            @Eli-Chavez

            I thought we are talking about object oriented programming/scripting language which do
            have syntax like object.property or object->function etc.

            I think, the closest would be something like

            delimiter1:
            open={
            close=}
            and set nesting to delimiter1, delimiter2 and keywords… (I assume you have keywords defined)

            delimiter2:
            open=((EOL))
            close=:
            and set nesting to delimiter1 and keywords.

            Not exactly what you want but I assume closest possible.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • E
              Eli Chavez
              last edited by Aug 14, 2016, 9:24 PM

              So the language is QML. I am very new to QML and have been required by my new job to look into it. I found a few QML UDLs already defined but they dont have anything styled specific for the properties. What i am looking for is very simple id like to define something that allows any text or number sequence before a colon gets bolded and a specific color.

              In some languages i see this to some degree. In my original post i mention powershell. in that language when you type the dollar sign it automatically bolds it and then any combination of text and numbers that follow. I am looking for something very specific to that.

              This may seem simple but i have not been able to get it done, and i would greatly benefit from implementing this in my QML ventures.

              C 1 Reply Last reply Aug 15, 2016, 8:57 PM Reply Quote 0
              • C
                Claudia Frank @Eli Chavez
                last edited by Aug 15, 2016, 8:57 PM

                @Eli-Chavez

                builtin lexers, lexers provided by plugins and UDL are different,
                because they are developed by different programmers. A functionality
                of one lexer doesn’t indicate it is available in another lexer.
                It looks like your request cannot be solved by UDL completely.

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 0
                • E
                  Eli Chavez
                  last edited by Aug 16, 2016, 4:29 PM

                  Okay thanks, I figured it wasnt going to work out but i thought id ask.

                  C 1 Reply Last reply Aug 16, 2016, 10:53 PM Reply Quote 0
                  • C
                    Claudia Frank @Eli Chavez
                    last edited by Aug 16, 2016, 10:53 PM

                    @Eli-Chavez

                    …but i thought id ask.

                    always welcome.

                    Cheers
                    Claudia

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