[system] / trunk / pg / lib / Parser / Context.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Parser/Context.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2646 Revision 2647
83 83
84# 84#
85# Set/Get the current Context object 85# Set/Get the current Context object
86# 86#
87sub current { 87sub current {
88 my $self = shift; my $contextTable = shift; my $name = shift; 88 my $self = shift; my $contextTable = shift; my $context = shift;
89 if ($contextTable) {$userContext = $contextTable} else {$contextTable = $userContext} 89 if ($contextTable) {$userContext = $contextTable} else {$contextTable = $userContext}
90 if ($name) { 90 if (defined($context)) {
91 if (!ref($context)) {
92 my $name = $context;
91 my $context = Parser::Context->get($contextTable,$name); 93 $context = Parser::Context->get($contextTable,$context);
92 Value::Error("Unknown context '$name'") unless defined($context); 94 Value::Error("Unknown context '$name'") unless defined($context);
95 }
93 $contextTable->{current} = $context; 96 $contextTable->{current} = $context;
94 $Value::context = \$contextTable->{current}; 97 $Value::context = \$contextTable->{current};
95 } elsif (!defined($contextTable->{current})) { 98 } elsif (!defined($contextTable->{current})) {
96 $contextTable->{current} = $Parser::Context::Default::fullContext->copy; 99 $contextTable->{current} = $Parser::Context::Default::fullContext->copy;
97 $Value::context = \$contextTable->{current}; 100 $Value::context = \$contextTable->{current};

Legend:
Removed from v.2646  
changed lines
  Added in v.2647

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9