jql-parser
Version:
* Validating queries
56 lines (55 loc) • 1.98 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.List = void 0;
var Operand_1 = require("./Operand");
var separators_1 = require("./separators");
var Token_1 = require("./Token");
var List = /** @class */ (function (_super) {
__extends(List, _super);
function List() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(List.prototype, "end", {
get: function () {
var end = this.operand.end;
if (this.comma) {
end += this.comma.end;
if (this.list) {
end += this.list.end;
}
}
return end;
},
enumerable: false,
configurable: true
});
List.prototype.parse = function (input) {
this.operand = new Operand_1.Operand();
if (this.operand.parse(input)) {
this.content = input.substr(this.operand.end);
this.comma = new separators_1.Comma();
if (this.comma.parse(this.content)) {
this.list = new List();
this.content = this.content.substr(this.comma.end);
return this.list.parse(this.content);
}
return true;
}
return false;
};
return List;
}(Token_1.Token));
exports.List = List;