Strip block comments: Difference between revisions
→{{header|Perl 6}}: Added Perl 6 solution
(New Task : Strip block comments) |
(→{{header|Perl 6}}: Added Perl 6 solution) |
||
Line 109:
* Another comment.
*/</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>
|