Perl variables highlighting

Perl variables highlighting

5
NewbieNewbie
5

    May 17, 2005#1

    Hello !

    Best perl syntax highlighting that I saw is NEdit (http://www.nedit.org).

    But I use ultra-edit and I can't even force it to properly highlight variables.
    I tries to add

    Code: Select all

    /Function String 3 = "^([@$%][a-z_][a-z_0-9:]++^)"
    
    into wordfile text, and after pressing F8 I can see my variables in functions list, but why functions (function names) really not highlighted in UE-32?

    I set red color for functions, but it still black always, whenever I change it to any other color.

    Thanks for any help

    6,686585
    Grand MasterGrand Master
    6,686585

      May 17, 2005#2

      You set red color for functions! How do you do that? It is not possible. You can define a color for a group of words, which the group name "Functions". It is not possible to highlight words defined on a regular expression string. The regular expression strings are only for the function list, not for highlighting.

      If you want your function names highlighted, you have to add every function name manually to the list of words in color group "Functions".

      You can do that with following procedure:

      Click into the function list with right mouse button.
      Select Copy to Clipboard.
      Open your wordfile by clicking on button Open at Advanced - Configuration - Syntax Highlighting.
      Find the "Functions" color group of your Perl language definition.
      Paste the function names there.
      Run my sort language macro to alphabetically sort the words.
      Save the wordfile.

      You can download the macro from the ultimate syntax highlighting tools.
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        May 17, 2005#3

        Mofi wrote:If you want your function names highlighted, you have to add every function name manually to the list of words in color group "Functions".
        maybe I misunderstood smth, but I have to change worfile for every my program now? :-/ I think it's unproductive...

        6,686585
        Grand MasterGrand Master
        6,686585

          May 17, 2005#4

          Yes, you have to change the wordfile for every program or you forget highlighting for your functions, as I guess most other UE users do.

          Or you start defining your personal/program functions and global variables/constants in a more controlled manner.

          If you for example define all your personal functions with the starting characters pf_, your global variables with gv_ and your global constants with gc_, you can easily highlight it with UE and get a better and more easily read source code.

          That is what I do. Add
          ** gc_ gv_
          ** pf_
          to the appropriate color group and UE will highlight all your global variables/constants and functions.

          For special interrupts routines in 'C' I use also ir_ and for inline functions il_, etc.
          Best regards from an UC/UE/UES for Windows user from Austria

          5
          NewbieNewbie
          5

            May 17, 2005#5

            Mofi wrote:Yes, you have to change the wordfile for every program or you forget highlighting for your functions, as I guess most other UE users do.

            Or you start defining your personal/program functions and global variables/constants in a more controlled manner.

            If you for example define all your personal functions with the starting characters pf_, your global variables with gv_ and your global constants with gc_, you can easily highlight it with UE and get a better and more easily read source code.
            I'm not gonna to change thousands of code lines for only one of my editors can make his work... Editors must work for programmers, but not vice versa!!!
            Mofi wrote:That is what I do. Add
            ** gc_ gv_
            ** pf_
            to the appropriate color group and UE will highlight all your global variables/constants and functions.

            For special interrupts routines in 'C' I use also ir_ and for inline functions il_, etc.
            I'm confused why many editors support syntax highlighting for Perl variables and functions, but "Ultra" Edit can't ? It have no any possibility for programmers to resolve this problem...

            Anyway thanks for your help.

            119
            Power UserPower User
            119

              May 17, 2005#6

              I have always found it curious that some people are so enraptured by syntax highlighting that they feel everything needs to be highlighted in some fashion. I, for one, am quite content to have reserved words highlighted but not user-defined ones.