flipcoder / textbeat

🎹 plaintext music sequencer and midi shell, with vim playback and the powers of music theory 🥁
MIT License
406 stars 13 forks source link

Vjp/refactor player pt2 #10

Closed vanceism7 closed 2 years ago

vanceism7 commented 2 years ago

This PR factors all the global variable setting code into its own function, and then breaks that function down into a number of sub functions just to clean it up a little.

You can review this commit by commit if you wanna see the individual changes. It's not too crazy though

Something im curious about: In the function adjust_operands, we have this line

num,ct = peel_uint(val[:ct])

It looks like these are local variables but weren't being used anywhere. If they're used in some broader context, then perhaps factoring the handle_assign function could've broke something? In testing, all of the % commands still seem to be working, but this might need some fixing up if not.

flipcoder commented 2 years ago

Yeah there's definitely some problems with my parser code here. It also looked like there's an undefined count under one of the conditions that probably wasn't tested. I'll get it cleaned up