Node
A node in the regex AST.
indirect enum NodeA node in the regex AST.
indirect enum Nodeimport _RegexParserstruct ASTA regex abstract syntax tree.
case absentFunction(AST.AbsentFunction)case alternation(AST.Alternation)… | … | …
case atom(AST.Atom)case concatenation(AST.Concatenation)… …
case conditional(AST.Conditional)(?(cond) true-branch | false-branch)
case customCharacterClass(AST.CustomCharacterClass)case empty(AST.Empty)case group(AST.Group)(…)
case interpolation(AST.Interpolation)Intepolation <{...}>, currently reserved for future use.
case quantification(AST.Quantification)case quote(AST.Quote)\Q…\E
case trivia(AST.Trivia)Comments, non-semantic whitespace, etc
init(_ root: AST.Node, globalOptions: AST.GlobalMatchingOptionSequence?, diags: Diagnostics) var captureList: CaptureList { get }The capture list (including the whole match) of this AST.
var diags: Diagnosticsvar globalOptions: AST.GlobalMatchingOptionSequence?var hasCapture: Bool { get }Whether this AST tree contains at least one capture nested inside of it.
var isInvalid: Bool { get }Whether this AST tree is either syntactically or semantically invalid.
var root: AST.Node@discardableResult func ensureValid() throws -> AST If the AST is invalid, throws an error. Otherwise, returns self.
func renderAsCanonical(showDelimiters delimiters: Bool = false, terminateLine: Bool = false) -> String Renders using Swift’s preferred regex literal syntax.
struct AbsentFunctionAn Oniguruma absent function.
struct Alternationstruct Atomstruct Concatenationstruct Conditionalstruct CustomCharacterClassstruct Emptystruct GlobalMatchingOptionGlobal matching option specifiers.
struct GlobalMatchingOptionSequenceA set of global matching options in a regular expression literal.
struct Groupstruct Interpolationstruct MatchingOptionAn option, written in source, that changes matching semantics.
struct MatchingOptionSequenceA sequence of matching options, written in source.
struct Quantificationstruct Quotestruct Referencestruct Triviatypealias Located = Source.Locatedprotocol CopyableA type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertibleA type with a customized textual representation.
protocol EquatableA type that can be compared for value equality.
protocol Escapableprotocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
var children: [AST.Node]? { get }The child nodes of this node.
var hasCapture: Bool { get }Whether this node contains at least one capture nested inside of it.
var isQuantifiable: Bool { get }Whether this node may be used as the operand of a quantifier such as ?, + or *.
var isTrivia: Bool { get }Whether this node is trivia or non-semantic, like comments.
var literalStringValue: String? { get }var location: SourceLocation { get }func `as`<T>(_ t: T.Type = T.self) -> T? where T : _ASTNode func renderAsCanonical(showDelimiters delimiters: Bool = false, terminateLine: Bool = false) -> String Renders using Swift’s preferred regex literal syntax.
var halfWidthCornerQuoted: String { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.