-
-
Save titsuki/49981e506424208b40a84e8c69909d98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Infobox::Actions { | |
method TOP($/) { make $<infobox>.made } | |
method infobox($/) { | |
make %( name => $<name>.made, propertylist => $<propertylist>.made ) | |
} | |
method name($/) { make ~$/.trim } | |
method propertylist($/) { | |
make $<property>>>.made | |
} | |
method property($/) { | |
make $<key>.made => $<value>.made | |
} | |
method key-content($/) { make $/.trim } | |
method value-content-list($/) { | |
make $<value-content>>>.made | |
} | |
method value-content($/) { # (#1) | |
my $rawtext = $<rawtext>>>.made>>.trim.grep({ $_ ne "" }); | |
make %( | |
anchortext => $<anchortext>>>.made, | |
weblink => $<weblink>>>.made, | |
rawtext => $rawtext.elems == 0 ?? $[] !! $rawtext.Array | |
); | |
} | |
method anchortext($/) { | |
make ~$/; | |
} | |
method weblink($/) { | |
make ~$/; | |
} | |
method rawtext($/) { | |
make ~$/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment