finished trees and DLL, started hashtable
finished trees and DLL, started hashtable
added function arguments and changed argument code gen and semantics to support args, no arg funcs still work
added break and continue, and addressed an error with for loop parsing.
added for loops and else ifs (no break or continue yet, thats next)
stacks and queues (as if i dont know them)
While loops done, they work now yay
I added scoping, now when you define a variable in an else or if block, if can’t be accessed outside that block.
Added else statements (no else if yet)
yaknow booleans??? how they do be booleaning???? well now you can if with them!!! no else or else if yet, but now you cna do this:
int b = 1;
if (b>0) {
print(b);
}
and it prints 1
so turns out the last update wasnt actually added boolean code, but instead the basic concepts of booolean. tihs one added the actual code, like bool x = true&&false||(true);trust i get max storytelling
and yes im still pirating brooklyn 99 its js on a diff monitor now
to begin with: yes i was pirating brooklyn nine nine its a great show dont judge me if you think im weird for watching it you havent watched it but now getting to the arguably less important thing, this devlog consists of adding variable expressions, expressions in general, parens, and boolean expressions (no conditionals yet). its only 1h19m becuz i forgot that wakatime needs wifi, so i lost like an hour coding the expressions, this 1h19m is only the boolean expressions. so now the following new statements are valid
int score = 0;
score = score + 1;
print(score);
bool hi = false;
bool nope = false||true&&(true||false);
print(nope);
Added arithmetic! see screenshot and commit message, but basically you can do print(1+2); or int result = 10*2+4;
made linked list class. thats lowk it he kept explaining things “i didnt understand” so it took a while since i wrote code more memory efficient than what he normally uses for stuff like this so he mdae me rewrite it slower and slower until he could comprehend it.
Added integer variables!!! (no arithmetic yet, thats next).
I added functions!
beforehand the only “function” was main, and all it did was start the program. this time tho, it has actual functions in semantic.h semantic.cpp and codegen.cpp, so you can run code from a function! again I do not know how i’m supposed to attach a screenshot of no code when im making a coding language, so this is just vscode from when it worked! (sorry for devlogs, ill make them better and mroe frequent soon)
GAWD DAMN I KEEP FORGETTING DEVLOGS (HCTG doenst have any). I added code gen, and i started variables.
A lexa and a parsa (idk what to provide for screenshot besides terminal, there is no interface yet lol)