grammar Code {
rule comment {
"/**" ~ "**/" $<data>=.*?
}
rule TOP {
^
<first=.comment>?
.*?
<last=.comment>?
$
}
}
say Code.parse: "/** start **/ testing";
say Code.parse: "testing/** end **/";
say Code.parse: "/** start **/testing/** end **/";
say Code.parse: "testing /** inside **/ testing";
say Code.parse: "test/** inside **/ing/** end **/";
say Code.parse: "/** start **/tes/** inside**/ting/** end **/";
say Code.parse: "testing";