-
-
Save kalkin/f0a64ff21cfbf7310d3d 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
my token tag { '%' \w+ } | |
my token id { '#' \w+ } | |
my token css-class { '.' \w+ } | |
my token level-token { ' ' } | |
my token text { .+ } | |
my rule element {<tag>?<id>?<css-class>*\s* } | |
my token line {^^ <level-token>* [<element>]* $$} | |
# ^ This hangsup the whole rakudo | |
like '%p', &line; | |
like '%p#asd', &line; | |
like '#asd', &line; | |
like '.foo', &line; | |
like '%body.asd.foo', &line; | |
like '%head#asd.foo', &line; | |
unlike '#asd#foo', &line; | |
unlike '%hear#asd#foo', &line, "Two id\'s on one element are not allowed"; | |
unlike '%head%asd.foo', &line; | |
unlike '#head#asd%foo', &line; | |
unlike ' %head', &line; | |
like ' %head', &line; | |
unlike ' %head', &line; | |
like '%body %textsdasd', &line; # <= Trying to parse this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment