Swift Lexer: `func` mis-classified when following `class`

Issue #1421 new
Renfei Song
created an issue

Here is a snippet that illustrate the issue: (view the same snippet on pygments.org)

func test1() {
    print("heh")
}

public func test2() {
    print("hah")
}

private func test3() {
    print("yo")
}

class func test4() {
    print("meh")
}

public class func test5() {
    print("nah")
}

private class func test6() {
    print("hmm")
}

Expected behavior

The token func in test{4,5,6} should be treated as a keyword and thus have the same color as func in test{1,2,3}

Actual behavior

The token func in test{4,5,6} are treated as a custom type name and colored as such. The error is more obvious when using a color scheme similar to that of Xcode (see attachment).

Comments (1)

  1. Log in to comment