Skip to content

Commit 4efa61e

Browse files
committed
More doc comments
1 parent 61f84c8 commit 4efa61e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/DotEnvy/DotEnvy.swift

+8
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ public func formatError(source: String, error: ParseError, errorLocation: String
172172
"""
173173
}
174174

175+
/// Errors that occur during parsing.
176+
///
177+
/// `ParseError` does not include information about the error location. That information
178+
/// can be derived from the location where the parsed substring was left at by ``parse(substring:)``.
179+
///
180+
/// - SeeAlso: If you call ``parse(string:)``, the thrown error is ``ParseErrorWithLocation`` which does
181+
/// include the location information.
175182
public enum ParseError: Error {
176183
case invalidEscapeSequence
177184
case invalidKeyStart(Character)
@@ -196,6 +203,7 @@ extension ParseError: CustomStringConvertible {
196203
}
197204
}
198205

206+
/// Encapsulates a ``ParseError`` along with location in the original input.
199207
public struct ParseErrorWithLocation: Error {
200208
public var error: ParseError
201209
public var location: String.Index

0 commit comments

Comments
 (0)