On Sun, Dec 6, 2015 at 5:04 PM, Dmitri Gribenko via swift-dev < swift-dev@swift.org> wrote:
Hi, > > If you're looking for a starter project in the frontend area (parser > in this case), here is one. > > https://bugs.swift.org/browse/SR-2 > > This code should be accepted, but it is rejected now: > > switch 10 { > case 10: > break > #if FOO > case 20: > break > #endif > } > > $ swiftc /tmp/a.swift > /tmp/a.swift:5:3: error: 'case' label can only appear inside a > 'switch' statement > case 20: > ^ > Quick question about this one. As mentioned in SR-2, the current grammar for switch statements [1] does not allow for compiler control statements. So, fixing this involves a grammar change. I suspect that grammar changes will require a proposal on the swift-evo list? Cheers, Meador [1] https://developer.apple.com/library/mac/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-statement
_______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev