mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DFA: ignore ranges for float/double (was introduced during DfaFactType merge)
This commit is contained in:
+10
-13
@@ -720,20 +720,17 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
if (dfaLeft instanceof DfaUnknownValue || dfaRight instanceof DfaUnknownValue) return true;
|
||||
RelationType relationType = dfaRelation.getRelation();
|
||||
|
||||
if (dfaLeft instanceof DfaVariableValue) {
|
||||
LongRangeSet right = getValueFact(DfaFactType.RANGE, dfaRight);
|
||||
if (right != null) {
|
||||
if (!applyFact((DfaVariableValue)dfaLeft, DfaFactType.RANGE, right.fromRelation(relationType))) {
|
||||
return false;
|
||||
}
|
||||
LongRangeSet left = getValueFact(DfaFactType.RANGE, dfaLeft);
|
||||
LongRangeSet right = getValueFact(DfaFactType.RANGE, dfaRight);
|
||||
|
||||
if (left != null && right != null) {
|
||||
if (dfaLeft instanceof DfaVariableValue &&
|
||||
!applyFact((DfaVariableValue)dfaLeft, DfaFactType.RANGE, right.fromRelation(relationType))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (dfaRight instanceof DfaVariableValue) {
|
||||
LongRangeSet left = getValueFact(DfaFactType.RANGE, dfaLeft);
|
||||
if (left != null) {
|
||||
if (!applyFact((DfaVariableValue)dfaRight, DfaFactType.RANGE, left.fromRelation(relationType.getFlipped()))) {
|
||||
return false;
|
||||
}
|
||||
if (dfaRight instanceof DfaVariableValue &&
|
||||
!applyFact((DfaVariableValue)dfaRight, DfaFactType.RANGE, left.fromRelation(relationType.getFlipped()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,6 +166,12 @@ public class LongRangeBasics {
|
||||
}
|
||||
}
|
||||
|
||||
void testDouble(double d) {
|
||||
if(d > 0 && d < 1) {
|
||||
System.out.println("ok");
|
||||
}
|
||||
}
|
||||
|
||||
private int getState() {
|
||||
return (int)(Math.random() * 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user