What are "//line <file-path>:<line-number>"-styled comments?

blov · · 146 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Subj.</p> <p>Having some time dedicated to exploring <code>go/scanner</code> package have come to this thing (<code>Scanner.interpretLineComment</code> method). What is it? Where is it used? What is its particular application?</p> <hr/>**评论:**<br/><br/>dmke: <pre><p><a href="https://golang.org/cmd/compile/#hdr-Compiler_Directives" rel="nofollow">https://golang.org/cmd/compile/#hdr-Compiler_Directives</a></p> <blockquote> <p>The //line directive specifies that the source line that follows should be recorded as having come from the given file path and line number. Successive lines are recorded using increasing line numbers, until the next directive. This directive typically appears in machine-generated code, so that compilers and debuggers will show lines in the original input to the generator.</p> </blockquote></pre>
146 次点击  
加入收藏 微博
0 回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传