stage3/print_datatypes_error.cc
changeset 551 a75e3aea98ff
parent 550 322f063daa9f
child 552 3c39d80fdede
equal deleted inserted replaced
550:322f063daa9f 551:a75e3aea98ff
   593 // SYM_LIST(subscript_list_c)
   593 // SYM_LIST(subscript_list_c)
   594 void *print_datatypes_error_c::visit(subscript_list_c *symbol) {
   594 void *print_datatypes_error_c::visit(subscript_list_c *symbol) {
   595 	for (int i = 0; i < symbol->n; i++) {
   595 	for (int i = 0; i < symbol->n; i++) {
   596 		int start_error_count = error_count;
   596 		int start_error_count = error_count;
   597 		symbol->elements[i]->accept(*this);
   597 		symbol->elements[i]->accept(*this);
   598 		/* I (mjs) do not believe that the following error message will ever get printed, but lets play it safe and leave it in... */
   598 		/* The following error message will only get printed if the current_display_error_level is set higher than 0! */
   599 		if ((start_error_count == error_count) && (NULL == symbol->elements[i]->datatype))
   599 		if ((start_error_count == error_count) && (NULL == symbol->elements[i]->datatype))
   600 			STAGE3_ERROR(0, symbol, symbol, "Invalid data type for array subscript field.");
   600 			STAGE3_ERROR(0, symbol, symbol, "Invalid data type for array subscript field.");
   601 	}
   601 	}
   602 	return NULL;
   602 	return NULL;
   603 }
   603 }