Closed PhilippeSigaud closed 12 years ago
I think I've just hit this issue. I'm getting a compilation error from dmd telling me that a template (generated from a parametrized rule) matches more than one template declaration.
Any chance of getting this fixed soon?
I'll do that in the 24h to come, I know what I have to do, but was away from home for a long time. Can you send me the faulty grammar please?
I'll create a test case and send it to you as soon as I arrive back home.
On Thu, Oct 4, 2012 at 11:43 PM, Philippe Sigaud notifications@github.comwrote:
I'll do that in the 24h to come, I know what I have to do, but was away from home for a long time. Can you send me the faulty grammar please?
— Reply to this email directly or view it on GitHubhttps://github.com/PhilippeSigaud/Pegged/issues/52#issuecomment-9166902.
Here's a test case that fails to compile with the 'matches more than one template declaration' error message. The test code doesn't necessarily make much sense, but it does exhibit the problem.
#!/usr/bin/env rdmd
import std.stdio;
import pegged.grammar;
mixin( grammar( `
Test:
HtmlBlockInTags <- HtmlBlockTag( 'div' )
Spaces <~ Spacechar*
Spacechar <- " " / "\t"
HtmlBlockTagOpen( Tag ) <- "<" Spaces Tag Spaces ">"
HtmlBlockTagClose( Tag ) <- "<" Spaces "/" Tag Spaces ">"
HtmlBlockTag( Tag ) <- HtmlBlockTagOpen( Tag ) HtmlBlockInTags* HtmlBlockTagClose( Tag )
`));
void main() {
auto tree = Test("<div></div>");
writeln( tree );
writeln( tree.matches );
}
I pushed a commit that should correct the problem. It was not heavily tested, though.
Does it at least pass the test case I posted here?
Just tried it and it does pass the test case and both the code I was working on when I discovered the problem. Thanks for the fix!
I'll report any other problems if I find them.
This is a'post'it' issue:
There are problems with the way parameterized rules are generated: string/TParseTree overloading does not work.