[system] / trunk / pg / macros / extraAnswerEvaluators.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/extraAnswerEvaluators.pl

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

Revision 4927 Revision 4928
159sub mode2context { 159sub mode2context {
160 my $mode = shift; 160 my $mode = shift;
161 my %options = @_; 161 my %options = @_;
162 my $context; 162 my $context;
163 for ($mode) { 163 for ($mode) {
164 /^strict$/i and do { 164 /^strict$/i and do {
165 $context = $Parser::Context::Default::context{LimitedNumeric}->copy; 165 $context = Parser::Context->getCopy(\%main::context,"LimitedNumeric");
166 $context->operators->redefine(','); 166 $context->operators->redefine(',');
167 last; 167 last;
168 }; 168 };
169 /^arith$/i and do { 169 /^arith$/i and do {
170 $context = $Parser::Context::Default::context{LegacyNumeric}->copy; 170 $context = Parser::Context->getCopy(\%main::context,"LegacyNumeric");
171 $context->functions->disable('All'); 171 $context->functions->disable('All');
172 last; 172 last;
173 }; 173 };
174 /^frac$/i and do { 174 /^frac$/i and do {
175 $context = $Parser::Context::Default::context{'LimitedNumeric-Fraction'}->copy; 175 $context = Parser::Context->getCopy(\%main::context,"LimitedNumeric-Fraction");
176 $context->operators->redefine(','); 176 $context->operators->redefine(',');
177 last; 177 last;
178 }; 178 };
179 179
180 # default 180 # default
181 $context = $Parser::Context::Default::context{LegacyNumeric}->copy; 181 $context = Parser::Context->getCopy(\%main::context,"LegacyNumeric");
182 } 182 }
183 # If we are using complex numbers, then we ignore the other mode parts 183 # If we are using complex numbers, then we ignore the other mode parts
184 if(defined($options{'complex'}) && 184 if(defined($options{'complex'}) &&
185 ($options{'complex'} =~ /(yes|ok)/i)) { 185 ($options{'complex'} =~ /(yes|ok)/i)) {
186 #$context->constants->redefine('i', from=>'Complex'); 186 #$context->constants->redefine('i', from=>'Complex');

Legend:
Removed from v.4927  
changed lines
  Added in v.4928

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9