Skip to content

Commit 63515e0

Browse files
Exclude regex from embedded
1 parent 8444d8b commit 63515e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/CollectionParser/Parser.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public struct Parser<Subject: Collection> {
121121
}
122122
}
123123

124+
#if !$Embedded
124125
/// Advances the parser by matching the given regex against the prefix of the remainder of the subject.
125126
///
126127
/// If the regex does not match the prefix of the remainder of the subject, the parser will not be advanced.
@@ -135,6 +136,7 @@ public struct Parser<Subject: Collection> {
135136
}
136137
self.position = match.range.upperBound
137138
}
139+
#endif
138140

139141
// MARK: Peek
140142

@@ -201,6 +203,7 @@ public struct Parser<Subject: Collection> {
201203
self.remainder().prefix(prefix.count) == prefix
202204
}
203205

206+
#if !$Embedded
204207
/// Returns whether the prefix of the remainder of the subject matches the given regex.
205208
///
206209
/// If the regex includes a transformation closure that throws an error, the error will be ignored and `false` will be returned.
@@ -212,6 +215,7 @@ public struct Parser<Subject: Collection> {
212215
public func hasPrefix(_ regex: some RegexComponent) -> Bool where SubSequence == Substring {
213216
self.remainder().prefixMatch(of: regex) != nil
214217
}
218+
#endif
215219

216220
// MARK: Pop
217221

@@ -303,6 +307,7 @@ public struct Parser<Subject: Collection> {
303307
return prefix
304308
}
305309

310+
#if !$Embedded
306311
/// Returns the match of the given regex if it matches the prefix of the remainder of the subject, and advances the parser by the match if so.
307312
///
308313
/// - Parameter regex: The regex to match.
@@ -317,6 +322,7 @@ public struct Parser<Subject: Collection> {
317322
self.position = match.range.upperBound
318323
return match
319324
}
325+
#endif
320326

321327
// MARK: View
322328

0 commit comments

Comments
 (0)