Skip to content

Commit

Permalink
fix: minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnaldo committed Feb 10, 2025
1 parent 10b078d commit 9f24102
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/scala/esmeta/util/domain/BSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ enum BSet[+T] {

def isTop: Boolean = this == Inf
def isBottom: Boolean = this == Fin(Set())
inline def (that: BSet[T @uncheckedVariance]): Boolean = this that
inline def (that: BSet[T @uncheckedVariance]): Boolean = this <= that
def <=[U >: T](that: BSet[U]): Boolean = (this, that) match
case (_, Inf) => true
case (Inf, _) => false
case (Fin(lset), Fin(rset)) => lset.toSet subsetOf rset.toSet
inline def (that: BSet[T @uncheckedVariance]): BSet[T] = this that
inline def (that: BSet[T @uncheckedVariance]): BSet[T] = this || that
def ||[U >: T](that: BSet[U]): BSet[U] = (this, that) match
case (Inf, _) | (_, Inf) => Inf
case (Fin(lset), Fin(rset)) => Fin(lset ++ rset)
inline def (that: BSet[T @uncheckedVariance]): BSet[T] = this that
inline def (that: BSet[T @uncheckedVariance]): BSet[T] = this && that
def &&[U >: T](that: BSet[U]): BSet[U] = (this, that) match
case (Inf, _) => that
case (_, Inf) => this
Expand All @@ -52,6 +52,6 @@ enum BSet[+T] {
object BSet {
val Top = Inf
val Bot = BSet()
inline def apply[A](elems: A*): BSet[A] = apply(elems)
inline def apply[A](elems: Iterable[A]): BSet[A] = Fin(elems.toSet)
inline def apply[T](elems: T*): BSet[T] = apply(elems)
inline def apply[T](elems: Iterable[T]): BSet[T] = Fin(elems.toSet)
}
6 changes: 3 additions & 3 deletions src/main/scala/esmeta/util/domain/Flat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum Flat[+T] {

def isTop: Boolean = this == Many
def isBottom: Boolean = this == Zero
inline def (that: Flat[T @uncheckedVariance]): Boolean = this that
inline def (that: Flat[T @uncheckedVariance]): Boolean = this <= that
def <=[U >: T](that: Flat[U]): Boolean = (this, that) match
case (Zero, _) | (_, Many) => true
case (Many, _) | (_, Zero) => false
Expand Down Expand Up @@ -55,8 +55,8 @@ enum Flat[+T] {
object Flat {
val Top = Many
val Bot = Zero
inline def apply[A](elems: A*): Flat[A] = apply(elems)
def apply[A](elems: Iterable[A]): Flat[A] =
inline def apply[T](elems: T*): Flat[T] = apply(elems)
def apply[T](elems: Iterable[T]): Flat[T] =
if (elems.isEmpty) Zero
else if (elems.size == 1) One(elems.head)
else Many
Expand Down

0 comments on commit 9f24102

Please sign in to comment.