@@ -222,6 +222,7 @@ parser_error_t read_immediate(parser_context_t *ctx, primitive_t *primitive) {
222222 break ;
223223 case PRIMITIVE_BYTE_VEC :
224224 print_string ("Primitive byte vec" );
225+ CHECK_ERROR (read_byte_display (ctx , & primitive -> byte_vec .display ));
225226 break ;
226227 case PRIMITIVE_FLOAT32 :
227228 print_string ("Primitive float32" );
@@ -504,6 +505,20 @@ parser_error_t read_tuple(parser_context_t *ctx, schema_tuple_t *schema_tuple) {
504505 return parser_ok ;
505506}
506507
508+ parser_error_t read_array (parser_context_t * ctx , schema_array_t * schema_array ) {
509+ CHECK_INPUT (schema_array );
510+ CHECK_INPUT (ctx );
511+
512+ //read length
513+ CHECK_ERROR (read_u64 (ctx , (uint64_t * )& schema_array -> len ));
514+ printf ("array length: %llu\n" , schema_array -> len );
515+
516+ //read vec_type
517+ CHECK_ERROR (read_link (ctx , & schema_array -> value ));
518+
519+ return parser_ok ;
520+ }
521+
507522parser_error_t metadata_read (parser_context_t * ctx , parser_tx_t * txObj ) {
508523 CHECK_INPUT (ctx );
509524 CHECK_INPUT (txObj );
@@ -515,7 +530,7 @@ parser_error_t metadata_read(parser_context_t *ctx, parser_tx_t *txObj) {
515530 }
516531
517532 // TODO: go through all schemes
518- for (uint32_t i = 0 ; i < 18 ; i ++ ) {
533+ for (uint32_t i = 0 ; i < 36 ; i ++ ) {
519534 // read type
520535 CHECK_ERROR (read_u8 (ctx , (uint8_t * )& txObj -> schema .types .schemes [i ].type ));
521536 switch (txObj -> schema .types .schemes [i ].type ) {
@@ -539,6 +554,11 @@ parser_error_t metadata_read(parser_context_t *ctx, parser_tx_t *txObj) {
539554 CHECK_ERROR (read_link (ctx , & txObj -> schema .types .schemes [i ].option_type ));
540555 print_string ("READING OPTION DONE\n" );
541556 break ;
557+ case LINKING_SCHEME_ARRAY :
558+ print_string ("READING ARRAY" );
559+ CHECK_ERROR (read_array (ctx , & txObj -> schema .types .schemes [i ].array_type ));
560+ print_string ("READING ARRAY DONE\n" );
561+ break ;
542562 case LINKING_SCHEME_VEC :
543563 print_string ("READING VEC" );
544564 CHECK_ERROR (read_link (ctx , & txObj -> schema .types .schemes [i ].vec_type ));
0 commit comments