Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Aug 18, 2023
1 parent 6d90b5c commit ba7222b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/generator/zcl_protobuf_generator.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ba7222b

Please sign in to comment.