Tapatalk

Subroutines in DOS Perl script file missing in function list view of UE v19.10/20.00

Subroutines in DOS Perl script file missing in function list view of UE v19.10/20.00

2

    Sep 04, 2013#1

    I just installed (upgraded) to the latest version of Ultraedit on a system, and cannot get the function list to work in perl files. It's basically just empty, even when I refresh.

    For the file type "Perl" is selected, but I cannot see anything wrong. The function list configuration has one "Subs" group, and the regular expressions are:

    ^[ \t]*sub[ \t]+([a-z0-9_]+)[#]
    ^[ \t]*sub[ \t]+([a-z0-9_]+)[ \t\{\n]

    The first one also has a { } open/close tags configured.

    Any ideas :?:

    6,685587
    Grand MasterGrand Master
    6,685587

      Sep 04, 2013#2

      perl.uew as installed with UltraEdit v19.10 up to v20.00.0.1046 (and only with these versions of UltraEdit) or with UEStudio v13.10 into directory Program files directory of UltraEdit\wordfiles\ and copied by UltraEdit on first start to %APPDATA%\IDMComp\UltraEdit\wordfiles\ from which the wordfile is really loaded by default as you can see at Advanced - Configuration - Editor Display - Syntax Highlighting contains at top

      /Regexp Type = Perl
      /TGBegin "Use Declarations"
      /TGFindStr = "^[ \t]*use[ \t]+([a-z:0-9_]+)"
      /TGEnd
      /TGBegin "Subs"
      /TGFindStr = "^[ \t]*sub[ \t]+([a-z0-9_]+)[#]"
      /TGFindStr =
      = "^[ \t]*sub[ \t]+([a-z0-9_]+)[ \t\{\n]"
      /TGEnd


      //Function String = "%[ ^t]++sub[ ^t]+^([a-zA-Z0-9_]+^)[#]"
      //Function String 1 = "%[ ^t]++sub[ ^t]+^([a-zA-Z0-9_]+^)[ ^t{^p]"
      //Function String 2 = "%[ ^t]++sub[ ^t]+^([a-zA-Z0-9_]+^)[ ^t]++(*)[ ^t{^p#]"
      //Function String 3 = "%[ ^t]++^([a-zA-Z0-9_]+^):[ ^t^p]"


      You need to
      1. open Advanced - Configuration - Editor Display - Syntax Highlighting,
      2. select language Perl if not already preselected,
      3. click on button Open,
      4. close the configuration dialog with button Cancel,
      5. and replace in the opened wordfile for Perl highlighting the block above by the block
      /Regexp Type = Perl
      /TGBegin "Use Declarations"
      /TGFindStr = "^[ \t]*use[ \t]+([a-z:0-9_]+)"
      /TGEnd
      /TGBegin "Subs"
      /TGFindStr = "^[ \t]*sub[ \t]+([a-z0-9_]+)[ \t
      \r\n{#]"
      /TGEnd


      Save and close the wordfile.

      Execute Search - Function List to update the function list for active Perl script file. You should see now the subroutines.

      In file perl.uew installed with UE v20.00.0.1040 and later the gray formatted lines are already removed, but the regular expressions for subroutines must be still replaced by above block.

      In file perl.uew installed with UE v20.00.0.1052 and later the regular expression block for finding subroutines in Perl script files is defined as posted here.


      Explanation:

      The function strings formatted here with gray color are not taken into account by UltraEdit because of the double // at beginning of the lines. You can leave them in the file or remove it. I have just sent an email to IDM support with the request to remove those lines from the file because there is also a file perl.uew in the subdirectory legacy which can be moved upwards by a user who prefers the function strings in UltraEdit syntax for a flat list.

      As you can see I made three changes on the remaining line for "Subs":
      1. Removed an erroneous = left to beginning of the regular expression string in the double quotes.
      2. Added \r to last square bracket which makes the regular expression working now also for your Perl script file with DOS line terminators and nothing other than \r\n (carriage return and line-feed) after the name of the subroutines.
      3. Added # also to last square bracket.
      The third modification makes the other regular expression line above useless which is the reason why it is removed it in the block to insert.

      I have reported this issue also by email to IDM support.

      PS: Character { has no special meaning inside a square bracket and therefore must not be escaped with a backslash which is the reason why I removed the backslash and moved { near to end of the list of characters in the square bracket.

      2

        Sep 04, 2013#3

        OK Dude, you are awesome. Thanks so much, it took me a few seconds to even figure out what I needed to do, but it worked right away.

        Thanks!!