Skip to content

fix boolean condition order OR > AND - #27

Merged
Wyvest merged 2 commits into
mainfrom
main
Nov 4, 2025
Merged

fix boolean condition order OR > AND#27
Wyvest merged 2 commits into
mainfrom
main

Conversation

@Traben-0

@Traben-0 Traben-0 commented Nov 4, 2025

Copy link
Copy Markdown
Owner

Description

preprocessor considers the condition
//#if MC >= 11902 && MC <= 11904 && FORGE || MC == 12001 && FORGE || MC == 12004 && NEOFORGE
as (MC >= 11902 && MC <= 11904 && FORGE) || (MC == 12001 && FORGE) || (MC == 12004 && NEOFORGE) (i.e. OR conditions > AND conditons)
whereas the support I added for && & || in a previous commit, simply considered them from left to right e.g.
//#if ((((((MC >= 11902 && MC <= 11904) && FORGE) || MC == 12001) && FORGE) || MC == 12004) && NEOFORGE)

How to test

the condition t || f && f should resolve to true t || (f && f) whereas it was false before (t || f) && f

no changelog, fix in unreleased feature

@Wyvest
Wyvest merged commit d28a67f into Traben-0:main Nov 4, 2025
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants