IndexType: Add IsPatternIndex(), like IsSubNetIndex()

This commit is contained in:
Arne Welzel 2023-11-01 14:07:27 +01:00
parent 074f51fc96
commit c8bab6a0ec
5 changed files with 16 additions and 9 deletions

View file

@ -391,8 +391,7 @@ string CPPCompile::GenIndexExpr(const Expr* e, GenType gt) {
auto ind_expr = e->GetOp2()->AsListExpr()->Exprs()[0];
auto is_pat_str_ind = false;
auto& indices = aggr_t->AsTableType()->GetIndices()->GetTypes();
if ( indices.size() == 1 && indices[0]->Tag() == TYPE_PATTERN && ind_expr->GetType()->Tag() == TYPE_STRING )
if ( aggr_t->AsTableType()->IsPatternIndex() && ind_expr->GetType()->Tag() == TYPE_STRING )
is_pat_str_ind = true;
if ( inside_when ) {