Skip to content

Commit

Permalink
restore typeMatch and block string assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
drdrew42 committed Nov 4, 2021
1 parent f90297b commit 0e591bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions macros/parserAssignment.pl
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,20 @@ sub new {
my $self = shift; $class = ref($self) || $self;
my $f = $self->SUPER::new(@_);
bless $f, $class if $f->type eq 'Assignment';
my $rhs = $f->getTypicalValue($f)->{data}[1];
Value->Error('Assignment of strings is not allowed.') if $rhs && $rhs->type eq 'String';
return $f;
}

sub typeMatch {
my $self = shift; my $other = shift; my $ans = shift;
return 0 unless $self->type eq $other->type;
my $typeMatch = $self->getTypicalValue($self)->{data}[1];
$other = $self->getTypicalValue($other,1)->{data}[1];
return 1 unless defined($other); # can't really tell, so don't report type mismatch
$typeMatch->typeMatch($other,$ans);
}

sub cmp_class {
my $self = shift; my $value;
if ($self->{tree}{rop}{isConstant}) {
Expand Down

0 comments on commit 0e591bf

Please sign in to comment.