Regex

halotukozak.regex.Regex
See theRegex companion enum
object Regex

Attributes

Companion
enum
Source
Regex.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Regex.type

Members list

Type members

Classlikes

object given_ToExpr_Regex extends ToExpr[Regex]

Embeds the value's already-computed RegexEncoder.Encoded shape, reconstructed by RegexDecoder, instead of regenerating it through the public smart constructors (concat, alt, inter, star, unary_!, lookahead) at every call site - the same spirit as TokenMatcher's ToExpr embedding its DFA tables as plain data. The smart constructors exist to (re-)establish ACI normalization and merge Chars sets when building a tree from scratch; a Regex value reaching this given is already normalized, so re-running them at every macro call site - and again at every class load, since the generated code re-executes them - would just redo that work for a result that's already known. See RegexEncoder for why the encoding is flat data rather than nested constructor calls.

Embeds the value's already-computed RegexEncoder.Encoded shape, reconstructed by RegexDecoder, instead of regenerating it through the public smart constructors (concat, alt, inter, star, unary_!, lookahead) at every call site - the same spirit as TokenMatcher's ToExpr embedding its DFA tables as plain data. The smart constructors exist to (re-)establish ACI normalization and merge Chars sets when building a tree from scratch; a Regex value reaching this given is already normalized, so re-running them at every macro call site - and again at every class load, since the generated code re-executes them - would just redo that work for a result that's already known. See RegexEncoder for why the encoding is flat data rather than nested constructor calls.

Attributes

Source
Regex.scala
Supertypes
trait ToExpr[Regex]
class Object
trait Matchable
class Any
Self type

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def alt(parts: Iterable[Regex]): Regex

Alternation of a collection, preferring earlier elements - see Regex.Alt's doc comment. Builds flat straight into an AltBranches (order-preserving dedup, one pass) instead of .toVector.distinct followed by a separate .toSet later for equals/hashCode: the latter would build two different set-like views of the same elements where one suffices.

Alternation of a collection, preferring earlier elements - see Regex.Alt's doc comment. Builds flat straight into an AltBranches (order-preserving dedup, one pass) instead of .toVector.distinct followed by a separate .toSet later for equals/hashCode: the latter would build two different set-like views of the same elements where one suffices.

Attributes

Source
Regex.scala
def apply(set: CharSet): Regex

Attributes

Source
Regex.scala
def group(index: Int, name: Option[String], inner: Regex): Regex

Smart constructor for a capturing group node - see Regex.Group. Unlike lookahead/ star/etc., this never collapses even when inner is Eps/Empty: the group's identity (its index/name existing at all) matters regardless of what it can match, e.g. (a?) is still a real, numbered group even though it can capture the empty string.

Smart constructor for a capturing group node - see Regex.Group. Unlike lookahead/ star/etc., this never collapses even when inner is Eps/Empty: the group's identity (its index/name existing at all) matters regardless of what it can match, e.g. (a?) is still a real, numbered group even though it can capture the empty string.

Attributes

Source
Regex.scala
def inter(parts: Iterable[Regex]): Regex

Intersection of a collection.

Intersection of a collection.

Attributes

Source
Regex.scala
def lit(c: Char): Regex

Convenience: literal char.

Convenience: literal char.

Attributes

Source
Regex.scala
def literal(s: String): Regex

Convenience: literal string, one character per code point (a surrogate pair is one character).

Convenience: literal string, one character per code point (a surrogate pair is one character).

Attributes

Source
Regex.scala
def lookahead(r: Regex, positive: Boolean): Regex

Zero-width lookahead assertion: Regex.lookahead(r, true) is (?=r), Regex.lookahead(r, false) is (?!r). Degenerates to Eps/Empty directly when r itself is Eps/Empty, since the assertion is then a constant regardless of context.

Zero-width lookahead assertion: Regex.lookahead(r, true) is (?=r), Regex.lookahead(r, false) is (?!r). Degenerates to Eps/Empty directly when r itself is Eps/Empty, since the assertion is then a constant regardless of context.

Attributes

Source
Regex.scala
def range(lo: Char, hi: Char): Regex

Convenience: char range.

Convenience: char range.

Attributes

Source
Regex.scala

Concrete fields

val all: Regex

All-strings regex Σ*.

All-strings regex Σ*.

Attributes

Source
Regex.scala
val maxRepeatBound: Int

Upper bound on quantifier bounds accepted by repeat. Repeat itself stays O(1) regardless of lo/hi (see repeat), but each Brzozowski derivative step through it (Subset.rawDerive) peels one repetition off, so exploring L(r{0,hi}) up to a fixed point (Subset.isEmpty/subset) still visits on the order of hi distinct states - an unbounded value would let a single malformed pattern blow up that exploration. Real-world token patterns never need bounds anywhere near this size.

Upper bound on quantifier bounds accepted by repeat. Repeat itself stays O(1) regardless of lo/hi (see repeat), but each Brzozowski derivative step through it (Subset.rawDerive) peels one repetition off, so exploring L(r{0,hi}) up to a fixed point (Subset.isEmpty/subset) still visits on the order of hi distinct states - an unbounded value would let a single malformed pattern blow up that exploration. Real-world token patterns never need bounds anywhere near this size.

Attributes

Source
Regex.scala

Givens

Givens

Embeds the value's already-computed RegexEncoder.Encoded shape, reconstructed by RegexDecoder, instead of regenerating it through the public smart constructors (concat, alt, inter, star, unary_!, lookahead) at every call site - the same spirit as TokenMatcher's ToExpr embedding its DFA tables as plain data. The smart constructors exist to (re-)establish ACI normalization and merge Chars sets when building a tree from scratch; a Regex value reaching this given is already normalized, so re-running them at every macro call site - and again at every class load, since the generated code re-executes them - would just redo that work for a result that's already known. See RegexEncoder for why the encoding is flat data rather than nested constructor calls.

Embeds the value's already-computed RegexEncoder.Encoded shape, reconstructed by RegexDecoder, instead of regenerating it through the public smart constructors (concat, alt, inter, star, unary_!, lookahead) at every call site - the same spirit as TokenMatcher's ToExpr embedding its DFA tables as plain data. The smart constructors exist to (re-)establish ACI normalization and merge Chars sets when building a tree from scratch; a Regex value reaching this given is already normalized, so re-running them at every macro call site - and again at every class load, since the generated code re-executes them - would just redo that work for a result that's already known. See RegexEncoder for why the encoding is flat data rather than nested constructor calls.

Attributes

Source
Regex.scala

Extensions

Extensions

extension (a: Regex)
infix def concat(b: Regex): Regex

Attributes

Source
Regex.scala