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

Implement _IIF and fix _ROR & _ROL #574

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

a740g
Copy link
Contributor

@a740g a740g commented Nov 24, 2024

This PR introduces _IIF support for QB64-PE, alongside bug fixes and improvements for _ROL and _ROR.

_IIF Implementation:
The _IIF pseudo-function allows for conditional evaluation like the ternary operator in C, with short-circuiting behavior:

result = _IIF(expression, truePart, falsePart)

Key features:

  • Only the truePart or falsePart is evaluated, depending on the expression, mimicking C's conditional operator.
  • The return type is determined by the type of truePart.
  • Both parts cannot mix STRING with other types.

_ROL & _ROR fixes:

  1. Resolved an issue where the second argument could incorrectly be a STRING.
  2. Simplified the C-side logic using template functions for cleaner code.

Closes #403.

@a740g a740g added bug Something isn't working enhancement New feature or request labels Nov 24, 2024
@a740g a740g self-assigned this Nov 24, 2024
@a740g a740g merged commit 6e6b574 into QB64-Phoenix-Edition:main Nov 25, 2024
4 checks passed
@a740g a740g deleted the iif-support branch November 25, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ternary Operator '?'
2 participants