Merge pull request #2378 from udif/pr_dollar_high_low
authorclairexen <claire@symbioticeda.com>
Thu, 1 Oct 2020 16:17:36 +0000 (18:17 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Oct 2020 16:17:36 +0000 (18:17 +0200)
Added $high(), $low(), $left(), $right()

1  2 
frontends/ast/simplify.cc

index 153a42e191f1d38f4cad2d33436aa3bc8c0bbf82,95f2d18101509953f1686d726937f6f9e96212f1..fb6623f023844c4407b65cbe7ecd56a123255177
@@@ -1521,9 -1523,10 +1523,10 @@@ bool AstNode::simplify(bool const_fold
        {
                AstNode *index_expr = nullptr;
  
+               integer = children[0]->children.size(); // save original number of dimensions for $size() etc.
                for (int i = 0; 2*i < GetSize(id2ast->multirange_dimensions); i++)
                {
 -                      if (GetSize(children[0]->children) < i)
 +                      if (GetSize(children[0]->children) <= i)
                                log_file_error(filename, location.first_line, "Insufficient number of array indices for %s.\n", log_id(str));
  
                        AstNode *new_index_expr = children[0]->children[i]->children.at(0)->clone();