Talk:Strip block comments: Difference between revisions
Content added Content deleted
(→State Machine: Full comment stripping is trickier than it appears) |
(→Badly defined task: new section) |
||
Line 44: | Line 44: | ||
And we throw out everything else. |
And we throw out everything else. |
||
== Badly defined task == |
|||
Stripping comments generally requires knowledge of the language involved. Simply taking out COMMENT_BEGIN up to COMMENT_END won't garantee what's left still conform to syntax (due to nested comment, markers being part of a literal string, etc), the only proper way is by parsing the text according the syntax, which is no doubt too much work. As an example, the C code can't strip its own source properly, which is pretty comedic. --[[User:Ledrug|Ledrug]] 06:57, 12 August 2011 (UTC) |