You are browsing as a guest. Sign up (or log in) to start making projects!

3h 30m 18s logged

Devlog 5: Operators

I started work on the AST (abstract syntax tree) walking algorithm today. I didn’t get very far, but one of the things I did do was I fixed operator parsing.

Before, if you were to parse something like 15 > 5 && 5 < 10, it would have been a greater-than operator with a boolean operator as a child, and that doesn’t work. Therefore, I had to write some code to convert that broken operator into a boolean operator with mathematical children. The algorithm didn’t make much sense in my head, so I drew it out on paper and that made it pretty easy to write.

Below is the illustration I made and the code it became.

0
32

Comments 1

@Ajay-dxb

Crazy drawing dude