Skip to content

Commit

Permalink
style(prost-build): Consolidate field data into struct (#1017)
Browse files Browse the repository at this point in the history
* prost-build: consolidate message field data

When massaging field data in CodeGenerator::append_message,
move it into lists of Field and OneofField structs so that later
generation passes can operate on the data with less code duplication.

Subsidiary append_* methods are changed to take references to these
structs rather than moved data, as generation of lexical tokens
does not actually consume any owned data, and we will need more
passes over the same field lists for the upcoming builder code.

* prost-build: compute field tags in place

* prost-build: address comments on reuse of Field

Make rust_field into a method computing the name on the fly.
In OneofField, make the vector of fields to have Field members.
Don't play reference renaming tricks with field.descriptor.
  • Loading branch information
mzabaluev committed Apr 29, 2024
1 parent 43753be commit 680a2e1
Showing 1 changed file with 127 additions and 87 deletions.

0 comments on commit 680a2e1

Please sign in to comment.