Menu

#2589 Perl Syntax Highlighting hangs 4.3pre6

closed-fixed
5
2006-08-02
2006-07-24
No

Found another hang for the perl syntax with 4.3pre6 (cvs):

The following lines work fine:
y_max_value => (1 - $adjusted_lower_rate),
x_labels_vertical => 1,

But these lines both cause jEdit to hang:
y_label => 'Pass Rate (%)',
y_number_format => \ &yformat,

It appears to be related to having the underscore after
a single character at the start of the line; if you
(re)move the underscores, then jedit doesn't hang.

Furthermore, whilst the first pair of lines don't hang
jEdit, the first one is highlighted incorrectly. I
believe its trying to highlight from the first 'y'
through to the 'd' of 'adjusted' as a regex (blue in
the default colour settings). Again, (re)moving the
initial underscore restores the proper highlighting.

Discussion

  • Nicholas O'Leary

    Logged In: YES
    user_id=631957

    The 'y' at the start is significant as well. It is being
    caught by the rule:

    <SEQ_REGEXP TYPE="MARKUP"
    HASH_CHAR="y"
    AT_WORD_START="TRUE"
    >y([^\p{Alnum}\p{Space}])(?:.*?[^\\])*?\1(?:.*?[^\\])*?\1[cds]*</SEQ_REGEXP>

    This leads me to believe it will hang with any of q,t,m or
    s, at the start as there are simliar rules with HASH_CHAR
    set to them.

     
  • Alan Ezust

    Alan Ezust - 2006-07-31
    • priority: 3 --> 7
     
  • Marcelo Vanzin

    Marcelo Vanzin - 2006-08-01

    Logged In: YES
    user_id=75113

    Ah, my favorite edit mode. :-)

    SVN revision #6472 should take care of this. (Hey, this
    sounds almost like perforce change lists. I like it!)

     
  • Marcelo Vanzin

    Marcelo Vanzin - 2006-08-01
    • status: open --> closed-fixed
     
  • Nicholas O'Leary

    • priority: 7 --> 5
    • assigned_to: nobody --> vanza
    • status: closed-fixed --> open
     
  • Nicholas O'Leary

    Logged In: YES
    user_id=631957

    Almost there... the hang's have stopped and the highlighting
    works correctly for the examples I gave previously.

    Unfortunately, the following block no longer highlights
    correctly. The &amp; is being interpretted as a keyword and
    the " starts a quoted section that runs until the next " is
    hit - if at all.

    sub escapeHTML($) {
    my $html = shift;
    $html =~ s/\\/\\\\/g;
    $html =~ s/&/&amp;/g;
    $html =~ s/"/&quot;/g;
    $html =~ s/</&lt;/g;
    $html =~ s/>/&gt;/g;
    return $html;
    }

    Thanks for you perseverance on this - its much appreciated!

     
  • Marcelo Vanzin

    Marcelo Vanzin - 2006-08-02

    Logged In: YES
    user_id=75113

    revision #6480 should take care of that; I added '/' to the
    list of "illegal delimiters" when it's actually a valid one.

     
  • Marcelo Vanzin

    Marcelo Vanzin - 2006-08-02
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB