File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ sub checkComplexOrMatrix {
214
214
my $self = shift ;
215
215
my $op = $self -> {params }[0];
216
216
return if ($self -> checkArgCount(1));
217
- $self -> Error(" Function '%s ' requires a Complex or Matrixinput " , $self -> {name })
217
+ $self -> Error(" Function '%s ' requires a Complex or Matrix input " , $self -> {name })
218
218
unless $op -> isNumber || $op -> type eq " Matrix" || $self -> context-> flag(" allowBadFunctionInputs" );
219
219
$self -> {type } = $op -> typeRef;
220
220
}
Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ sub create {
104
104
#
105
105
# would attach the class context::Quaternions::BOP::add to the
106
106
# plus sign in our Quaternion setting. If the space operator (' ')
107
- # in your list, and if the original context has it point to an
108
- # operator that is NOT in your list, then that references operator
107
+ # is in your list, and if the original context has it point to an
108
+ # operator that is NOT in your list, then that referenced operator
109
109
# is redirected automatically to 'BOP::Space' in your base context
110
110
# package. In our case, we would want to include a definition for
111
111
# context::Quaternions::BOP::Space in order to cover that possibility.
Original file line number Diff line number Diff line change @@ -585,7 +585,8 @@ sub _check {
585
585
# This is not a mixed number, so convert to original class and do
586
586
# its _check
587
587
#
588
- unless ($allowMixedNumbers
588
+ unless ($self -> {bop } eq ' mixedNum'
589
+ && $allowMixedNumbers
589
590
&& $self -> extensionClassMatch($self -> {lop }, ' INTEGER' , ' MINUS' )
590
591
&& !$self -> {lop }{hadParens }
591
592
&& $self -> extensionClassMatch($self -> {rop }, ' FRACTION' )
@@ -594,7 +595,13 @@ sub _check {
594
595
{
595
596
$self -> {bop } = $self -> {def }{string };
596
597
$self -> {def } = $context -> {operators }{ $self -> {bop } };
597
- return $self -> mutate-> _check;
598
+ my $class = $self -> {def }{class };
599
+ if ($class eq ref ($self ) || $class =~ m / ^context::Fraction::BOP::[Ss] pace$ / ) {
600
+ $self -> mutate;
601
+ } else {
602
+ bless $self , $class ;
603
+ }
604
+ return $self -> _check;
598
605
}
599
606
$self -> {type } = $context::Fraction::MIXED ;
600
607
$self -> Error(" Mixed numbers are not allowed; you must use a pure fraction" )
@@ -611,7 +618,7 @@ sub _check {
611
618
}
612
619
613
620
#
614
- # For when the space operator's space property sends to an
621
+ # For when the space operator's string property sends to an
615
622
# operator we didn't otherwise subclass.
616
623
#
617
624
package context::Fraction::BOP::Space ;
You can’t perform that action at this time.
0 commit comments