Start of an actual parser.
This commit is contained in:
10
test.js
10
test.js
@@ -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='));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user