[Issue 20210] New: version blocks with boolean operators
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Sep 13 10:57:21 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20210
Issue ID: 20210
Summary: version blocks with boolean operators
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: black80 at bk.ru
OT:
add to version check blocks some boolean operators
cuz next is more clear than indented monster at the bottom
version (Dip1000 || DIP1000 || dip1000) {
pragma( msg, "D1000");
} else {
pragma( msg, "no D1000");
}
// current state only supports && and !&&
version(A) version(B) { // replacement only for A && B
} else { /* !A || !B */ }
version (Dip1000) {
pragma( msg, "D1000"); // same logic many times
} else {
version (DIP1000) {
pragma( msg, "D1000");
} else {
version (dip1000) {
pragma( msg, "D1000");
} else {
pragma( msg, "no D1000");
}
}
}
--
More information about the Digitalmars-d-bugs
mailing list