From ba7222bf5c009872c71cf5ca9d63a5c0401242fa Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Fri, 18 Aug 2023 10:34:37 +0200 Subject: [PATCH] cleanup --- src/generator/zcl_protobuf_generator.clas.abap | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/generator/zcl_protobuf_generator.clas.abap b/src/generator/zcl_protobuf_generator.clas.abap index 208b822..7105969 100644 --- a/src/generator/zcl_protobuf_generator.clas.abap +++ b/src/generator/zcl_protobuf_generator.clas.abap @@ -43,14 +43,22 @@ CLASS zcl_protobuf_generator IMPLEMENTATION. METHOD message. - rv_abap = |TYPES: BEGIN OF { io_message->mv_name },\n|. - +* do the nested messages and types first, if any LOOP AT io_message->mt_artefacts INTO DATA(lo_artefact). CASE TYPE OF lo_artefact. WHEN TYPE zcl_protobuf2_message INTO DATA(lo_message). rv_abap = rv_abap && message( lo_message ). WHEN TYPE zcl_protobuf2_enum INTO DATA(lo_enum). rv_abap = rv_abap && enum( lo_enum ). + WHEN OTHERS. + ASSERT 1 = 'todo'. + ENDCASE. + ENDLOOP. + + rv_abap = |TYPES: BEGIN OF { io_message->mv_name },\n|. + + LOOP AT io_message->mt_artefacts INTO lo_artefact. + CASE TYPE OF lo_artefact. WHEN TYPE zcl_protobuf2_field INTO DATA(lo_field). rv_abap = rv_abap && field( lo_field ). WHEN OTHERS.