Make rules and filters public
This commit is contained in:
@@ -973,8 +973,8 @@ rr.Context.prototype.advance = function(numChars) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
rr.Parser_ = function(rules, filters) {
|
rr.Parser_ = function(rules, filters) {
|
||||||
this.rules_ = rules;
|
this.rules = rules;
|
||||||
this.filters_ = filters;
|
this.filters = filters;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -983,14 +983,14 @@ rr.Parser_ = function(rules, filters) {
|
|||||||
* @return {?Node}
|
* @return {?Node}
|
||||||
*/
|
*/
|
||||||
rr.Parser_.prototype.parseFromString = function(input) {
|
rr.Parser_.prototype.parseFromString = function(input) {
|
||||||
var context = new rr.Context(this.rules_, input);
|
var context = new rr.Context(this.rules, input);
|
||||||
var iterable = context.rules['main'].match(context);
|
var iterable = context.rules['main'].match(context);
|
||||||
var next = iterable.next();
|
var next = iterable.next();
|
||||||
if (next['done']) {
|
if (next['done']) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var rootNode = next['value']['nodes'][0];
|
var rootNode = next['value']['nodes'][0];
|
||||||
rr.ApplyFilters(rootNode, this.filters_);
|
rr.ApplyFilters(rootNode, this.filters);
|
||||||
return rootNode;
|
return rootNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user