Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure the optimizer knows about PAST::Want nodes; stub for PAST::…
…Var consideration.
  • Loading branch information
jnthn committed Nov 2, 2011
1 parent d307831 commit fde126b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Perl6/Optimizer.pm
Expand Up @@ -208,6 +208,18 @@ class Perl6::Optimizer {
$op
}

# Handles visiting a PAST::Want node.
method visit_want($want) {
# Just visit the children for now. We ignore the literal strings, so
# it all works out.
self.visit_children($want)
}

# Handles visit a variable node.
method visit_var($var) {
# Nothing to do yet.
}

# Checks arguments to see if we're going to be able to do compile
# time analysis of the call.
sub analyze_args_for_ct_call($op) {
Expand Down Expand Up @@ -293,6 +305,12 @@ class Perl6::Optimizer {
elsif $visit.isa(PAST::Stmt) {
self.visit_children($visit);
}
elsif $visit.isa(PAST::Want) {
self.visit_want($visit);
}
elsif $visit.isa(PAST::Var) {
self.visit_var($visit);
}
}
$i := $i + 1;
}
Expand Down

0 comments on commit fde126b

Please sign in to comment.