And, of course, there is something wrong.
Code:
use v6.c;
grammar XSLTFuncDef {
TOP {
'XSLTPUBFUN' <ws>
<returnType> <ws>
'XSLTCALL' <ws>
<funcName> <wso>
'(' <params>* ');'
}
token ws { \s+ }
token wso { [ \s || \n ]* }
token returnType {
[const <ws>]? (\w+)
}
token funcName {
\w+
}
token params {
\w+ \w+,?
}
}
my $test = "XSLTPUBFUN void XSLTCALL
xsltApplyAttributeSet (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
const xmlChar *attributes);";
my $t = XSLTFuncDef.parse($test);
say $t;
Yet when I compile this, I get:
===SORRY!=== Error while compiling /home/cbwood/projects/p6-xslt/gen/parser.pl
Two terms in a row
at /home/cbwood/projects/p6-xslt/gen/parser.pl:9
------> '(' <params>*⏏ ');'