Add an intention to simplify negated binary expressions
Given an expression of the form `!(a op b)`, replace it with `a !op b`.
For example:
!(a < b) -> a >= b
!(a is Int) -> a !is int
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
if (a != b) {
|
||||
println("Not Equal")
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
if (<spot>!(a == b)</spot>) {
|
||||
println("Not Equal")
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention simplifies negated binary expressions by replacing expressions such as
|
||||
!(<b>a</b> <small>op</small> <b>b</b>) with <b>a</b> <small>negop</small> <b>b</b>
|
||||
(where <small>op</small> and <small>negop</small> are inverse comparison operators like <b>==</b> and <b>!=</b> or <b>in</b> and <b>!in</b>).
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user