Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] for languages/perl6/perl6 --tree

7 views
Skip to first unread message

Gerd Pokorra

unread,
Nov 19, 2004, 3:14:34 AM11/19/04
to perl6-i...@perl.org

Hello,

by executing the command "perl6 --tree" there is to seen the following
error message:

[gz016@lgerd perl6]$ perl ./perl6 --tree -e 'print "alf"';
Can't call method "tree" on an undefined value at ./perl6 line 418.
[gz016@lgerd perl6]$

The problem is that the function $parser->prog only returns a value
if the function P6C::IMCC::init() is called first.

So I fixed the program languages/perl6/perl6 that the modul
P6C::IMCC is loaded and also the function P6C::IMCC::init is
called generally. There is no need not to call it when the
option --tree is used. At the end of this mail I add my changes.


Gerd


[gz016@lgerd perl6]$ diff -u perl6 perl6.parse_tree
--- perl6 2004-11-17 13:14:32.902467776 +0100
+++ perl6.parse_tree 2004-11-17 13:20:42.238320192 +0100
@@ -473,10 +473,9 @@
$Data::Dumper::Indent = 1;
END
die $@ if $@;
- } else {
- eval 'use P6C::IMCC qw(:external)';
- die $@ if $@;
}
+ eval 'use P6C::IMCC qw(:external)';
+ die $@ if $@;
if (!$OPT{'force-grammar'} && eval("require $OPT{grammar}")) {
$parser = eval "new $OPT{grammar}" or die "$OPT{grammar}: $@";
} else {
@@ -519,7 +518,7 @@
close(IN);
}
verbose(2, "Parsing");
- P6C::IMCC::init() unless $OPT{tree};
+ P6C::IMCC::init();
my $result = run_pass('parse', sub {$parser->$::rule($in,0,$f)}, $fw);
output_tree($result, $f, $fw);
}
[gz016@lgerd perl6]$


0 new messages