Location
The location in the input of a parsed entity, presented as a region over the input
struct Location
The location in the input of a parsed entity, presented as a region over the input
struct Location
import _RegexParser
struct Source
The source of text being given to a parser.
struct Located<T>
A value wrapped with a source range.
struct LocatedError<E> where E : Error
An error that includes information about the location in source code.
typealias Char = Character
typealias Input = String
typealias Position = String.Index
A precise point in the input, commonly used for bounded ranges.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
init(_ r: Range<Source.Position>)
init<R>(_ r: R, in input: Source) where R : RangeExpression, R.Bound == String.Index
init(from sub: Source.Input.SubSequence)
static var fake: Source.Location { get }
NOTE: This is a temporary measure to unblock DSL efforts and incremental source location tracking. This shouldn’t be called from within the parser’s module…
var end: Source.Position { get }
The open end
var isEmpty: Bool { get }
Whether this location covers an empty range. This includes isFake
.
var isFake: Bool { get }
var isReal: Bool { get }
var range: Range<Source.Position>
var start: Source.Position { get }
func union(with other: Source.Location) -> SourceLocation
Returns the smallest location that contains both this location and another.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.