MatchingOptionSequence
A sequence of matching options, written in source.
struct MatchingOptionSequence
A sequence of matching options, written in source.
struct MatchingOptionSequence
import _RegexParser
struct AST
A regex abstract syntax tree.
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: Diagnostics
var 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 AbsentFunction
An Oniguruma absent function.
struct Alternation
struct Atom
struct Concatenation
struct Conditional
struct CustomCharacterClass
struct Empty
struct GlobalMatchingOption
Global matching option specifiers.
struct GlobalMatchingOptionSequence
A set of global matching options in a regular expression literal.
struct Group
struct Interpolation
struct MatchingOption
An option, written in source, that changes matching semantics.
indirect enum Node
A node in the regex AST.
struct Quantification
struct Quote
struct Reference
struct Trivia
typealias Located = Source.Located
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
init(adding: [AST.MatchingOption])
init(caretLoc: SourceLocation?, adding: [AST.MatchingOption], minusLoc: SourceLocation?, removing: [AST.MatchingOption])
init(removing: [AST.MatchingOption])
var adding: [AST.MatchingOption]
The options to add.
var caretLoc: SourceLocation?
If the sequence starts with a caret ‘^’, its source location, or nil otherwise. If this is set, it indicates that all the matching options are unset, except the ones in adding
.
var minusLoc: SourceLocation?
The location of the ‘-’ between the options to add and options to remove.
var removing: [AST.MatchingOption]
The options to remove.
var resetsCurrentOptions: Bool { get }
Whether this set of matching options first resets the options before adding onto them.
var halfWidthCornerQuoted: String { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.