Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    String before symbol formatted in my User Defined Language UDL

    Help wanted · · · – – – · · ·
    3
    9
    4890
    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 Chavez
      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 Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        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 Chavez
          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 Frank 1 Reply Last reply Reply Quote 0
          • MAPJe71
            MAPJe71 last edited by

            Looks a lot like JSON.

            1 Reply Last reply Reply Quote 0
            • Claudia Frank
              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 Chavez
                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 Frank 1 Reply Last reply Reply Quote 0
                • Claudia Frank
                  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 Chavez
                    Eli Chavez last edited by

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

                    Claudia Frank 1 Reply Last reply Reply Quote 0
                    • Claudia Frank
                      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
                      • First post
                        Last post
                      Copyright © 2014 NodeBB Forums | Contributors