Strip block comments: Difference between revisions
Content added Content deleted
(New Task : Strip block comments) |
(→{{header|Perl 6}}: Added Perl 6 solution) |
||
Line 109: | Line 109: | ||
* Another comment. |
* Another comment. |
||
*/</pre> |
*/</pre> |
||
=={{header|Perl 6}}== |
|||
<lang perl6>sample().split(/ '/*' .+? '*/' /).print; |
|||
sub sample { |
|||
' /** |
|||
* Some comments |
|||
* longer comments here that we can parse. |
|||
* |
|||
* Rahoo |
|||
*/ |
|||
function subroutine() { |
|||
a = /* inline comment */ b + c ; |
|||
} |
|||
/*/ <-- triky comments */ |
|||
/** |
|||
* Another comment. |
|||
*/ |
|||
function something() { |
|||
} |
|||
'} |
|||
</lang> |
|||
Output:<pre> |
|||
function subroutine() { |
|||
a = b + c ; |
|||
} |
|||
function something() { |
|||
} |
|||
</pre> |