Vote count:
0
I'm attempting to write a PEGKit grammar that will parse the following format:
* TODO title of first todo
* TODO title of second todo
Ideally, I would like it to return as one token everything after TODO
Here's the grammar that I've written so far:
todo = '*'! marker! title;
marker = 'TODO';
title = Word+
{
PKToken *tok = [self.assembly pop];
NSString *s = tok.stringValue;
[self.assembly push:s];
};
openBracket = '[';
closeBracket = ']';
number = Number;
Thanks!
asked 15 secs ago
PEGKit grammar that tokenizes multiple words
Aucun commentaire:
Enregistrer un commentaire