Skip to content

Instantly share code, notes, and snippets.

Created November 18, 2016 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9c7bd705b83be9610b8660643da6ee01 to your computer and use it in GitHub Desktop.
Save anonymous/9c7bd705b83be9610b8660643da6ee01 to your computer and use it in GitHub Desktop.
my token text
{
\N+
# optional additional lines of offset text
[
$$
\n
^^
$<leading-whitespace> = \h* {}
:my UInt:D $leading-whitespace = $/<leading-whitespace>.chars;
{ say '[DEBUG] $leading-whitespace: ', $leading-whitespace.perl }
\N+
]*
}
my Str $text = q:to/EOF/.trim-trailing;
line 1
line 2
line 3
line 4
EOF
say so $text ~~ &text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment