Bug 9640 – Add #line overload to restore natural line numbering / module name

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-03T05:46:16Z
Last change time
2024-12-13T18:04:27Z
Keywords
pull
Assigned to
No Owner
Creator
Dicebot
Moved to GitHub: dmd#17575 →

Comments

Comment #0 by public — 2013-03-03T05:46:16Z
#line is a pretty convenient tool to get better errors from string mixin's. Typical code that uses it looks like this: --- 100 #line 1 "mixin name" 101 mixin(generateSomeBigCode()); 102 #line 102 "module name" --- It works, but every time some new code is added above, line numbering will break again and there is no way to verify this from compiler. I suggest to add parameter-less #line that will restore natural line order and module name. Something like this: --- 100 #line 1 "mixin name" 101 mixin(generateSomeBigCode()); 102 #line --- That will help quite a lot in generic code maintenance.
Comment #1 by henning — 2013-08-29T14:37:48Z
Comment #2 by dkorpel — 2021-09-08T13:29:18Z
Considering there is now a -mixin flag outputting mixed in code into a file, is this still needed?
Comment #3 by robert.schadek — 2024-12-13T18:04:27Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17575 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB