You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggest splitting parser.rs into smaller mod files #944
@alamb If possible, we can break it up into some issues and PRs to step through this refactoring.
Do you have any suggestions for this? Thank you very much. 😊
@alamb If possible, we can break it up into some issues and PRs to step through this refactoring.
Sounds like a good plan for me
Do you have any suggestions for this? Thank you very much. 😊
My bandwidth for this repo is quite low. However, if you make PRs that are easy to review (just moving code around) I think I can review and merge them pretty fast
@alamb one question, not 100% related but... What are your thoughts on creating a trait Parse to implement for the structures/enums, instead of loose functions?
This would make it easier to identify where things happen. Sometimes I find myself trying to figure which method parses which structure, as they are all together and, sometimes, with the same return.
A structured trait could be a nice idea and I would personally welcome it, but also a monumental refactoring at this time. I think we should start by splitting up into submodules, maybe just before the next release so we have a "frozen repository" moment after having merged the PRs we can manage.
Closing in favour of #2591, which tracks the same split as a series of pure-move PRs before the next release. The structured trait idea will be explored at some point in the future but it will be certainly a major refactoring requiring a non trivial amount of time.
Activity
r4ntix commentedon Aug 10, 2023
The overall directory structure after sorting is as follows:
alamb commentedon Aug 17, 2023
This basic plan seems reasonable to me, though it will cause substantial conflicts with anyone who as an outstaning PR 🤔
r4ntix commentedon Aug 18, 2023
@alamb If possible, we can break it up into some issues and PRs to step through this refactoring.
Do you have any suggestions for this? Thank you very much. 😊
alamb commentedon Aug 18, 2023
Sounds like a good plan for me
My bandwidth for this repo is quite low. However, if you make PRs that are easy to review (just moving code around) I think I can review and merge them pretty fast
AugustoFKL commentedon Sep 12, 2023
@alamb one question, not 100% related but... What are your thoughts on creating a trait
Parseto implement for the structures/enums, instead of loose functions?This would make it easier to identify where things happen. Sometimes I find myself trying to figure which method parses which structure, as they are all together and, sometimes, with the same return.
alamb commentedon Sep 13, 2023
I am not quite sure what you are proposing @AugustoFKL -- what would be an example of such a trait?
LucaCappelletti94 commentedon Sep 26, 2026
A structured trait could be a nice idea and I would personally welcome it, but also a monumental refactoring at this time. I think we should start by splitting up into submodules, maybe just before the next release so we have a "frozen repository" moment after having merged the PRs we can manage.
alamb commentedon Sep 27, 2026
splitting sounds like a great first step
LucaCappelletti94 commentedon Sep 28, 2026
Closing in favour of #2591, which tracks the same split as a series of pure-move PRs before the next release. The structured trait idea will be explored at some point in the future but it will be certainly a major refactoring requiring a non trivial amount of time.
src/parser/mod.rsandsrc/ast/mod.rsinto smaller modules #2591