Skip Menu |

This queue is for tickets about the Acme-Brainfuck CPAN distribution.

Report information
The Basics
Id: 81824
Status: open
Priority: 0/
Queue: Acme-Brainfuck

People
Owner: jaldhar [...] braincells.com
Requestors: hugh [...] davenport.net.nz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.1.1
Fixed in: (no value)



Subject: here-docs break the compiler
When some source has what looks like a here-doc (<<) in it, this is seen by the filter as \x1c\x00\x00\x00\x00\x1c instead of <<. This causes the filter not to change this, and perl then sees a here-doc and tries to match it. Often this will cause compilation issues. Attached is a patch that fixes the here-doc matching, so that it is treated as << and filtered out. To test, the example program heredoc.pl will output a single character. Without the patch this will be \x01, and with the patch this will be \x02. Cheers, Hugh
Subject: heredoc.pl
use Acme::Brainfuck; <<+ +.
Subject: heredoc.patch
--- /usr/share/perl5/Acme/Brainfuck.pm 2012-12-09 15:47:07.438819407 +1300 +++ /usr/local/share/perl/5.10.1/Acme/Brainfuck.pm 2012-12-09 15:46:32.854308231 +1300 @@ -101,6 +101,8 @@ { my $ret = $_; my $loopcount = 0; + # here-docs (<<) + $ret =~ s/\x1c\x00\x00\x00\x00\x1c/>>/g; while ($ret =~ /\s ([\Q$ops\E]+) \s/gsx) { my $code = $1;
On Sat Dec 08 21:51:34 2012, https://launchpad.net/~hugh-catalyst wrote: Show quoted text
> When some source has what looks like a here-doc (<<) in it, this is
seen Show quoted text
> by the filter as \x1c\x00\x00\x00\x00\x1c instead of <<. This causes
the Show quoted text
> filter not to change this, and perl then sees a here-doc and tries to > match it. Often this will cause compilation issues. > > Attached is a patch that fixes the here-doc matching, so that it is > treated as << and filtered out. > > To test, the example program heredoc.pl will output a single
character. Show quoted text
> Without the patch this will be \x01, and with the patch this will be
\x02. Show quoted text
> > Cheers, > > Hugh
I should mention that this is commonly caused by a blank line in your source.
Hello, hope you've had an enjoyable holiday season. Sorry for not responding sooner. I appreciate your kind attention to this module. You've inspired me to work on it again and now that I finally have some free time I shall try and get a new release out ASAP. To that end I have merged in your patches and updated the build scaffolding to more modern standards. I just need to write some tests and I'll be ready to upload to CPAN.