Ticket #45188

generate_packets.py: parse packet and type definitions in one go

Open Date: 2022-07-22 00:12 Last Update: 2022-07-23 19:17

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

Part of #45186. Make a PacketsDefintion.parse_clean_lines(lines: Iterable[str]) method that parses input line by line in one go, rather than the current approach of doing types first and then going over everything that's left again for the packets.

This will make it so types can no longer be defined anywhere, but must be defined before they're used, and may no longer be defined inside a packet definition.

Ticket History (3/4 Histories)

2022-07-22 00:12 Updated by: alienvalkyrie
  • New Ticket "generate_packets.py: parse packet and type definitions in one go" created
2022-07-22 00:39 Updated by: alienvalkyrie
  • Resolution Update from None to Accepted
  • Details Updated
Comment

Note that this causes an edge case where at the very end of the file, an end line can be omitted – explicitly forbidding this would require writing a custom takewhile implementation, which probably isn't worth the hassle.

2022-07-23 19:17 Updated by: alienvalkyrie
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login