-
-
Save omega/02da976d5e03b700ce3f to your computer and use it in GitHub Desktop.
Specify a rule name in a lexical variable
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 $m = m(@strings[1]); | |
ok $m, "mathced @strings[1]"; | |
is $m<paragraph>.elems, 2; | |
} | |
#is($f->convert('* list'), "\\begin{itemize}\n\\item list\n\\end{itemize}"); | |
sub m($str, $rule = 'TOP') { | |
diag("rule: $rule"); | |
my $m = JIRA::Formater::Wiki::Grammar.parse($str, :rule<$rule>); | |
return $m; | |
} | |
# this results in this: | |
# rule: TOP | |
Method '$rule' not found for invocant of class '' | |
in 'Grammar::parse' at line 6150:CORE.setting | |
in 'm' at line 40:t/wiki.t | |
in main program body at line 25:t/wiki.t | |
#### Now if I write it out, like put :rule<TOP>, it works? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment