Bug 19142 – ddoc inline code see # as a warning

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2018-08-05T22:54:17Z
Last change time
2018-08-06T00:57:59Z
Assigned to
No Owner
Creator
Ali Ak

Comments

Comment #0 by ali.akhtarzada — 2018-08-05T22:54:17Z
import std.stdio; /** ----- rdmd -unittest ut.d # run all tests rdmd -unittest ut.d tests.foo tests.bar # run all tests from these packages rdmd ut.d -h # list command-line options ----- */ void main() { writeln("Hello D"); } Produces ➜ dmd -Dddocs -w code.d (1): Warning: C preprocessor directive #run is not supported (2): Warning: C preprocessor directive #run is not supported (3): Warning: C preprocessor directive #list is not supported
Comment #1 by ag0aep6g — 2018-08-06T00:57:59Z
Those code sections are for D code only [1]. DMD relies on that insofar as that it highlights the contents as D code. For that, the code goes through lexing, which gives you the warning. You can also get errors when you violate D syntax more severely (e.g., try putting a single quotation mark in there). This issue is marked as an enhancement request, but I suspect that it was meant as a bug report, stemming from a misunderstanding of what kind of code goes into code sections. So I'm closing this as invalid. DMD is working as intended and it's in line with the spec. Feel free to reopen if this is really about making code sections accept any content, not just D code. [1] https://dlang.org/spec/ddoc.html#embedded_code