Skip to content

Ddox: support assert to writeln rewrite#1551

Merged
wilzbach merged 2 commits intodlang:masterfrom
wilzbach:ddox-writeln-rewrite-magic
Feb 17, 2017
Merged

Ddox: support assert to writeln rewrite#1551
wilzbach merged 2 commits intodlang:masterfrom
wilzbach:ddox-writeln-rewrite-magic

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Jan 7, 2017

There's already some very naive support to rewrite assert's statements to writeln function calls for the ddoc build.
This just adds extend the RegExp for ddox.

This approach itself is pretty limited and of course it would be better to do this during compilation (e.g. as a plugin for ddox) and not via RegExp in Js. Moreover, the RegExp itself might catch some false positives and also doesn't support other common operations like equal or a plain assert.

So this is intended as temporary solution until someone has more time to invest into a proper solution.

Btw another reason which makes this complicated is that there are two code boxes (the editor and code highlighted produced by ddoc/ddox) and one can only edit the plain source code of the former. At the moment "reset" hides the editor and shows the original code from ddoc/ddox, but one could argue that there's no point in keeping this code box generated by ddoc/ddox

@wilzbach
Copy link
Contributor Author

wilzbach commented Jan 7, 2017

@andralex
Copy link
Member

This is a bit odd. But heck let's try it.

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dat regex

@andralex
Copy link
Member

conflicts please rebase

@wilzbach wilzbach force-pushed the ddox-writeln-rewrite-magic branch from 04dcb2c to 7e75b64 Compare February 15, 2017 22:11
@wilzbach
Copy link
Contributor Author

conflicts please rebase

rebased ;-)

@wilzbach
Copy link
Contributor Author

conflicts please rebase
rebased ;-)

(merging as rebased and approved)

@wilzbach wilzbach merged commit 71bd729 into dlang:master Feb 17, 2017
@wilzbach wilzbach deleted the ddox-writeln-rewrite-magic branch February 17, 2017 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants