MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / par_array

Function par_array

src/gpre/sql.cpp:5602–5644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5600//
5601
5602static void par_array( gpre_fld* field)
5603{
5604 USHORT i = 0;
5605
5606 // Pick up ranges
5607
5608 ary* array_info = field->fld_array_info;
5609
5610 while (true)
5611 {
5612 SLONG rangel = EXP_SSHORT_ordinal(true);
5613 SLONG rangeh;
5614 if (MSC_match(KW_COLON))
5615 rangeh = EXP_SSHORT_ordinal(true);
5616 else
5617 {
5618 if (rangel < 1)
5619 rangeh = 1;
5620 else
5621 {
5622 rangeh = rangel;
5623 rangel = 1;
5624 }
5625 }
5626
5627 if (rangel >= rangeh)
5628 PAR_error("Start of array range must be less than end of range");
5629
5630 if (i > MAX_ARRAY_DIMENSIONS)
5631 PAR_error("Array has too many dimensions");
5632
5633 array_info->ary_rpt[i].ary_lower = rangel;
5634 array_info->ary_rpt[i++].ary_upper = rangeh;
5635
5636 if (MSC_match(KW_R_BRCKET))
5637 break;
5638
5639 if (!MSC_match(KW_COMMA))
5640 CPR_s_error(", (comma)");
5641 }
5642
5643 array_info->ary_dimension_count = i;
5644}
5645
5646
5647//____________________________________________________________

Callers 1

SQL_par_field_dtypeFunction · 0.70

Calls 4

EXP_SSHORT_ordinalFunction · 0.85
MSC_matchFunction · 0.85
CPR_s_errorFunction · 0.85
PAR_errorFunction · 0.70

Tested by

no test coverage detected