[swift-evolution] [Discussion]: Renaming #line, the line control statement
Brent Royal-Gordon
brent at architechies.com
Tue Feb 9 02:45:56 CST 2016
> I don't think we should make this change without also making the feature
> useful for things like gyb, which has to use its own home-brew line
> directive machinery because #line is AFAIK currently useless for any
> known application. The way it currently works you can only put the
> directive at grammatical boundaries in the program where #if would also
> work. For #if this is a feature, but for #resetfilecontext it's a bug.
Okay. Alternative syntax:
/// - Source: <line> <filename>
or
/** - Source: <line> <filename> */
In other words, make it a doc comment. Comments can go almost anywhere, and we already parse doc comments to extract documentation. Hell, in some cases, we might even be able to usefully set a column number with the inline comment syntax.
--
Brent Royal-Gordon
Architechies
More information about the swift-evolution
mailing list