Skip to content

Commit

Permalink
< Swift 5.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Oct 5, 2022
1 parent 734f42b commit 89caf8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftTreeSitter/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public struct QueryCapture {
}

private static func evaluateDirectives(_ predicates: [Predicate], with name: String) -> [String: String] {
let pairs = predicates.compactMap { predicate in
let pairs = predicates.compactMap { predicate -> (String, String)? in
switch predicate {
case let .set(captureName: captureName, key: key, value: value):
if captureName == name {
Expand Down Expand Up @@ -311,7 +311,7 @@ public class QueryCursor {

extension QueryCursor: Sequence, IteratorProtocol {
private func evaluateDirectives(_ predicates: [Predicate]) -> [String: String] {
let pairs = predicates.compactMap { predicate in
let pairs = predicates.compactMap { predicate -> (String, String)? in
switch predicate {
case .set(captureName: nil, key: let key, value: let value):
return (key, value)
Expand Down

0 comments on commit 89caf8d

Please sign in to comment.