<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Dec 6, 2015 at 5:04 PM, Dmitri Gribenko via swift-dev <span dir="ltr">&lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt;</span> wrote:</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
If you&#39;re looking for a starter project in the frontend area (parser<br>
in this case), here is one.<br>
<br>
<a href="https://bugs.swift.org/browse/SR-2" rel="noreferrer" target="_blank">https://bugs.swift.org/browse/SR-2</a><br>
<br>
This code should be accepted, but it is rejected now:<br>
<br>
switch 10 {<br>
  case 10:<br>
    break<br>
#if FOO<br>
  case 20:<br>
    break<br>
#endif<br>
}<br>
<br>
$ swiftc /tmp/a.swift<br>
/tmp/a.swift:5:3: error: &#39;case&#39; label can only appear inside a<br>
&#39;switch&#39; statement<br>
  case 20:<br>
  ^<span class=""><font color="#888888"><br></font></span></blockquote></div><br clear="all"><div>Quick question about this one.</div><div><br></div><div>As mentioned in SR-2, the current grammar for switch</div><div>statements [1] does not allow for compiler control</div><div>statements.  So, fixing this involves a grammar</div><div>change.</div><div><br></div><div>I suspect that grammar changes will require a proposal</div><div>on the swift-evo list?<br></div><div><br></div><div>Cheers,</div><div><br></div><div>Meador</div><div><br></div><div>[1] <a href="https://developer.apple.com/library/mac/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-statement">https://developer.apple.com/library/mac/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-statement</a></div>
</div></div>