py-myopl-code icon indicating copy to clipboard operation
py-myopl-code copied to clipboard

in episode 5 'AND' keyword to be '&&'.

Open ghost opened this issue 1 year ago • 2 comments

i want my 'AND' keyword to be '&&' but whenever I use && the code pops out it as illegal: '&' BTW the code works fine when I use 'AND' as an keyword. i also tried using '&&' still didn't work

ghost avatar Sep 05 '23 11:09 ghost

This is half a year late and I'm assuming you probably moved on or figured it out but it's still open so on line 14 change LETTERS to string.ascii.letters + '&' and on line 120 change the keyword 'AND' to '&&'.

Sebwazhere avatar Jun 03 '24 20:06 Sebwazhere

This is half a year late and I'm assuming you probably moved on or figured it out but it's still open so on line 14 change LETTERS to string.ascii.letters + '&' and on line 120 change the keyword 'AND' to '&&'.

I think it's not a good idea to directly change the LETTERS because it would allow for variable names such as a&a but I think it would be better to change the lexer to add a AND token and change the parser and the interpreter to use this new AND token instead of the Token(TT_KEYWORD, 'AND').

foxypiratecove37350 avatar Aug 19 '24 17:08 foxypiratecove37350