Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
fix: iOS 17 negative lookahead regex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dantes-git committed Sep 5, 2023
1 parent 670c1cf commit 0d9f007
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/Beagle/Sources/ContextExpression/Expression/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,16 @@ let pathIndexNode: Parser<Path.Node> = zip(
.index(int)
}

let pathKeyNode: Parser<Path.Node> = prefix(with: #"^\w+\b(?!\()"#).map { .key($0) }
//let pathKeyNode: Parser<Path.Node> = prefix(with: #"^\w+\b(?!\()"#).map { .key($0) }
let pathKeyNode = Parser<Path.Node> { str in
guard let keyNode = prefix(with: #"^\w+"#).run(&str) else { return nil }
if str.first == "(" {
str = keyNode[...] + str
return nil
} else {
return .key(keyNode)
}
}

let pathHeadNodes: Parser<[Path.Node]> = zip(
zeroOrOne(pathKeyNode),
Expand Down

0 comments on commit 0d9f007

Please sign in to comment.