isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

=s.TQ assigns to T rather than Q #201

Closed andersk closed 8 years ago

andersk commented 8 years ago

=s.TQ compiles to assign('T',Psum(transpose(Q))), even though T is not mentioned. Shouldn’t that assign to Q?

Maltysen commented 8 years ago

that's very weird. even =.TQ compiles properly, its only when you put something before it that this bug pops up.

Maltysen commented 8 years ago

the same thing happens with things like =S.ZQ. might be a problem in the parser.

Maltysen commented 8 years ago

But it doesn't happen with =S.!Q or =S.aQ where there isn't a variable called ! or a.

isaacg1 commented 8 years ago

Another case of the same bug: https://pyth.herokuapp.com/?code=%3D%2a"blah"Tb&debug=1

To fix this, what Pyth really needs is a tokenizer

isaacg1 commented 8 years ago

This is fixed.