Skip to content

Commit

Permalink
helper for new byte[]
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Dec 27, 2024
1 parent 1f5f5b3 commit 3bca5c8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/javadoc_messagecargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,15 @@ def bytes_for_argument(arg_str, start_offset):
if inside:
elems = [x.strip() for x in inside.group(1).split(',') if x.strip()]
lines = []
for i, v in enumerate(elems):
desc = f"new byte[]{{{v}}} [element {i}]"
lines.append((start_offset + i, desc))
if len(elems) == 1:
if v.strip().startswith("(byte)"):
lines.append((start_offset, v))
else:
lines.append((start_offset, f"(byte) ({v})")
else:
for i, v in enumerate(elems):
desc = f"new byte[]{{{v}}} [element {i}]"
lines.append((start_offset + i, desc))
return lines
return []

Expand Down

0 comments on commit 3bca5c8

Please sign in to comment.