#54 Color stop with embedded __END__

v0.1.0
closed-rejected
nobody
Editor (234)
5
2004-11-12
2004-04-23
Anonymous
No

Per our email discussion.

E-P-I-C's colorer stops the syntax highlighting when it
encounters an __END__ tag that is embedded in code.

Ex:

%template = ();
while (<DATA>) {
last if /^(__END__)?$/;
my ( $ct, $comp, $txt ) = /^(\S+)\s(\S+)\s(.*)$/;
$txt =~ s/\\n/\n/mg;
$template{$ct}{$comp} = $txt;
}

The "last if" is the last to be colorized because the
colorer hits the __END__ and thinks the Perl code is done.

Discussion

  • Mike Blackwell
    Mike Blackwell
    2004-05-19

    Logged In: YES
    user_id=766962

    And it is correct.

    According to the Camel (Programming Perl) one or the other
    (but not both) of the tokens can be used mark the end of the
    source. __END__ is used when there is nothing important
    following. __DATA__ is used to open the DATA handle, as you
    do here. The __END__ token has no significance to the
    compiler after it has seen the __DATA__ token.

    Why are you using __END__ to mark the end of your data? End
    of file works fine unless you really need to put more stuff
    after the data for some reason, in which case it would
    probably be wise to choose another token to avoid this type
    of confusion.

     
  • LeO
    LeO
    2004-11-12

    • status: open --> closed-rejected
     
  • LeO
    LeO
    2004-11-12

    Logged In: YES
    user_id=703323

    I would say, the last comment explained everything =>
    closing this ticket!

     
  • LeO
    LeO
    2004-11-12

    Logged In: YES
    user_id=703323

    I would say, the last comment explained everything =>
    closing this ticket!