Start of an actual parser.

This commit is contained in:
Ian Gulliver
2014-05-20 12:49:30 -07:00
parent 2bf3c67aa7
commit bbabf59505
2 changed files with 88 additions and 0 deletions

10
test.js
View File

@@ -0,0 +1,10 @@
test('Simple', function() {
expect(0);
var grammar = {
'rule1': [rr.Literal('=== '), rr.SingleLineText(), rr.Literal(' ===')],
'rule2': [rr.SingleLineText(), rr.Literal('=')],
};
var parser = new RecentRunes(grammar);
console.log(parser.parse('rule1', '=== bar ==='));
console.log(parser.parse('rule2', 'foo=\nbar='));
});