Ticket #45186

generate_packets.py: Parse input line by line

Open Date: 2022-07-22 00:01 Last Update: 2022-07-23 19:18

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

Details

Part of #43927. Apart from C-style multiline/block comments, the packets.def format is entirely line-based; however, current parsing code joins its input into one large string and splits it into lines again multiple times. This meta-ticket is about changing it to do everything on a per-line basis.

Things to note:

  • This will mean that type aliases have to be defined before they're used
  • This will also mean that type aliases can no longer be defined inside packet definitions
  • The current packets.def is not affected by either of those things, but it will break any third-party packets.def which does those things
  • Stripping out multiline /* */ comments while working line-by-line is nontrivial but doable

Steps to implement this (in order):

  • Separate Packet header parsing from the rest of Packet initialization #45187
  • Make PacketsDefinition parse the (cleaned) input line by line #45188
  • Make PacketsDefinition clean the the input line by line #45189

Ticket History (3/4 Histories)

2022-07-22 00:01 Updated by: alienvalkyrie
  • New Ticket "generate_packets.py: Parse input line by line" created
2022-07-22 00:19 Updated by: alienvalkyrie
  • Details Updated
2022-07-22 00:42 Updated by: alienvalkyrie
Comment

All sub-issues are now in review. Once they are merged, this ticket will be closed.

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

Attachment File List

No attachments

Edit

Please login to add comment to this ticket » Login