anyway the part of the puzzle that I think I inadvertently left out of this thread is that I'm starting out learning rust by modifying an existing rust program, not in writing anything my own.
So there's a lot of "how the fuck does this work?" and having to read the source until I figure out what keywords I need to google
so (and I'm writing this primarily to rubber-duck my own understanding of it, rather than specifically asking questions, though feel free to speak up if you think you can help):
I have a tuple struct called "Commands" that contains an std::vec of "Command" structs.
I'm passing this into a function, as a reference. so the function gets a &Commands parameters.
It then tries to do "for command in commands" to iterate through the contents of the Commands struct, but it can't.
now I'm trying to figure out the following:
I have a vector of Commands (which is an enum). Some of them are Include commands. I need to go through the vec and replace the Include commands with the Commands from the item they're supposed to Include.
So I need to iterate through the vec and do something special when the command is an Include vs something else.
this code currently generates SVG files.
I don't really want to look up how to make it do that better, and I don't need that ability, so now I gotta figure out what to do next. I think I might implement a generate-to-text feature to debug/implement everything before I try generate-to-bytecode? I don't want to have to observe my results in a hex editor
anyway right now I'm trying to figure out parsing variable declarations.
There's existing code that handles some basic versions of it, but the problem I'm currently facing is that there are multiple types of values in variable declarations. like:
$foo=42
$bar="hello"
$center=(320,240)
$background=RGB(255,0,255)
and I have nom-parsers that can handle parsing integers and strings and points and colors, but now I need to handle "it could be any of them"
@DPA yeah. but this is also teaching me rust as a side-effect