Re:Forging Signed Commits on GitHub
by alexjplant on Tuesday January 23, 2024 @10:33AM
(#39104722)
I wrote a chintzy Preact app that pulls the source for a Pokemon Red hack from Github and makes Pokemon stats, moves, type matchups, etc. searchable [1] because enough has changed from the original that I wanted a quick reference for my current playthrough. I literally wrote in the TODOs in the README
Generate proper AST from asm source and ditch janky Regex parsing?
because I felt guilty about doing things like
const match = l.match(/\s*move\s*(\w+),\s*(\w+),\s*(\d+),\s*(\w+),\s*(\d+),\s*(\d+)\s*(.*)/)
Re:Forging Signed Commits on GitHub
by willdr on Tuesday January 23, 2024 @04:21PM
(#39110033)
A proper AST would "read" the source code programmatically, as opposed to brittle regex? Is there any benefit to building that when your regex works and what you're parsing is static? (Genuine questions, my compsci background is not strong).
[1] https://github.com/alexjplant/rgbdex