Closed Firstbober closed 4 years ago
This works (can be tested in run.dlang.io):
/+dub.sdl:
dependency "pegged" version="~>0.4.4"
+/
import std;
import pegged.grammar;
enum PrmGram = `
Prm:
Test <- "test" Spacing identifier "\n\n"
Spacing <- :(' ' / '\t' / '\r')*
identifier <~ [a-zA-Z_] [a-zA-Z0-9_]*`;
void main()
{
mixin(grammar(PrmGram));
writeln(Prm(`test abc
`));
}
Wow, now it works! Thanks.
Hello and thanks for this awesome library! I have problem with detecting new line characters, only thing i found in docs is about Spacing but this is not much help. Code:
Parsed file:
Error:
I edited Spacing to remove dropping of new line but it doesn't help