Skip to content

Commit

Permalink
Updated to 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Feb 24, 2018
1 parent a2ae313 commit a15f18f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Master

## 0.3.2

#### Fixed
- Fixed the parsing of files with anonymous functions within the public functions #15

[Commits](https://github.com/yonaskolb/Beak/compare/0.3.1...0.3.2)

## 0.3.1

#### Added
Expand Down
2 changes: 1 addition & 1 deletion Sources/BeakCore/Beak.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct BeakOptions {

public class Beak {

public let version: String = "0.3.1"
public let version: String = "0.3.2"
public let options: BeakOptions

public init(options: BeakOptions) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/BeakCore/SwiftParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public struct SwiftParser {
let publicNames = functionSignature.split(separator: "(").last!.split(separator: ":")
var index = 0
let bodyOffset = structure.int(.bodyOffset)
let params: [Function.Param] = try structure.substructure.filter { $0.kind == .varParameter && ($0.int(.offset) ?? 0) < (bodyOffset ?? 1) }.map { paramStructure in
let params: [Function.Param] = try structure.substructure.filter { $0.kind == .varParameter && ($0.int(.offset) ?? 0) < (bodyOffset ?? 1) }.map { paramStructure in
let paramName = paramStructure.string(.name) ?? ""
var name = String(publicNames[index])
var unnamed = false
Expand Down
2 changes: 1 addition & 1 deletion Tests/BeakTests/BeakTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BeakTests: XCTestCase {
}
""", parsedTo: Function(name: "topFunction", params: [
.init(name: "path", type: .string, optional: false),
]))
]))

try expectFunction("public func unnamed(_ noName: String) {}", parsedTo: Function(name: "unnamed", params: [
.init(name: "noName", type: .string, optional: false, unnamed: true),
Expand Down

0 comments on commit a15f18f

Please sign in to comment.