Anonymous user
Strip block comments: Difference between revisions
Improve definition of task with more explanatory text. Make varying the delimiters an “extra credit” extension. No change to whether existing solutions satisfy the task or not.
m (Fix spelling in the sample…) |
(Improve definition of task with more explanatory text. Make varying the delimiters an “extra credit” extension. No change to whether existing solutions satisfy the task or not.) |
||
Line 1:
{{task}}A block comment begins with a ''
'''Task:''' Strip block comments from program text (of a programming language much like classic [[C]]). Your demos should at least handle simple, non-nested and multiline block comment delimiters. The beginning delimiter is the two-character sequence “<tt>/*</tt>” and the ending delimiter is “<tt>*/</tt>”.
Sample text for striping.▼
<pre> /**▼
/**
* Some comments
* longer comments here that we can parse.
Line 19 ⟶ 20:
*/
function something() {
}
</pre>
'''Extra credit:''' Ensure that the stripping code is not hard-coded to the particular delimiters described above, but instead allows the caller to specify them. (If your language supports them, [[Optional parameters|optional parameters]] may be useful for this.)
=={{header|D}}==
|