StateSpaceLimitExceeded

halotukozak.regex.StateSpaceLimitExceeded
final case class StateSpaceLimitExceeded(limit: Int)

Raised (as a Left, never thrown) by Subset.isEmptyBounded, Subset.subsetBounded, TokenMatcher.fromRegexesBounded, and TokenMatcher.fromSubsetsBounded when deciding the answer would require visiting more than limit distinct derivative states.

This engine has no classic backtracking, so it isn't exposed to catastrophic-backtracking ReDoS in the traditional sense - but the derivative state space these operations explore has no bound of its own: a pattern built to maximize distinct derivative states (many overlapping alternations/intersections/bounded repetitions near Regex.maxRepeatBound) can still make either slow or memory-heavy. That matters wherever pattern strings come from untrusted input, e.g. Subset's stated use case of validating one pattern against another at load/build time. The bounded methods this guards are opt-in: the plain isEmpty/subset/fromRegexes/ fromSubsets stay uncapped, unchanged, for every existing caller.

Attributes

Source
Subset.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Subset.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala