virejdasani / pythOwO

an UwU programming language
https://youtu.be/czZmkh7CY6M
MIT License
844 stars 47 forks source link

can't compare strings. #6

Closed skits4107 closed 2 years ago

skits4107 commented 2 years ago

I cant compare strings in conditional statements. for example this code produces an error:

pwease baka = "hewwo" pwease awoo = "hewwo" IF awoo==baka THWEN pwint("they are equal ") EWSE pwint("twy again")

the error message is

Traceback (most recent call last): File test.pyowo, line 4, in owo, whats this? Runtime Error? Oh nwo! : Illegal operation IF awoo==baka THWEN pwint("yay") EWSE pwint("twy again") __^^^^^^^^^^

Swiddis commented 2 years ago

Looks like Strings don't have the comparison operators implemented. They're defaulting to Value's implementation that returns an illegal operation error.

This can be fixed by overriding the Value comparison operators with an implementation around here.