Needs built lib for some projects.
This commit is contained in:
parent
82e794e466
commit
2d4324d22b
|
@ -1,61 +1,35 @@
|
||||||
// Generated by CoffeeScript 1.3.1
|
// Generated by CoffeeScript 1.5.0
|
||||||
(function() {
|
(function() {
|
||||||
var ReParse,
|
var ReParse,
|
||||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||||
|
|
||||||
exports.ReParse = ReParse = (function() {
|
exports.ReParse = ReParse = (function() {
|
||||||
|
|
||||||
ReParse.name = 'ReParse';
|
|
||||||
|
|
||||||
function ReParse() {
|
function ReParse() {
|
||||||
this.chainl1 = __bind(this.chainl1, this);
|
this.chainl1 = __bind(this.chainl1, this);
|
||||||
|
|
||||||
this.chainl = __bind(this.chainl, this);
|
this.chainl = __bind(this.chainl, this);
|
||||||
|
|
||||||
this.sepEndBy1 = __bind(this.sepEndBy1, this);
|
this.sepEndBy1 = __bind(this.sepEndBy1, this);
|
||||||
|
|
||||||
this.sepEndBy = __bind(this.sepEndBy, this);
|
this.sepEndBy = __bind(this.sepEndBy, this);
|
||||||
|
|
||||||
this.endBy1 = __bind(this.endBy1, this);
|
this.endBy1 = __bind(this.endBy1, this);
|
||||||
|
|
||||||
this.endBy = __bind(this.endBy, this);
|
this.endBy = __bind(this.endBy, this);
|
||||||
|
|
||||||
this.sepBy1 = __bind(this.sepBy1, this);
|
this.sepBy1 = __bind(this.sepBy1, this);
|
||||||
|
|
||||||
this.sepBy = __bind(this.sepBy, this);
|
this.sepBy = __bind(this.sepBy, this);
|
||||||
|
|
||||||
this.many1 = __bind(this.many1, this);
|
this.many1 = __bind(this.many1, this);
|
||||||
|
|
||||||
this.many = __bind(this.many, this);
|
this.many = __bind(this.many, this);
|
||||||
|
|
||||||
this.skipWS = __bind(this.skipWS, this);
|
this.skipWS = __bind(this.skipWS, this);
|
||||||
|
|
||||||
this.skip1 = __bind(this.skip1, this);
|
this.skip1 = __bind(this.skip1, this);
|
||||||
|
|
||||||
this.skip = __bind(this.skip, this);
|
this.skip = __bind(this.skip, this);
|
||||||
|
|
||||||
this.seq = __bind(this.seq, this);
|
this.seq = __bind(this.seq, this);
|
||||||
|
|
||||||
this.choice = __bind(this.choice, this);
|
this.choice = __bind(this.choice, this);
|
||||||
|
|
||||||
this.between = __bind(this.between, this);
|
this.between = __bind(this.between, this);
|
||||||
|
|
||||||
this.option = __bind(this.option, this);
|
this.option = __bind(this.option, this);
|
||||||
|
|
||||||
this.maybe = __bind(this.maybe, this);
|
this.maybe = __bind(this.maybe, this);
|
||||||
|
this.m = __bind(this.m, this);
|
||||||
this.match = __bind(this.match, this);
|
|
||||||
|
|
||||||
this.start = __bind(this.start, this);
|
this.start = __bind(this.start, this);
|
||||||
|
|
||||||
this.produce = __bind(this.produce, this);
|
this.produce = __bind(this.produce, this);
|
||||||
|
|
||||||
this.fail = __bind(this.fail, this);
|
this.fail = __bind(this.fail, this);
|
||||||
|
|
||||||
this.eof = __bind(this.eof, this);
|
this.eof = __bind(this.eof, this);
|
||||||
|
|
||||||
this.parse = __bind(this.parse, this);
|
this.parse = __bind(this.parse, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReParse.prototype.ignorews = false;
|
ReParse.prototype.ignorews = false;
|
||||||
|
@ -77,7 +51,7 @@
|
||||||
|
|
||||||
ReParse.prototype.produce = function(method) {
|
ReParse.prototype.produce = function(method) {
|
||||||
var val;
|
var val;
|
||||||
val = method instanceof RegExp ? this.match(method) : method.call(this);
|
val = (method instanceof RegExp) || (typeof method === 'string') ? this.m(method) : method.call(this);
|
||||||
if (this.ignorews) {
|
if (this.ignorews) {
|
||||||
this.skipWS();
|
this.skipWS();
|
||||||
}
|
}
|
||||||
|
@ -101,11 +75,18 @@
|
||||||
throw new Error("Could not parse '" + this.input + "'.");
|
throw new Error("Could not parse '" + this.input + "'.");
|
||||||
};
|
};
|
||||||
|
|
||||||
ReParse.prototype.match = function(pattern, putback) {
|
ReParse.prototype.m = function(pattern, putback) {
|
||||||
var probe;
|
var probe;
|
||||||
if (putback == null) {
|
if (putback == null) {
|
||||||
putback = false;
|
putback = false;
|
||||||
}
|
}
|
||||||
|
if (typeof pattern === 'string') {
|
||||||
|
if (this.input.substr(0, pattern.length) === pattern) {
|
||||||
|
this.input = this.input.substr(pattern.length);
|
||||||
|
return pattern;
|
||||||
|
}
|
||||||
|
return this.fail();
|
||||||
|
}
|
||||||
probe = this.input.match(pattern);
|
probe = this.input.match(pattern);
|
||||||
if (!probe) {
|
if (!probe) {
|
||||||
return this.fail();
|
return this.fail();
|
||||||
|
@ -226,7 +207,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
ReParse.prototype.skipWS = function() {
|
ReParse.prototype.skipWS = function() {
|
||||||
this.match(/^\s*/);
|
this.m(/^\s*/);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue