<div dir="ltr">The primary use for the existing #line directive is for generated code like parser/lexer generators, right?  If so, how about #sourceline, since it represents the line number in the original source code?  I&#39;m also fine with #setline, but don&#39;t like #linenumber because it&#39;s not clear what the difference is between it and #line.<div><br></div><div>Actually, it&#39;d also be used to reset the line number back to the generated code, right?  In that case, #sourceline seems awkward, and maybe I&#39;ll just go with +1 to #setline.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 3, 2016 at 5:24 PM, Erica Sadun via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Swift Evolution SE-0028 (<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0028-modernizing-debug-identifiers.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0028-modernizing-debug-identifiers.md</a>) overloads<div>the use of #line to mean both an identifier that maps to a calling site&#39;s line number with a file and acts as part of a line control statement with the following grammar:<br><div><br><div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Helvetica,Arial,sans-serif"><span style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(128,128,128);font-style:italic">line-control-statement </span><span style="border:0px;margin:0px;outline:0px;padding:0px 0px 0px 4px;vertical-align:baseline;color:rgb(128,128,128)">→ </span><code style="border:0px;font-size:0.86em;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-family:Menlo,monospace;font-weight:600;word-wrap:break-word">#line­</code></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Helvetica,Arial,sans-serif"><a name="-1767850345_//apple_ref/doc/uid/TP40014097-CH38-NoLink_926" style="border:0px;outline:0px;padding:85px 0px 0px;vertical-align:baseline;display:block;width:0px;min-height:0px;color:rgb(0,136,204)"></a><span style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(128,128,128);font-style:italic">line-control-statement </span><span style="border:0px;margin:0px;outline:0px;padding:0px 0px 0px 4px;vertical-align:baseline;color:rgb(128,128,128)">→ </span><code style="border:0px;font-size:0.86em;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-family:Menlo,monospace;font-weight:600;word-wrap:break-word">#line­</code><span style="border:0px;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-style:italic;word-break:keep-all"><a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/line-number" style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none" target="_blank">line-number</a>­</span><span style="border:0px;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-style:italic;word-break:keep-all"><a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/file-name" style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none" target="_blank">file-name</a>­</span></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Helvetica,Arial,sans-serif"><a name="-1767850345_//apple_ref/doc/uid/TP40014097-CH38-NoLink_927" style="border:0px;outline:0px;padding:85px 0px 0px;vertical-align:baseline;display:block;width:0px;min-height:0px;color:rgb(0,136,204)"></a><span style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(128,128,128);font-style:italic">line-number </span><span style="border:0px;margin:0px;outline:0px;padding:0px 0px 0px 4px;vertical-align:baseline;color:rgb(128,128,128)">→ </span><span style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline">A decimal integer greater than zero</span></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Helvetica,Arial,sans-serif"><a name="-1767850345_//apple_ref/doc/uid/TP40014097-CH38-NoLink_928" style="border:0px;outline:0px;padding:85px 0px 0px;vertical-align:baseline;display:block;width:0px;min-height:0px;color:rgb(0,136,204)"></a><span style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(128,128,128);font-style:italic">file-name </span><span style="border:0px;margin:0px;outline:0px;padding:0px 0px 0px 4px;vertical-align:baseline;color:rgb(128,128,128)">→ </span><span style="border:0px;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-style:italic;word-break:keep-all"><a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/static-string-literal" style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none" target="_blank">static-string-literal</a>­</span></div></div></div></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Helvetica,Arial,sans-serif"><br></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline">The accepted implementation of SE-0028 disambiguates the two by requiring #line (the control statement) to appear at the first column for the time being. This is a stop-gap solution best remedied by renaming #line. </div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline"><br></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline">Chris Lattner writes, &quot;The core team isn’t thrilled with the magic “first token on a line” whitespace behavior that #line will be getting, and would like someone to start a discussion about renaming the old #line directive to something more specific and tailored to its purpose.   Once that name and syntax is settled, we can rename the directive and remove the whitespace rule.&quot;</div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline"><br></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline">I&#39;d recommend <font face="Menlo">#setline</font> or <font face="Menlo">#linenumber</font>. Starting this thread to solicit other suggestions.</div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline"><br></div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline">Best, -- E</div><div style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline"><br></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>