If you read that title and start humming "Dear Prudence" by the Beatles, you can skip the rest of this post.
I've added a few things, like being able to initialize variables on the same line as their declaration, and declaring that variables are constants. Except, if they're "constant" they don't vary. I'm still going to call them "variables".
I've also begun tidying stuff up to make a public repository. Things are rather messier than I'd like for real distribution, but getting stuff pushed to a public repository is going to force my hand some to make things cleaner as a habit.
As I was implementing constants, I was surprised to find that global variables in LLVM have a flag for being constants, but I didn't see the same thing on locals. So, I just made a separate dictionary for them in my frame objects. Nothing too fancy.
I also made parsing rules initially for constant declarations without initializers. Then, I stuck some code into my code generation to flag that as an error, and then I realized that I could catch it at parse time. As early as possible seems the best for that sort of thing.
No screenshots, as constants and variable declarations with initializers aren't pretty to look at.
No comments:
Post a Comment