Skip to content

Commit

Permalink
🐛 Parse AnyReducer as generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaewe Heo committed Dec 20, 2022
1 parent 1fb4bcc commit 581ccef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/TCADiagramLib/Internal/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extension SourceFileSyntax {
case (.some("Any"), .some(let parent)):
if
let child = node.description
.firstMatch(of: try Regex("(?s)\\s+AnyReducer\\s+\\{.+?in\\s+(.+?)\\("))?[1]
.firstMatch(of: try Regex("(?s)\\s+AnyReducer.*\\{.+?\\s+(\\w+?)\\("))?[1]
.substring?
.description,
node.tokens(viewMode: .fixedUp).map(\.text).contains("pullback")
Expand Down
2 changes: 1 addition & 1 deletion Tests/TCADiagramLibTests/Resources/Sources.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let sources: [String] = [
"""
public let emailSignUpReducer = EmailSignUpReducer
.combine(
AnyReducer { _ in
AnyReducer<SignUpAgreement.State, SignUpAgreement.Action, Void> { _ in
SignUpAgreement()
}
.pullback(
Expand Down

0 comments on commit 581ccef

Please sign in to comment.