Announcement

Collapse
No announcement yet.

Perl string literal reference

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Perl string literal reference

    I have come across a bug in the way perl source is rendered. If the code includes a scalar reference to a string literal, then the BC3 source code formater appears to treat the opening quote as escaped, so everthing after the closing quote is treated as part of a string.

    example:

    Code:
    #!/usr/bin/perl
    
    # Works
    my $string = 'some text';
    my $stringRef = \$string;
    
    # Does not work.
    my $stringRef = \'some text';
    # This line is treated as part of a string starting at the end of the line above.

  • #2
    Hello,

    This is due to the \' matching as an Operator grammar type ahead of matching on String. If you create a new grammar that is named String, Delimiter type, that matches on:
    \'
    to
    '

    Would this be an accurate grammar for Perl script?
    Aaron P Scooter Software

    Comment

    Working...
    X