# Pastebin UKBXgzyk lookatme: #use Grammar::Tracer; BEGIN $*LANG.refine_slang: 'MAIN', role P6X { #grammar XML { token p6x-word { \w+ } token p6x-attr { '=' [ | '"' ~ '"' $=.*? | "'" ~ "'" $=.*? | $=<.p6x-word> ] } token p6x-inner-tag { $=<.p6x-word> * %% <.ws> } token p6x-closing-tag($name) { '' $name } token p6x-opening-tag { '<' ~ '>' } token p6x-unique-tag { '<' ~ '/>' } token p6x-open-close-tag { :my $name; [ {$name = $}] ~ $ = [ || + $=.*? || $=.+? + $=.*? || .*? ] } token p6x-tag { || || } token p6x-xml { } token statement_control:sym { } #token TOP { } #say XML.parse: "bla
bla:
" }, role P6XActions { method statement_control:sym (Mu $/) { say $/; nextsame } } bla
bla: