Community
    • Login

    String before symbol formatted in my User Defined Language UDL

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 3 Posters 6.0k Views 2 Watching
    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.
    • Eli ChavezE Offline
      Eli Chavez
      last edited by

      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?

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Eli Chavez
        last edited by

        @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
        • Eli ChavezE Offline
          Eli Chavez
          last edited by

          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
          }
          
          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • MAPJe71M Offline
            MAPJe71
            last edited by

            Looks a lot like JSON.

            1 Reply Last reply Reply Quote 0
            • Claudia FrankC Offline
              Claudia Frank @Eli Chavez
              last edited by

              @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
              • Eli ChavezE Offline
                Eli Chavez
                last edited by

                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.

                Claudia FrankC 1 Reply Last reply Reply Quote 0
                • Claudia FrankC Offline
                  Claudia Frank @Eli Chavez
                  last edited by

                  @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
                  • Eli ChavezE Offline
                    Eli Chavez
                    last edited by

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

                    Claudia FrankC 1 Reply Last reply Reply Quote 0
                    • Claudia FrankC Offline
                      Claudia Frank @Eli Chavez
                      last edited by

                      @Eli-Chavez

                      …but i thought id ask.

                      always welcome.

                      Cheers
                      Claudia

                      1 Reply Last reply Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors