Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison of strings not implemented #13

Open
praecipitator opened this issue Jul 5, 2018 · 1 comment
Open

Comparison of strings not implemented #13

praecipitator opened this issue Jul 5, 2018 · 1 comment

Comments

@praecipitator
Copy link

The vanilla compiler can compare strings. It behaves like you would expect from any sensible language, returning the alphabetical order.
However, Caprica doesn't allow you to compile a script which attempts to compare two strings.

@cadpnq
Copy link

cadpnq commented Jul 5, 2018

If you're comfortable with trying to fix it yourself you should take a look at: https://github.com/Orvid/Caprica/blob/master/Caprica/papyrus/expressions/PapyrusBinaryOpExpression.h#L164

Currently it coerces both operands to the same type and then throws an error if the left operand isn't an Int or a Float. The fix would be to split the magnitude comparison cases from the number-specific operator ones. The comparisons should be valid when both operands are strings or are numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants