#11 Multiline String Highlighting

closed-fixed
5
2002-05-26
2001-11-25
Anonymous
No

The following, legal, Perl code does not display as a
a string literal.

$x="lklk
kjhjh
kjk
";

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This is a behavior of SynEdit's Perl Highlighting. If you
    want to change this, go to SynHighlighterPerl.pas in the
    SynEdit\Source directory and change
    <pre>
    case FLine[Run] of
    #0, #10, #13: break;
    end;
    </pre>
    to
    <pre>
    case FLine[Run] of
    #0 : break;
    end;
    </pre>

     
  • Nobody/Anonymous

    Logged In: NO

    erp, the previous comment dealt with the StringLiteralProc
    in SynHighlighterPerl.pas... I forgot to put that.

     
  • Matt Campbell

    Matt Campbell - 2002-01-11

    Logged In: YES
    user_id=205770

    To whomever posted the SynEditHighlighterPerl patch - I
    cannot get that to work. Not 100% sure it's the patch,
    though, since I had the original SynEdit compiled and
    installed - and I can't be sure that PerlIDE is pulling in
    the updated component.

    Have you successfully made this work?

     
  • Adam Leko

    Adam Leko - 2002-01-11

    Logged In: YES
    user_id=288429

    OK this is an extension of what I was saying before about
    the "patch" to StringLiteralProc (sorry I didn't sign in...)

    Open up SynHighlighterPerl.pas and search
    for "TSynPerlSyn.StringLiteralProc" (without the quotes).

    Change this:

    procedure TSynPerlSyn.StringLiteralProc;
    begin
    fTokenID := tkString;
    repeat
    case FLine[Run] of
    #0, #10, #13: break;
    end;
    inc(Run);
    until FLine[Run] = #39;
    if FLine[Run] <> #0 then inc(Run);
    end;

    To this:

    procedure TSynPerlSyn.StringLiteralProc;
    begin
    fTokenID := tkString;
    repeat
    case FLine[Run] of
    #0: break;
    end;
    inc(Run);
    until FLine[Run] = #39;
    if FLine[Run] <> #0 then inc(Run);
    end;

    The version of TSynPerlSyn that I have is this (taken from
    the top of the file):

    $Id: SynHighlighterPerl.pas,v 1.7 2001/11/09 07:46:17
    plpolak Exp $

    And the above procedure starts at line 2453 (yikes! that's
    a lot just for a syntax highlighter).

    After you change the file, recompile the SynEdit compenent
    suite (I believe you do this by reopening the package and
    recompiling/reinstalling it). Then recompile the PerlIDE
    with the newer SynEdit component.

    Yikes... what a pain in the rear. It would have been
    better of TSynEdit to maybe use text files to define
    language keywords/etc, but I guess the designers wanted
    more flexibility with syntax highlighting options than text
    files would allow.

    I hope that helps. If your version of StringLiteralProc
    looks wildly different from those listed above, you may
    want to update (or maybe unupdate if my version is too old)
    your SynEdit sources.

     
  • Nobody/Anonymous

    Logged In: NO

    It seems that the following, legal Perl code isn't displayed
    as a string literal.
    <<ERROR_PAGE;
    Content-type: text/html
    ...
    ERROR_PAGE

     
  • Jürgen Güntherodt

    • assigned_to: nobody --> jguentherodt
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks