in reply to weave.pl---an expression analyzer

This is an interesting chunk of code, and introduced me to yet another fascinating computer person. Ralph Griswold's articles were great to skim through.

Oh right, the code. I get errors about uninitialized variables at line 162 unless I explicitly check for the existence of a key $value in %preference_table:

if (exists $precedence_table{$value}) { my $precedence = ( $n + $precedence_table{$value} ); $expression_list[$i] = [ { $key => $$_{$key} }, $precedence ]; }

Replies are listed 'Best First'.
Re^2: weave.pl---an expression analyzer
by hsmyers (Canon) on Sep 10, 2004 at 14:17 UTC
    Yes indeed! You've discoverd the total lack of error checking(TM) in the code. It's on my TODO list as soon as I figure out a graceful way to go about it. I'm in the middle of moving the language specific stuff out of the mini-parser and I'll probably add it as part of a module. Good catch!

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."