Tapatalk

Highlight suffix (eg. methods) or highlight words based on end of word

Highlight suffix (eg. methods) or highlight words based on end of word

1
NewbieNewbie
1

    Oct 10, 2004#1

    Does anyone know if it is possible to highlight suffixes.
    For example method invocations after a dot.
    So in "object.new" I would like to highlight "new".

    6,685587
    Grand MasterGrand Master
    6,685587

      Oct 28, 2004#2

      Not really.

      Marker characters, for example
      /Marker Characters = ". "
      can do it, but not very good.

      Better is to highlight all words starting with the same character, like

      /C5"Methods"
      ** .


      The '.' must be a delimiter character. But you don't really know, if this suffix is really correct written, because it simply highlights all words starting with a point, except floating numbers, because numbers have a higher syntax highlighting priority.

      The only perfect solution is, what I use for global structured variables for 'C'. I deleted '.' from the delimiters line and add to the wordfile (and update) all global variables manually with all their structure elements. But this solution cannot be used for C++ with hundreds or thousands methods and elements.
      Best regards from an UC/UE/UES for Windows user from Austria

      1

        Dec 19, 2007#3

        I work with a variant of QuickBasic that allows implicit variable declaration by suffix, for example:

        Dim iBand as Integer

        may be as

        Dim Band%


        Is there a way to Syntax Highlight "Band%" in the example above?
        (with or without included "%" sign)

        thanks, Gopher
        N. Seattle, USA

        6,685587
        Grand MasterGrand Master
        6,685587

          Dec 19, 2007#4

          It is not possible to highlight all words ending with a special character. There is also no workaround except all such variables start with always the same character which would make it possible to use marker characters.

          You would need to find all words ending with %, create a wordlist and copy this list correct sorted into the wordfile into a color group. But you would need to update this wordlist whenever you add a new variable or delete a variable.

          As already written in another thread: Why do you want symbols you have defined yourself if every syntax keyword, strings, comments and operators are already highlighted? If you want "normal" text not black change the color of "normal" text. Or is there another reason why you want these variables highlighted with a non normal text color?
          Best regards from an UC/UE/UES for Windows user from Austria