From 78ac419c85694344abcdc181006b3b31309f5c5b Mon Sep 17 00:00:00 2001 From: shenyineng Date: Thu, 29 Dec 2016 17:48:00 +0800 Subject: [PATCH 01/39] fix issue: https://github.com/mhart/dynalite/issues/68 --- db/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/index.js b/db/index.js index 7e5ef5a..960019c 100644 --- a/db/index.js +++ b/db/index.js @@ -202,7 +202,7 @@ function validateUpdates(attributeUpdates, expressionUpdates, table) { } } } else { - actualType = attributeUpdates[attr] ? Object.keys(attributeUpdates[attr].Value)[0] : null + actualType = (attributeUpdates[attr] && attributeUpdates[attr]['Action'] != 'DELETE') ? Object.keys(attributeUpdates[attr].Value)[0] : null } if (actualType != null && actualType != type) { return validationError('One or more parameter values were invalid: ' + From 30047b2e402aa928b1a977405c3771b45256f5f2 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Thu, 29 Dec 2016 11:55:19 -0500 Subject: [PATCH 02/39] Add test for DELETE action with index --- db/index.js | 3 ++- test/updateItem.js | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/db/index.js b/db/index.js index 960019c..61d9cd9 100644 --- a/db/index.js +++ b/db/index.js @@ -202,7 +202,8 @@ function validateUpdates(attributeUpdates, expressionUpdates, table) { } } } else { - actualType = (attributeUpdates[attr] && attributeUpdates[attr]['Action'] != 'DELETE') ? Object.keys(attributeUpdates[attr].Value)[0] : null + actualType = attributeUpdates[attr] && attributeUpdates[attr].Value ? + Object.keys(attributeUpdates[attr].Value)[0] : null } if (actualType != null && actualType != type) { return validationError('One or more parameter values were invalid: ' + diff --git a/test/updateItem.js b/test/updateItem.js index fed6be9..70608fd 100644 --- a/test/updateItem.js +++ b/test/updateItem.js @@ -1183,6 +1183,26 @@ describe('updateItem', function() { }) }) + it('should delete normal values and return updated on index table', function(done) { + var key = {a: {S: helpers.randomString()}, b: {S: helpers.randomString()}}, updates = {c: {Value: {S: 'a'}}, d: {Value: {S: 'a'}}} + request(opts({TableName: helpers.testRangeTable, Key: key, AttributeUpdates: updates}), function(err, res) { + if (err) return done(err) + res.statusCode.should.equal(200) + updates.c = {Action: 'DELETE'} + request(opts({TableName: helpers.testRangeTable, Key: key, AttributeUpdates: updates, ReturnValues: 'UPDATED_NEW'}), function(err, res) { + if (err) return done(err) + res.statusCode.should.equal(200) + res.body.should.eql({Attributes: {d: {S: 'a'}}}) + request(helpers.opts('GetItem', {TableName: helpers.testRangeTable, Key: key, ConsistentRead: true}), function(err, res) { + if (err) return done(err) + res.statusCode.should.equal(200) + res.body.should.eql({Item: {a: key.a, b: key.b, d: {S: 'a'}}}) + done() + }) + }) + }) + }) + it('should delete set values and return updated new', function(done) { var key = {a: {S: helpers.randomString()}}, updates = {b: {Value: {NS: ['1', '2', '3']}}, c: {Value: {S: 'a'}}} request(opts({TableName: helpers.testHashTable, Key: key, AttributeUpdates: updates}), function(err, res) { From e510c5987cf3d3149c580c93e1d423ee13c108f7 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Thu, 29 Dec 2016 12:00:55 -0500 Subject: [PATCH 03/39] 1.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9e1929..1da4e2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynalite", - "version": "1.0.3", + "version": "1.0.4", "description": "An implementation of Amazon's DynamoDB built on LevelDB", "main": "index.js", "bin": "cli.js", From d23912166da005713fed9fb6e3428c3c9ed82ee0 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Thu, 29 Dec 2016 12:06:42 -0500 Subject: [PATCH 04/39] Update peg.js to 0.10.0 --- db/conditionParser.js | 2872 +++++++++++++++++++------------------ db/projectionParser.js | 1254 ++++++++-------- db/updateParser.js | 3068 ++++++++++++++++++++-------------------- package.json | 2 +- 4 files changed, 3679 insertions(+), 3517 deletions(-) diff --git a/db/conditionParser.js b/db/conditionParser.js index 895fd33..a09d104 100644 --- a/db/conditionParser.js +++ b/db/conditionParser.js @@ -1,372 +1,424 @@ -module.exports = (function() { - "use strict"; - - /* - * Generated by PEG.js 0.9.0. - * - * http://pegjs.org/ - */ - - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); +/* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + +"use strict"; + +function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); +} + +function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); } +} - function peg$SyntaxError(message, expected, found, location) { - this.message = message; - this.expected = expected; - this.found = found; - this.location = location; - this.name = "SyntaxError"; +peg$subclass(peg$SyntaxError, Error); - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, peg$SyntaxError); - } - } - - peg$subclass(peg$SyntaxError, Error); +peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, - function peg$parse(input) { - var options = arguments.length > 1 ? arguments[1] : {}, - parser = this, + "class": function(expectation) { + var escapedParts = "", + i; - peg$FAILED = {}, + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array + ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) + : classEscape(expectation.parts[i]); + } - peg$startRuleFunctions = { Start: peg$parseStart }, - peg$startRuleFunction = peg$parseStart, + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, - peg$c0 = function(expression) { - return checkErrors() || {expression: expression, nestedPaths: nestedPaths, pathHeads: pathHeads} - }, - peg$c1 = function(x, token, y) { - return {type: 'or', args: [x, y]} - }, - peg$c2 = function(x, y) { - return {type: 'and', args: [x, y]} - }, - peg$c3 = function(token, expr) { - return {type: 'not', args: [expr]} - }, - peg$c4 = "(", - peg$c5 = { type: "literal", value: "(", description: "\"(\"" }, - peg$c6 = ")", - peg$c7 = { type: "literal", value: ")", description: "\")\"" }, - peg$c8 = function(expr) { - checkParens(expr) - return expr - }, - peg$c9 = function(expr) { - checkConditionErrors() - return expr - }, - peg$c10 = function(x, comp, y) { - checkMisusedFunction([x, y]) - checkDistinct(comp, [x, y]) - return {type: comp, args: [x, y]} - }, - peg$c11 = function(x, y, z) { - checkMisusedFunction([x, y, z]) - checkBetweenArgs(y, z) - return {type: 'between', args: [x, y, z]} - }, - peg$c12 = function(x, token, args) { - checkMisusedFunction([x].concat(args)) - return {type: 'in', args: [x].concat(args)} - }, - peg$c13 = function(f) { - checkMisusedFunction(f) - return f - }, - peg$c14 = ">=", - peg$c15 = { type: "literal", value: ">=", description: "\">=\"" }, - peg$c16 = "<=", - peg$c17 = { type: "literal", value: "<=", description: "\"<=\"" }, - peg$c18 = "<>", - peg$c19 = { type: "literal", value: "<>", description: "\"<>\"" }, - peg$c20 = "=", - peg$c21 = { type: "literal", value: "=", description: "\"=\"" }, - peg$c22 = "<", - peg$c23 = { type: "literal", value: "<", description: "\"<\"" }, - peg$c24 = ">", - peg$c25 = { type: "literal", value: ">", description: "\">\"" }, - peg$c26 = function(op) { - checkParens(op) - return op - }, - peg$c27 = function(head, tail, args) { - checkMisusedFunction(args) - var name = head + tail.join('') - var attrType = checkFunction(name, args) - return {type: 'function', name: name, args: args, attrType: attrType} - }, - peg$c28 = ",", - peg$c29 = { type: "literal", value: ",", description: "\",\"" }, - peg$c30 = function(head, expr) { return expr }, - peg$c31 = function(head, tail) { - return [head].concat(tail) - }, - peg$c32 = "#", - peg$c33 = { type: "literal", value: "#", description: "\"#\"" }, - peg$c34 = function(head, tail) { - return resolveAttrName(head + tail.join('')) - }, - peg$c35 = ":", - peg$c36 = { type: "literal", value: ":", description: "\":\"" }, - peg$c37 = function(head, tail) { - return resolveAttrVal(head + tail.join('')) - }, - peg$c38 = "[", - peg$c39 = { type: "literal", value: "[", description: "\"[\"" }, - peg$c40 = /^[0-9]/, - peg$c41 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c42 = "]", - peg$c43 = { type: "literal", value: "]", description: "\"]\"" }, - peg$c44 = function(head, ix) { - return +(ix.join('')) - }, - peg$c45 = ".", - peg$c46 = { type: "literal", value: ".", description: "\".\"" }, - peg$c47 = function(head, prop) { - return prop - }, - peg$c48 = function(head, tail) { - var path = (Array.isArray(head) ? head : [head]).concat(tail) - if (path.length > 1) { - nestedPaths[path[0]] = true - } - pathHeads[path[0]] = true - return path - }, - peg$c49 = function(path) { - checkParens(path) - return path - }, - peg$c50 = function(head, tail) { - var name = head + tail.join('') - checkReserved(name) - return name - }, - peg$c51 = /^[a-zA-Z]/, - peg$c52 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, - peg$c53 = "_", - peg$c54 = { type: "literal", value: "_", description: "\"_\"" }, - peg$c55 = "between", - peg$c56 = { type: "literal", value: "BETWEEN", description: "\"BETWEEN\"" }, - peg$c57 = "in", - peg$c58 = { type: "literal", value: "IN", description: "\"IN\"" }, - peg$c59 = "and", - peg$c60 = { type: "literal", value: "AND", description: "\"AND\"" }, - peg$c61 = "or", - peg$c62 = { type: "literal", value: "OR", description: "\"OR\"" }, - peg$c63 = "not", - peg$c64 = { type: "literal", value: "NOT", description: "\"NOT\"" }, - peg$c65 = { type: "other", description: "whitespace" }, - peg$c66 = /^[ \t\r\n]/, - peg$c67 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" }, + any: function(expectation) { + return "any character"; + }, - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, + end: function(expectation) { + return "end of input"; + }, - peg$result; + other: function(expectation) { + return expectation.description; + } + }; - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } + function literalEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } - function text() { - return input.substring(peg$savedPos, peg$currPos); - } + function classEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/\]/g, '\\]') + .replace(/\^/g, '\\^') + .replace(/-/g, '\\-') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } - function location() { - return peg$computeLocation(peg$savedPos, peg$currPos); - } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } - function expected(description) { - throw peg$buildException( - null, - [{ type: "other", description: description }], - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); - } + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, j; - function error(message) { - throw peg$buildException( - message, - null, - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); } - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], - p, ch; + descriptions.sort(); - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; } + } + descriptions.length = j; + } - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column, - seenCR: details.seenCR - }; - - while (p < pos) { - ch = input.charAt(p); - if (ch === "\n") { - if (!details.seenCR) { details.line++; } - details.column = 1; - details.seenCR = false; - } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { - details.line++; - details.column = 1; - details.seenCR = true; - } else { - details.column++; - details.seenCR = false; - } + switch (descriptions.length) { + case 1: + return descriptions[0]; - p++; - } + case 2: + return descriptions[0] + " or " + descriptions[1]; - peg$posDetailsCache[pos] = details; - return details; - } + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; } + } - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } - return { - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; +}; + +function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + + var peg$FAILED = {}, + + peg$startRuleFunctions = { Start: peg$parseStart }, + peg$startRuleFunction = peg$parseStart, + + peg$c0 = function(expression) { + return checkErrors() || {expression: expression, nestedPaths: nestedPaths, pathHeads: pathHeads} + }, + peg$c1 = function(x, token, y) { + return {type: 'or', args: [x, y]} + }, + peg$c2 = function(x, y) { + return {type: 'and', args: [x, y]} + }, + peg$c3 = function(token, expr) { + return {type: 'not', args: [expr]} + }, + peg$c4 = "(", + peg$c5 = peg$literalExpectation("(", false), + peg$c6 = ")", + peg$c7 = peg$literalExpectation(")", false), + peg$c8 = function(expr) { + checkParens(expr) + return expr + }, + peg$c9 = function(expr) { + checkConditionErrors() + return expr + }, + peg$c10 = function(x, comp, y) { + checkMisusedFunction([x, y]) + checkDistinct(comp, [x, y]) + return {type: comp, args: [x, y]} + }, + peg$c11 = function(x, y, z) { + checkMisusedFunction([x, y, z]) + checkBetweenArgs(y, z) + return {type: 'between', args: [x, y, z]} + }, + peg$c12 = function(x, token, args) { + checkMisusedFunction([x].concat(args)) + return {type: 'in', args: [x].concat(args)} + }, + peg$c13 = function(f) { + checkMisusedFunction(f) + return f + }, + peg$c14 = ">=", + peg$c15 = peg$literalExpectation(">=", false), + peg$c16 = "<=", + peg$c17 = peg$literalExpectation("<=", false), + peg$c18 = "<>", + peg$c19 = peg$literalExpectation("<>", false), + peg$c20 = "=", + peg$c21 = peg$literalExpectation("=", false), + peg$c22 = "<", + peg$c23 = peg$literalExpectation("<", false), + peg$c24 = ">", + peg$c25 = peg$literalExpectation(">", false), + peg$c26 = function(op) { + checkParens(op) + return op + }, + peg$c27 = function(head, tail, args) { + checkMisusedFunction(args) + var name = head + tail.join('') + var attrType = checkFunction(name, args) + return {type: 'function', name: name, args: args, attrType: attrType} + }, + peg$c28 = ",", + peg$c29 = peg$literalExpectation(",", false), + peg$c30 = function(head, expr) { return expr }, + peg$c31 = function(head, tail) { + return [head].concat(tail) + }, + peg$c32 = "#", + peg$c33 = peg$literalExpectation("#", false), + peg$c34 = function(head, tail) { + return resolveAttrName(head + tail.join('')) + }, + peg$c35 = ":", + peg$c36 = peg$literalExpectation(":", false), + peg$c37 = function(head, tail) { + return resolveAttrVal(head + tail.join('')) + }, + peg$c38 = "[", + peg$c39 = peg$literalExpectation("[", false), + peg$c40 = /^[0-9]/, + peg$c41 = peg$classExpectation([["0", "9"]], false, false), + peg$c42 = "]", + peg$c43 = peg$literalExpectation("]", false), + peg$c44 = function(head, ix) { + return +(ix.join('')) + }, + peg$c45 = ".", + peg$c46 = peg$literalExpectation(".", false), + peg$c47 = function(head, prop) { + return prop + }, + peg$c48 = function(head, tail) { + var path = (Array.isArray(head) ? head : [head]).concat(tail) + if (path.length > 1) { + nestedPaths[path[0]] = true + } + pathHeads[path[0]] = true + return path + }, + peg$c49 = function(path) { + checkParens(path) + return path + }, + peg$c50 = function(head, tail) { + var name = head + tail.join('') + checkReserved(name) + return name + }, + peg$c51 = /^[a-zA-Z]/, + peg$c52 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false), + peg$c53 = "_", + peg$c54 = peg$literalExpectation("_", false), + peg$c55 = "between", + peg$c56 = peg$literalExpectation("BETWEEN", true), + peg$c57 = "in", + peg$c58 = peg$literalExpectation("IN", true), + peg$c59 = "and", + peg$c60 = peg$literalExpectation("AND", true), + peg$c61 = "or", + peg$c62 = peg$literalExpectation("OR", true), + peg$c63 = "not", + peg$c64 = peg$literalExpectation("NOT", true), + peg$c65 = peg$otherExpectation("whitespace"), + peg$c66 = /^[ \t\r\n]/, + peg$c67 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false), + + peg$currPos = 0, + peg$savedPos = 0, + peg$posDetailsCache = [{ line: 1, column: 1 }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); } - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } + function text() { + return input.substring(peg$savedPos, peg$currPos); + } - peg$maxFailExpected.push(expected); - } + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } - function peg$buildException(message, expected, found, location) { - function cleanupExpected(expected) { - var i = 1; + function expected(description, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) - expected.sort(function(a, b) { - if (a.description < b.description) { - return -1; - } else if (a.description > b.description) { - return 1; - } else { - return 0; - } - }); + throw peg$buildStructuredError( + [peg$otherExpectation(description)], + input.substring(peg$savedPos, peg$currPos), + location + ); + } - while (i < expected.length) { - if (expected[i - 1] === expected[i]) { - expected.splice(i, 1); - } else { - i++; - } - } - } + function error(message, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) - function buildMessage(expected, found) { - function stringEscape(s) { - function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } - - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\x08/g, '\\b') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\f/g, '\\f') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) - .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) - .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); - } + throw peg$buildSimpleError(message, location); + } + + function peg$literalExpectation(text, ignoreCase) { + return { type: "literal", text: text, ignoreCase: ignoreCase }; + } - var expectedDescs = new Array(expected.length), - expectedDesc, foundDesc, i; + function peg$classExpectation(parts, inverted, ignoreCase) { + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; + } - for (i = 0; i < expected.length; i++) { - expectedDescs[i] = expected[i].description; - } + function peg$anyExpectation() { + return { type: "any" }; + } - expectedDesc = expected.length > 1 - ? expectedDescs.slice(0, -1).join(", ") - + " or " - + expectedDescs[expected.length - 1] - : expectedDescs[0]; + function peg$endExpectation() { + return { type: "end" }; + } + + function peg$otherExpectation(description) { + return { type: "other", description: description }; + } - foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], p; - return "Expected " + expectedDesc + " but " + foundDesc + " found."; + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; } - if (expected !== null) { - cleanupExpected(expected); + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; } - return new peg$SyntaxError( - message !== null ? message : buildMessage(expected, found), - expected, - found, - location - ); + peg$posDetailsCache[pos] = details; + return details; } + } - function peg$parseStart() { - var s0, s1, s2, s3; + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parseOrConditionExpression(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c0(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildSimpleError(message, location) { + return new peg$SyntaxError(message, null, null, location); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError( + peg$SyntaxError.buildMessage(expected, found), + expected, + found, + location + ); + } + + function peg$parseStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseOrConditionExpression(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c0(s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -375,31 +427,31 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseOrConditionExpression() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseAndConditionExpression(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseOrToken(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseOrConditionExpression(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c1(s1, s3, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseOrConditionExpression() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseAndConditionExpression(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseOrToken(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseOrConditionExpression(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c1(s1, s3, s5); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -416,34 +468,34 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseAndConditionExpression(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseAndConditionExpression(); } - function peg$parseAndConditionExpression() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseNotConditionExpression(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseAndToken(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseAndConditionExpression(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c2(s1, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseAndConditionExpression() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseNotConditionExpression(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseAndToken(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseAndConditionExpression(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c2(s1, s5); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -460,30 +512,30 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseNotConditionExpression(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseNotConditionExpression(); } - function peg$parseNotConditionExpression() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseNotToken(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseParensConditionExpression(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c3(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseNotConditionExpression() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseNotToken(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseParensConditionExpression(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c3(s1, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -492,46 +544,46 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseParensConditionExpression(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseParensConditionExpression(); } - function peg$parseParensConditionExpression() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c4; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseOrConditionExpression(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c6; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c8(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseParensConditionExpression() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseOrConditionExpression(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c6; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c8(s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -548,40 +600,40 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseConditionExpression(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c9(s1); - } - s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseConditionExpression(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c9(s1); } - - return s0; + s0 = s1; } - function peg$parseConditionExpression() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseOperandParens(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseComparator(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseOperandParens(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s1, s3, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseConditionExpression() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parseOperandParens(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseComparator(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseOperandParens(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c10(s1, s3, s5); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -598,33 +650,33 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseOperandParens(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseBetweenToken(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseOperandParens(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseAndToken(); - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - s9 = peg$parseOperandParens(); - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c11(s1, s5, s9); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseOperandParens(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseBetweenToken(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseOperandParens(); + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseAndToken(); + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + s9 = peg$parseOperandParens(); + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c11(s1, s5, s9); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -657,45 +709,45 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseOperandParens(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseInToken(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s5 = peg$c4; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseFunctionArgumentList(); - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s9 = peg$c6; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c12(s1, s3, s7); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseOperandParens(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseInToken(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s5 = peg$c4; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseFunctionArgumentList(); + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s9 = peg$c6; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c12(s1, s3, s7); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -728,113 +780,113 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseFunction(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c13(s1); - } - s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseFunction(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c13(s1); } + s0 = s1; } } - - return s0; } - function peg$parseComparator() { - var s0; + return s0; + } + + function peg$parseComparator() { + var s0; - if (input.substr(peg$currPos, 2) === peg$c14) { - s0 = peg$c14; + if (input.substr(peg$currPos, 2) === peg$c14) { + s0 = peg$c14; + peg$currPos += 2; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c15); } + } + if (s0 === peg$FAILED) { + if (input.substr(peg$currPos, 2) === peg$c16) { + s0 = peg$c16; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c15); } + if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c16) { - s0 = peg$c16; + if (input.substr(peg$currPos, 2) === peg$c18) { + s0 = peg$c18; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c18) { - s0 = peg$c18; - peg$currPos += 2; + if (input.charCodeAt(peg$currPos) === 61) { + s0 = peg$c20; + peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } + if (peg$silentFails === 0) { peg$fail(peg$c21); } } if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s0 = peg$c20; + if (input.charCodeAt(peg$currPos) === 60) { + s0 = peg$c22; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 60) { - s0 = peg$c22; + if (input.charCodeAt(peg$currPos) === 62) { + s0 = peg$c24; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c23); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 62) { - s0 = peg$c24; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } - } + if (peg$silentFails === 0) { peg$fail(peg$c25); } } } } } } - - return s0; } - function peg$parseOperandParens() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c4; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseOperand(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c6; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c26(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseOperandParens() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseOperand(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c6; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c26(s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -851,82 +903,82 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseOperand(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } + if (s0 === peg$FAILED) { + s0 = peg$parseOperand(); + } + + return s0; + } - function peg$parseOperand() { - var s0; + function peg$parseOperand() { + var s0; - s0 = peg$parseFunction(); + s0 = peg$parseFunction(); + if (s0 === peg$FAILED) { + s0 = peg$parseExpressionAttributeValue(); if (s0 === peg$FAILED) { - s0 = peg$parseExpressionAttributeValue(); - if (s0 === peg$FAILED) { - s0 = peg$parsePathExpression(); - } + s0 = peg$parsePathExpression(); } - - return s0; } - function peg$parseFunction() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseIdentifierStart(); - if (s2 !== peg$FAILED) { - s3 = []; + function peg$parseFunction() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseIdentifierStart(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s5 = peg$c4; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseFunctionArgumentList(); - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s9 = peg$c6; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c27(s2, s3, s7); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s5 = peg$c4; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseFunctionArgumentList(); + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s9 = peg$c6; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c27(s2, s3, s7); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -959,17 +1011,57 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseFunctionArgumentList() { - var s0, s1, s2, s3, s4, s5, s6, s7; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseOperandParens(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parseFunctionArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseOperandParens(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c28; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c29); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseOperandParens(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c30(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -1004,96 +1096,56 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c28; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c29); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseOperandParens(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c30(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c31(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c31(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseExpressionAttributeName() { - var s0, s1, s2, s3, s4; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; + function peg$parseExpressionAttributeName() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 35) { + s2 = peg$c32; + peg$currPos++; } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 35) { - s2 = peg$c32; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c33); } - } - if (s2 !== peg$FAILED) { - s3 = []; + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c34(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c34(s2, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1102,47 +1154,47 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseExpressionAttributeValue() { - var s0, s1, s2, s3, s4; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; + function peg$parseExpressionAttributeValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c35; + peg$currPos++; } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c35; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } - } - if (s2 !== peg$FAILED) { - s3 = []; + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c36); } + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c37(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c37(s2, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1151,17 +1203,132 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parsePathExpression() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseGroupedPathExpression(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parsePathExpression() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parseGroupedPathExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 91) { + s5 = peg$c38; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = []; + if (peg$c40.test(input.charAt(peg$currPos))) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s8 !== peg$FAILED) { + while (s8 !== peg$FAILED) { + s7.push(s8); + if (peg$c40.test(input.charAt(peg$currPos))) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + } + } else { + s7 = peg$FAILED; + } + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s9 = peg$c42; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s9 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c44(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c45; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseIdentifier(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c47(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -1271,122 +1438,66 @@ module.exports = (function() { s3 = peg$FAILED; } } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 91) { - s5 = peg$c38; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = []; - if (peg$c40.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c41); } - } - if (s8 !== peg$FAILED) { - while (s8 !== peg$FAILED) { - s7.push(s8); - if (peg$c40.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c41); } - } - } - } else { - s7 = peg$FAILED; - } - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 93) { - s9 = peg$c42; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } - if (s9 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c44(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = peg$currPos; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c48(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseGroupedPathExpression() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$parseIdentifier(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsePathExpression(); + if (s3 !== peg$FAILED) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s5 = peg$c45; + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c6; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c46); } + if (peg$silentFails === 0) { peg$fail(peg$c7); } } if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseIdentifier(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c47(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + peg$savedPos = s0; + s1 = peg$c49(s3); + s0 = s1; } else { - peg$currPos = s3; - s3 = peg$FAILED; + peg$currPos = s0; + s0 = peg$FAILED; } } else { - peg$currPos = s3; - s3 = peg$FAILED; + peg$currPos = s0; + s0 = peg$FAILED; } + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c48(s1, s2); - s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1395,388 +1506,342 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; } - function peg$parseGroupedPathExpression() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$parseIdentifier(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c4; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } + function peg$parseIdentifier() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseIdentifierStart(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseIdentifierPart(); } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parsePathExpression(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c6; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c49(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c50(s2, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseExpressionAttributeName(); } - function peg$parseIdentifier() { - var s0, s1, s2, s3, s4; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseIdentifierStart(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c50(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseIdentifierStart() { + var s0; + + if (peg$c51.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c53; + peg$currPos++; } else { - peg$currPos = s0; s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } } - if (s0 === peg$FAILED) { - s0 = peg$parseExpressionAttributeName(); - } - - return s0; } - function peg$parseIdentifierStart() { - var s0; + return s0; + } + + function peg$parseIdentifierPart() { + var s0; - if (peg$c51.test(input.charAt(peg$currPos))) { + s0 = peg$parseIdentifierStart(); + if (s0 === peg$FAILED) { + if (peg$c40.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c41); } } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 95) { - s0 = peg$c53; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c54); } - } - } - - return s0; } - function peg$parseIdentifierPart() { - var s0; - - s0 = peg$parseIdentifierStart(); - if (s0 === peg$FAILED) { - if (peg$c40.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c41); } - } - } - - return s0; - } + return s0; + } - function peg$parseAttributePart() { - var s0; + function peg$parseAttributePart() { + var s0; - s0 = peg$parseIdentifierPart(); + s0 = peg$parseIdentifierPart(); + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 35) { + s0 = peg$c32; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 35) { - s0 = peg$c32; + if (input.charCodeAt(peg$currPos) === 58) { + s0 = peg$c35; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c33); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 58) { - s0 = peg$c35; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } - } + if (peg$silentFails === 0) { peg$fail(peg$c36); } } } - - return s0; } - function peg$parseReservedWord() { - var s0; + return s0; + } + + function peg$parseReservedWord() { + var s0; - s0 = peg$parseBetweenToken(); + s0 = peg$parseBetweenToken(); + if (s0 === peg$FAILED) { + s0 = peg$parseInToken(); if (s0 === peg$FAILED) { - s0 = peg$parseInToken(); + s0 = peg$parseAndToken(); if (s0 === peg$FAILED) { - s0 = peg$parseAndToken(); + s0 = peg$parseOrToken(); if (s0 === peg$FAILED) { - s0 = peg$parseOrToken(); - if (s0 === peg$FAILED) { - s0 = peg$parseNotToken(); - } + s0 = peg$parseNotToken(); } } } - - return s0; } - function peg$parseBetweenToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c55) { - s1 = input.substr(peg$currPos, 7); - peg$currPos += 7; + function peg$parseBetweenToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c55) { + s1 = input.substr(peg$currPos, 7); + peg$currPos += 7; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c56); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseInToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c57) { - s1 = input.substr(peg$currPos, 2); - peg$currPos += 2; + function peg$parseInToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c57) { + s1 = input.substr(peg$currPos, 2); + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c58); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseAndToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c59) { - s1 = input.substr(peg$currPos, 3); - peg$currPos += 3; + function peg$parseAndToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c59) { + s1 = input.substr(peg$currPos, 3); + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseOrToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c61) { - s1 = input.substr(peg$currPos, 2); - peg$currPos += 2; + function peg$parseOrToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c61) { + s1 = input.substr(peg$currPos, 2); + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseNotToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c63) { - s1 = input.substr(peg$currPos, 3); - peg$currPos += 3; + function peg$parseNotToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c63) { + s1 = input.substr(peg$currPos, 3); + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c64); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parse_() { - var s0, s1; + return s0; + } - peg$silentFails++; - s0 = []; + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + if (peg$c66.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + while (s1 !== peg$FAILED) { + s0.push(s1); if (peg$c66.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; @@ -1784,269 +1849,258 @@ module.exports = (function() { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c67); } } - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c66.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c67); } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } - } - - return s0; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c65); } } + return s0; + } - // Declared by PEG: input, options, parser, text(), location(), expected(), error() - var context = options.context - var attrNames = context.attrNames || {} - var attrVals = context.attrVals || {} - var unusedAttrNames = context.unusedAttrNames || {} - var unusedAttrVals = context.unusedAttrVals || {} - var isReserved = context.isReserved - var errors = Object.create(null) - var nestedPaths = Object.create(null) - var pathHeads = Object.create(null) + // Declared by PEG: input, options, parser, text(), location(), expected(), error() - function checkReserved(name) { - if (isReserved(name) && !errors.reserved) { - errors.reserved = 'Attribute name is a reserved keyword; reserved keyword: ' + name - } + var context = options.context + var attrNames = context.attrNames || {} + var attrVals = context.attrVals || {} + var unusedAttrNames = context.unusedAttrNames || {} + var unusedAttrVals = context.unusedAttrVals || {} + var isReserved = context.isReserved + var errors = Object.create(null) + var nestedPaths = Object.create(null) + var pathHeads = Object.create(null) + + function checkReserved(name) { + if (isReserved(name) && !errors.reserved) { + errors.reserved = 'Attribute name is a reserved keyword; reserved keyword: ' + name } + } - function resolveAttrName(name) { - if (errors.attrNameVal) { - return - } - if (!attrNames[name]) { - errors.attrNameVal = 'An expression attribute name used in the document path is not defined; attribute name: ' + name - return - } - delete unusedAttrNames[name] - return attrNames[name] + function resolveAttrName(name) { + if (errors.attrNameVal) { + return + } + if (!attrNames[name]) { + errors.attrNameVal = 'An expression attribute name used in the document path is not defined; attribute name: ' + name + return } + delete unusedAttrNames[name] + return attrNames[name] + } - function resolveAttrVal(name) { - if (errors.attrNameVal) { - return - } - if (!attrVals[name]) { - errors.attrNameVal = 'An expression attribute value used in expression is not defined; attribute value: ' + name - return - } - delete unusedAttrVals[name] - return attrVals[name] + function resolveAttrVal(name) { + if (errors.attrNameVal) { + return + } + if (!attrVals[name]) { + errors.attrNameVal = 'An expression attribute value used in expression is not defined; attribute value: ' + name + return } + delete unusedAttrVals[name] + return attrVals[name] + } - function checkFunction(name, args) { - if (errors.unknownFunction) { - return - } - var functions = { - attribute_exists: 1, - attribute_not_exists: 1, - attribute_type: 2, - begins_with: 2, - contains: 2, - size: 1, - } - var numOperands = functions[name] - if (numOperands == null) { - errors.unknownFunction = 'Invalid function name; function: ' + name - return - } + function checkFunction(name, args) { + if (errors.unknownFunction) { + return + } + var functions = { + attribute_exists: 1, + attribute_not_exists: 1, + attribute_type: 2, + begins_with: 2, + contains: 2, + size: 1, + } + var numOperands = functions[name] + if (numOperands == null) { + errors.unknownFunction = 'Invalid function name; function: ' + name + return + } - if (errors.operand) { - return - } - if (numOperands != args.length) { - errors.operand = 'Incorrect number of operands for operator or function; ' + - 'operator or function: ' + name + ', number of operands: ' + args.length - return - } + if (errors.operand) { + return + } + if (numOperands != args.length) { + errors.operand = 'Incorrect number of operands for operator or function; ' + + 'operator or function: ' + name + ', number of operands: ' + args.length + return + } - checkDistinct(name, args) + checkDistinct(name, args) - if (errors.function) { - return - } - switch (name) { - case 'attribute_exists': - case 'attribute_not_exists': - if (!Array.isArray(args[0])) { - errors.function = 'Operator or function requires a document path; ' + - 'operator or function: ' + name - return - } - return getType(args[1]) - case 'begins_with': - for (var i = 0; i < args.length; i++) { - var type = getType(args[i]) - if (type && type != 'S' && type != 'B') { - errors.function = 'Incorrect operand type for operator or function; ' + - 'operator or function: ' + name + ', operand type: ' + type - return - } - } - return 'BOOL' - case 'attribute_type': - var type = getType(args[1]) - if (type != 'S') { - if (type == null) type = '{NS,SS,L,BS,N,M,B,BOOL,NULL,S}' - errors.function = 'Incorrect operand type for operator or function; ' + - 'operator or function: ' + name + ', operand type: ' + type - return - } - if (!~['S', 'N', 'B', 'NULL', 'SS', 'BOOL', 'L', 'BS', 'NS', 'M'].indexOf(args[1].S)) { - errors.function = 'Invalid attribute type name found; type: ' + - args[1].S + ', valid types: {B,NULL,SS,BOOL,L,BS,N,NS,S,M}' - return - } - return 'BOOL' - case 'size': - var type = getType(args[0]) - if (~['N', 'BOOL', 'NULL'].indexOf(type)) { + if (errors.function) { + return + } + switch (name) { + case 'attribute_exists': + case 'attribute_not_exists': + if (!Array.isArray(args[0])) { + errors.function = 'Operator or function requires a document path; ' + + 'operator or function: ' + name + return + } + return getType(args[1]) + case 'begins_with': + for (var i = 0; i < args.length; i++) { + var type = getType(args[i]) + if (type && type != 'S' && type != 'B') { errors.function = 'Incorrect operand type for operator or function; ' + 'operator or function: ' + name + ', operand type: ' + type return } - return 'N' - case 'contains': - return 'BOOL' - } + } + return 'BOOL' + case 'attribute_type': + var type = getType(args[1]) + if (type != 'S') { + if (type == null) type = '{NS,SS,L,BS,N,M,B,BOOL,NULL,S}' + errors.function = 'Incorrect operand type for operator or function; ' + + 'operator or function: ' + name + ', operand type: ' + type + return + } + if (!~['S', 'N', 'B', 'NULL', 'SS', 'BOOL', 'L', 'BS', 'NS', 'M'].indexOf(args[1].S)) { + errors.function = 'Invalid attribute type name found; type: ' + + args[1].S + ', valid types: {B,NULL,SS,BOOL,L,BS,N,NS,S,M}' + return + } + return 'BOOL' + case 'size': + var type = getType(args[0]) + if (~['N', 'BOOL', 'NULL'].indexOf(type)) { + errors.function = 'Incorrect operand type for operator or function; ' + + 'operator or function: ' + name + ', operand type: ' + type + return + } + return 'N' + case 'contains': + return 'BOOL' } + } - function checkParens(expr) { - if (!errors.parens && text().indexOf('((') === 0) { - errors.parens = 'The expression has redundant parentheses;' - } + function checkParens(expr) { + if (!errors.parens && text().indexOf('((') === 0) { + errors.parens = 'The expression has redundant parentheses;' } + } - function checkMisusedFunction(args) { - if (errors.misusedFunction) { - return + function checkMisusedFunction(args) { + if (errors.misusedFunction) { + return + } + if (!Array.isArray(args)) { + if (args.name == 'size') { + errors.misusedFunction = 'The function is not allowed to be used this way in an expression; function: ' + + args.name } - if (!Array.isArray(args)) { - if (args.name == 'size') { - errors.misusedFunction = 'The function is not allowed to be used this way in an expression; function: ' + - args.name - } + return + } + for (var i = 0; i < args.length; i++) { + if (args[i] && args[i].type == 'function' && args[i].name != 'size') { + errors.misusedFunction = 'The function is not allowed to be used this way in an expression; function: ' + + args[i].name return } - for (var i = 0; i < args.length; i++) { - if (args[i] && args[i].type == 'function' && args[i].name != 'size') { - errors.misusedFunction = 'The function is not allowed to be used this way in an expression; function: ' + - args[i].name - return - } - } } + } - function checkDistinct(name, args) { - if (errors.distinct || args.length != 2 || !Array.isArray(args[0]) || !Array.isArray(args[1]) || args[0].length != args[1].length) { + function checkDistinct(name, args) { + if (errors.distinct || args.length != 2 || !Array.isArray(args[0]) || !Array.isArray(args[1]) || args[0].length != args[1].length) { + return + } + for (var i = 0; i < args[0].length; i++) { + if (args[0][i] !== args[1][i]) { return } - for (var i = 0; i < args[0].length; i++) { - if (args[0][i] !== args[1][i]) { - return - } - } - errors.distinct = 'The first operand must be distinct from the remaining operands for this operator or function; operator: ' + - name + ', first operand: ' + pathStr(args[0]) } + errors.distinct = 'The first operand must be distinct from the remaining operands for this operator or function; operator: ' + + name + ', first operand: ' + pathStr(args[0]) + } - function checkBetweenArgs(x, y) { - if (errors.function) { - return - } - var type1 = getImmediateType(x) - var type2 = getImmediateType(y) - if (type1 && type2) { - if (type1 != type2) { - errors.function = 'The BETWEEN operator requires same data type for lower and upper bounds; ' + - 'lower bound operand: AttributeValue: {' + type1 + ':' + x[type1] + '}, ' + - 'upper bound operand: AttributeValue: {' + type2 + ':' + y[type2] + '}' - } else if (context.compare('GT', x, y)) { - errors.function = 'The BETWEEN operator requires upper bound to be greater than or equal to lower bound; ' + - 'lower bound operand: AttributeValue: {' + type1 + ':' + x[type1] + '}, ' + - 'upper bound operand: AttributeValue: {' + type2 + ':' + y[type2] + '}' - } + function checkBetweenArgs(x, y) { + if (errors.function) { + return + } + var type1 = getImmediateType(x) + var type2 = getImmediateType(y) + if (type1 && type2) { + if (type1 != type2) { + errors.function = 'The BETWEEN operator requires same data type for lower and upper bounds; ' + + 'lower bound operand: AttributeValue: {' + type1 + ':' + x[type1] + '}, ' + + 'upper bound operand: AttributeValue: {' + type2 + ':' + y[type2] + '}' + } else if (context.compare('GT', x, y)) { + errors.function = 'The BETWEEN operator requires upper bound to be greater than or equal to lower bound; ' + + 'lower bound operand: AttributeValue: {' + type1 + ':' + x[type1] + '}, ' + + 'upper bound operand: AttributeValue: {' + type2 + ':' + y[type2] + '}' } } + } - function pathStr(path) { - return '[' + path.map(function(piece) { - return typeof piece == 'number' ? '[' + piece + ']' : piece - }).join(', ') + ']' - } + function pathStr(path) { + return '[' + path.map(function(piece) { + return typeof piece == 'number' ? '[' + piece + ']' : piece + }).join(', ') + ']' + } - function getType(val) { - if (!val || typeof val != 'object' || Array.isArray(val)) return null - if (val.attrType) return val.attrType - return getImmediateType(val) - } + function getType(val) { + if (!val || typeof val != 'object' || Array.isArray(val)) return null + if (val.attrType) return val.attrType + return getImmediateType(val) + } - function getImmediateType(val) { - if (!val || typeof val != 'object' || Array.isArray(val) || val.attrType) return null - var types = ['S', 'N', 'B', 'NULL', 'BOOL', 'SS', 'NS', 'BS', 'L', 'M'] - for (var i = 0; i < types.length; i++) { - if (val[types[i]] != null) return types[i] - } - return null + function getImmediateType(val) { + if (!val || typeof val != 'object' || Array.isArray(val) || val.attrType) return null + var types = ['S', 'N', 'B', 'NULL', 'BOOL', 'SS', 'NS', 'BS', 'L', 'M'] + for (var i = 0; i < types.length; i++) { + if (val[types[i]] != null) return types[i] } + return null + } - function checkConditionErrors() { - if (errors.condition) { + function checkConditionErrors() { + if (errors.condition) { + return + } + var errorOrder = ['attrNameVal', 'operand', 'distinct', 'function'] + for (var i = 0; i < errorOrder.length; i++) { + if (errors[errorOrder[i]]) { + errors.condition = errors[errorOrder[i]] return } - var errorOrder = ['attrNameVal', 'operand', 'distinct', 'function'] - for (var i = 0; i < errorOrder.length; i++) { - if (errors[errorOrder[i]]) { - errors.condition = errors[errorOrder[i]] - return - } - } } + } - function checkErrors() { - var errorOrder = ['parens', 'unknownFunction', 'misusedFunction', 'reserved', 'condition'] - for (var i = 0; i < errorOrder.length; i++) { - if (errors[errorOrder[i]]) return errors[errorOrder[i]] - } - return null + function checkErrors() { + var errorOrder = ['parens', 'unknownFunction', 'misusedFunction', 'reserved', 'condition'] + for (var i = 0; i < errorOrder.length; i++) { + if (errors[errorOrder[i]]) return errors[errorOrder[i]] } + return null + } - peg$result = peg$startRuleFunction(); - - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail({ type: "end", description: "end of input" }); - } + peg$result = peg$startRuleFunction(); - throw peg$buildException( - null, - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); } + + throw peg$buildStructuredError( + peg$maxFailExpected, + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + peg$maxFailPos < input.length + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) + ); } +} - return { - SyntaxError: peg$SyntaxError, - parse: peg$parse - }; -})(); +module.exports = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; diff --git a/db/projectionParser.js b/db/projectionParser.js index 3a7835b..4a97add 100644 --- a/db/projectionParser.js +++ b/db/projectionParser.js @@ -1,292 +1,344 @@ -module.exports = (function() { - "use strict"; - - /* - * Generated by PEG.js 0.9.0. - * - * http://pegjs.org/ - */ - - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); +/* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + +"use strict"; + +function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); +} + +function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); } +} - function peg$SyntaxError(message, expected, found, location) { - this.message = message; - this.expected = expected; - this.found = found; - this.location = location; - this.name = "SyntaxError"; +peg$subclass(peg$SyntaxError, Error); - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, peg$SyntaxError); - } - } +peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, - peg$subclass(peg$SyntaxError, Error); + "class": function(expectation) { + var escapedParts = "", + i; - function peg$parse(input) { - var options = arguments.length > 1 ? arguments[1] : {}, - parser = this, + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array + ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) + : classEscape(expectation.parts[i]); + } - peg$FAILED = {}, + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, - peg$startRuleFunctions = { Start: peg$parseStart }, - peg$startRuleFunction = peg$parseStart, + any: function(expectation) { + return "any character"; + }, - peg$c0 = function(paths) { - paths.forEach(checkPath) - return checkErrors() || {paths: paths, nestedPaths: nestedPaths} - }, - peg$c1 = ",", - peg$c2 = { type: "literal", value: ",", description: "\",\"" }, - peg$c3 = function(head, expr) { return expr }, - peg$c4 = function(head, tail) { - return [head].concat(tail) - }, - peg$c5 = { type: "other", description: "whitespace" }, - peg$c6 = /^[ \t\r\n]/, - peg$c7 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" }, - peg$c8 = function(head, tail) { - var name = head + tail.join('') - checkReserved(name) - return name - }, - peg$c9 = /^[a-zA-Z]/, - peg$c10 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, - peg$c11 = "_", - peg$c12 = { type: "literal", value: "_", description: "\"_\"" }, - peg$c13 = /^[0-9]/, - peg$c14 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c15 = "#", - peg$c16 = { type: "literal", value: "#", description: "\"#\"" }, - peg$c17 = function(head, tail) { - return resolveAttrName(head + tail.join('')) - }, - peg$c18 = "[", - peg$c19 = { type: "literal", value: "[", description: "\"[\"" }, - peg$c20 = "]", - peg$c21 = { type: "literal", value: "]", description: "\"]\"" }, - peg$c22 = function(head, ix) { - return +(ix.join('')) - }, - peg$c23 = ".", - peg$c24 = { type: "literal", value: ".", description: "\".\"" }, - peg$c25 = function(head, prop) { - return prop - }, - peg$c26 = function(head, tail) { - var path = [head].concat(tail) - if (path.length > 1) { - nestedPaths[path[0]] = true - } - return path - }, + end: function(expectation) { + return "end of input"; + }, - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, + other: function(expectation) { + return expectation.description; + } + }; - peg$result; + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } + function literalEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } + function classEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/\]/g, '\\]') + .replace(/\^/g, '\\^') + .replace(/-/g, '\\-') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } - function text() { - return input.substring(peg$savedPos, peg$currPos); - } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } - function location() { - return peg$computeLocation(peg$savedPos, peg$currPos); + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, j; + + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); } - function expected(description) { - throw peg$buildException( - null, - [{ type: "other", description: description }], - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + descriptions.length = j; } - function error(message) { - throw peg$buildException( - message, - null, - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; } + } - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], - p, ch; + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; - } + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; +}; + +function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + + var peg$FAILED = {}, + + peg$startRuleFunctions = { Start: peg$parseStart }, + peg$startRuleFunction = peg$parseStart, + + peg$c0 = function(paths) { + paths.forEach(checkPath) + return checkErrors() || {paths: paths, nestedPaths: nestedPaths} + }, + peg$c1 = ",", + peg$c2 = peg$literalExpectation(",", false), + peg$c3 = function(head, expr) { return expr }, + peg$c4 = function(head, tail) { + return [head].concat(tail) + }, + peg$c5 = peg$otherExpectation("whitespace"), + peg$c6 = /^[ \t\r\n]/, + peg$c7 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false), + peg$c8 = function(head, tail) { + var name = head + tail.join('') + checkReserved(name) + return name + }, + peg$c9 = /^[a-zA-Z]/, + peg$c10 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false), + peg$c11 = "_", + peg$c12 = peg$literalExpectation("_", false), + peg$c13 = /^[0-9]/, + peg$c14 = peg$classExpectation([["0", "9"]], false, false), + peg$c15 = "#", + peg$c16 = peg$literalExpectation("#", false), + peg$c17 = function(head, tail) { + return resolveAttrName(head + tail.join('')) + }, + peg$c18 = "[", + peg$c19 = peg$literalExpectation("[", false), + peg$c20 = "]", + peg$c21 = peg$literalExpectation("]", false), + peg$c22 = function(head, ix) { + return +(ix.join('')) + }, + peg$c23 = ".", + peg$c24 = peg$literalExpectation(".", false), + peg$c25 = function(head, prop) { + return prop + }, + peg$c26 = function(head, tail) { + var path = [head].concat(tail) + if (path.length > 1) { + nestedPaths[path[0]] = true + } + return path + }, - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column, - seenCR: details.seenCR - }; - - while (p < pos) { - ch = input.charAt(p); - if (ch === "\n") { - if (!details.seenCR) { details.line++; } - details.column = 1; - details.seenCR = false; - } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { - details.line++; - details.column = 1; - details.seenCR = true; - } else { - details.column++; - details.seenCR = false; - } + peg$currPos = 0, + peg$savedPos = 0, + peg$posDetailsCache = [{ line: 1, column: 1 }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, - p++; - } + peg$result; - peg$posDetailsCache[pos] = details; - return details; - } + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); } - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } - return { - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; - } + function text() { + return input.substring(peg$savedPos, peg$currPos); + } - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } + function expected(description, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) - peg$maxFailExpected.push(expected); - } + throw peg$buildStructuredError( + [peg$otherExpectation(description)], + input.substring(peg$savedPos, peg$currPos), + location + ); + } - function peg$buildException(message, expected, found, location) { - function cleanupExpected(expected) { - var i = 1; + function error(message, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) - expected.sort(function(a, b) { - if (a.description < b.description) { - return -1; - } else if (a.description > b.description) { - return 1; - } else { - return 0; - } - }); + throw peg$buildSimpleError(message, location); + } - while (i < expected.length) { - if (expected[i - 1] === expected[i]) { - expected.splice(i, 1); - } else { - i++; - } - } - } + function peg$literalExpectation(text, ignoreCase) { + return { type: "literal", text: text, ignoreCase: ignoreCase }; + } - function buildMessage(expected, found) { - function stringEscape(s) { - function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } - - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\x08/g, '\\b') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\f/g, '\\f') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) - .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) - .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); - } + function peg$classExpectation(parts, inverted, ignoreCase) { + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; + } - var expectedDescs = new Array(expected.length), - expectedDesc, foundDesc, i; + function peg$anyExpectation() { + return { type: "any" }; + } - for (i = 0; i < expected.length; i++) { - expectedDescs[i] = expected[i].description; - } + function peg$endExpectation() { + return { type: "end" }; + } - expectedDesc = expected.length > 1 - ? expectedDescs.slice(0, -1).join(", ") - + " or " - + expectedDescs[expected.length - 1] - : expectedDescs[0]; + function peg$otherExpectation(description) { + return { type: "other", description: description }; + } - foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], p; - return "Expected " + expectedDesc + " but " + foundDesc + " found."; + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; } - if (expected !== null) { - cleanupExpected(expected); + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; } - return new peg$SyntaxError( - message !== null ? message : buildMessage(expected, found), - expected, - found, - location - ); + peg$posDetailsCache[pos] = details; + return details; } + } - function peg$parseStart() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parsePathList(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c0(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildSimpleError(message, location) { + return new peg$SyntaxError(message, null, null, location); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError( + peg$SyntaxError.buildMessage(expected, found), + expected, + found, + location + ); + } + + function peg$parseStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parsePathList(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c0(s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -295,17 +347,57 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parsePathList() { - var s0, s1, s2, s3, s4, s5, s6, s7; + return s0; + } - s0 = peg$currPos; - s1 = peg$parsePathExpression(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parsePathList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsePathExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c1; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c2); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsePathExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c3(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -340,64 +432,37 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parsePathExpression(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c3(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c4(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c4(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parse_() { - var s0, s1; + return s0; + } + + function peg$parse_() { + var s0, s1; - peg$silentFails++; - s0 = []; + peg$silentFails++; + s0 = []; + if (peg$c6.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + while (s1 !== peg$FAILED) { + s0.push(s1); if (peg$c6.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; @@ -405,137 +470,239 @@ module.exports = (function() { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c7); } } - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c6.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - - return s0; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } } - function peg$parseIdentifier() { - var s0, s1, s2, s3; + return s0; + } + + function peg$parseIdentifier() { + var s0, s1, s2, s3; - s0 = peg$currPos; - s1 = peg$parseIdentifierStart(); - if (s1 !== peg$FAILED) { - s2 = []; + s0 = peg$currPos; + s1 = peg$parseIdentifierStart(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseIdentifierPart(); + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$parseIdentifierPart(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseIdentifierPart(); - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c8(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c8(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseExpressionAttributeName(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseExpressionAttributeName(); } - function peg$parseIdentifierStart() { - var s0; + return s0; + } + + function peg$parseIdentifierStart() { + var s0; - if (peg$c9.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); + if (peg$c9.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c11; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c10); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 95) { - s0 = peg$c11; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } + if (peg$silentFails === 0) { peg$fail(peg$c12); } } - - return s0; } - function peg$parseIdentifierPart() { - var s0; - - s0 = peg$parseIdentifierStart(); - if (s0 === peg$FAILED) { - if (peg$c13.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c14); } - } - } - - return s0; - } + return s0; + } - function peg$parseExpressionAttributeName() { - var s0, s1, s2, s3; + function peg$parseIdentifierPart() { + var s0; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c15; + s0 = peg$parseIdentifierStart(); + if (s0 === peg$FAILED) { + if (peg$c13.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); peg$currPos++; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c14); } } - if (s1 !== peg$FAILED) { - s2 = []; + } + + return s0; + } + + function peg$parseExpressionAttributeName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c15; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseIdentifierPart(); + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$parseIdentifierPart(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseIdentifierPart(); - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c17(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c17(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parsePathExpression() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseIdentifier(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parsePathExpression() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parseIdentifier(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 91) { + s5 = peg$c18; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c19); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = []; + if (peg$c13.test(input.charAt(peg$currPos))) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s8 !== peg$FAILED) { + while (s8 !== peg$FAILED) { + s7.push(s8); + if (peg$c13.test(input.charAt(peg$currPos))) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + } + } else { + s7 = peg$FAILED; + } + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s9 = peg$c20; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s9 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c22(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseIdentifier(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c25(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -645,229 +812,116 @@ module.exports = (function() { s3 = peg$FAILED; } } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 91) { - s5 = peg$c18; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = []; - if (peg$c13.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c14); } - } - if (s8 !== peg$FAILED) { - while (s8 !== peg$FAILED) { - s7.push(s8); - if (peg$c13.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c14); } - } - } - } else { - s7 = peg$FAILED; - } - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 93) { - s9 = peg$c20; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - if (s9 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c22(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s5 = peg$c23; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c24); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseIdentifier(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c25(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c26(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c26(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } + return s0; + } - // Declared by PEG: input, options, parser, text(), location(), expected(), error() - var context = options.context - var attrNames = context.attrNames || {} - var unusedAttrNames = context.unusedAttrNames || {} - var isReserved = context.isReserved - var errors = {} - var paths = [] - var nestedPaths = Object.create(null) + // Declared by PEG: input, options, parser, text(), location(), expected(), error() - function checkReserved(name) { - if (isReserved(name) && !errors.reserved) { - errors.reserved = 'Attribute name is a reserved keyword; reserved keyword: ' + name - } + var context = options.context + var attrNames = context.attrNames || {} + var unusedAttrNames = context.unusedAttrNames || {} + var isReserved = context.isReserved + var errors = {} + var paths = [] + var nestedPaths = Object.create(null) + + function checkReserved(name) { + if (isReserved(name) && !errors.reserved) { + errors.reserved = 'Attribute name is a reserved keyword; reserved keyword: ' + name } + } - function resolveAttrName(name) { - if (errors.attrNameVal) { - return - } - if (!attrNames[name]) { - errors.attrNameVal = 'An expression attribute name used in the document path is not defined; attribute name: ' + name - return - } - delete unusedAttrNames[name] - return attrNames[name] + function resolveAttrName(name) { + if (errors.attrNameVal) { + return + } + if (!attrNames[name]) { + errors.attrNameVal = 'An expression attribute name used in the document path is not defined; attribute name: ' + name + return } + delete unusedAttrNames[name] + return attrNames[name] + } - function checkPath(path) { + function checkPath(path) { + if (errors.pathOverlap) { + return + } + for (var i = 0; i < paths.length; i++) { + checkPaths(paths[i], path) if (errors.pathOverlap) { return } - for (var i = 0; i < paths.length; i++) { - checkPaths(paths[i], path) - if (errors.pathOverlap) { - return - } - } - paths.push(path) } + paths.push(path) + } - function checkPaths(path1, path2) { - for (var i = 0; i < path1.length && i < path2.length; i++) { - if (typeof path1[i] !== typeof path2[i]) { - errors.pathConflict = 'Two document paths conflict with each other; ' + - 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) - return - } - if (path1[i] !== path2[i]) return - } - if (errors.pathOverlap) { + function checkPaths(path1, path2) { + for (var i = 0; i < path1.length && i < path2.length; i++) { + if (typeof path1[i] !== typeof path2[i]) { + errors.pathConflict = 'Two document paths conflict with each other; ' + + 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) return } - errors.pathOverlap = 'Two document paths overlap with each other; ' + - 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) + if (path1[i] !== path2[i]) return } - - function pathStr(path) { - return '[' + path.map(function(piece) { - return typeof piece == 'number' ? '[' + piece + ']' : piece - }).join(', ') + ']' + if (errors.pathOverlap) { + return } + errors.pathOverlap = 'Two document paths overlap with each other; ' + + 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) + } - function checkErrors() { - var errorOrder = ['reserved', 'attrNameVal', 'pathOverlap', 'pathConflict'] - for (var i = 0; i < errorOrder.length; i++) { - if (errors[errorOrder[i]]) return errors[errorOrder[i]] - } - return null - } + function pathStr(path) { + return '[' + path.map(function(piece) { + return typeof piece == 'number' ? '[' + piece + ']' : piece + }).join(', ') + ']' + } + function checkErrors() { + var errorOrder = ['reserved', 'attrNameVal', 'pathOverlap', 'pathConflict'] + for (var i = 0; i < errorOrder.length; i++) { + if (errors[errorOrder[i]]) return errors[errorOrder[i]] + } + return null + } - peg$result = peg$startRuleFunction(); - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail({ type: "end", description: "end of input" }); - } + peg$result = peg$startRuleFunction(); - throw peg$buildException( - null, - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); } + + throw peg$buildStructuredError( + peg$maxFailExpected, + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + peg$maxFailPos < input.length + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) + ); } +} - return { - SyntaxError: peg$SyntaxError, - parse: peg$parse - }; -})(); +module.exports = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; diff --git a/db/updateParser.js b/db/updateParser.js index d96d4e6..de2e627 100644 --- a/db/updateParser.js +++ b/db/updateParser.js @@ -1,367 +1,419 @@ -module.exports = (function() { - "use strict"; - - /* - * Generated by PEG.js 0.9.0. - * - * http://pegjs.org/ - */ - - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); +/* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + +"use strict"; + +function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); +} + +function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); } +} - function peg$SyntaxError(message, expected, found, location) { - this.message = message; - this.expected = expected; - this.found = found; - this.location = location; - this.name = "SyntaxError"; +peg$subclass(peg$SyntaxError, Error); - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, peg$SyntaxError); - } - } - - peg$subclass(peg$SyntaxError, Error); +peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, - function peg$parse(input) { - var options = arguments.length > 1 ? arguments[1] : {}, - parser = this, + "class": function(expectation) { + var escapedParts = "", + i; - peg$FAILED = {}, + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array + ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) + : classEscape(expectation.parts[i]); + } - peg$startRuleFunctions = { Start: peg$parseStart }, - peg$startRuleFunction = peg$parseStart, + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, - peg$c0 = function(sections) { - return checkErrors() || {sections: sections, paths: paths, nestedPaths: nestedPaths} - }, - peg$c1 = function(head, sec) { return sec }, - peg$c2 = function(head, tail) { - return [].concat.apply(head, tail) - }, - peg$c3 = function(args) { - checkSection('SET') - return args - }, - peg$c4 = function(args) { - checkSection('REMOVE') - return args - }, - peg$c5 = function(args) { - checkSection('ADD') - return args - }, - peg$c6 = function(args) { - checkSection('DELETE') - return args - }, - peg$c7 = ",", - peg$c8 = { type: "literal", value: ",", description: "\",\"" }, - peg$c9 = function(head, expr) { return expr }, - peg$c10 = function(head, tail) { - return [head].concat(tail) - }, - peg$c11 = "=", - peg$c12 = { type: "literal", value: "=", description: "\"=\"" }, - peg$c13 = function(path, val) { - checkPath(path) - return {type: 'set', path: path, val: val, attrType: getType(val)} - }, - peg$c14 = function(path) { - checkPath(path) - return {type: 'remove', path: path} - }, - peg$c15 = function(path, val) { - checkPath(path) - var attrType = checkOperator('ADD', val) - return {type: 'add', path: path, val: val, attrType: attrType} - }, - peg$c16 = function(path, val) { - checkPath(path) - var attrType = checkOperator('DELETE', val) - return {type: 'delete', path: path, val: val, attrType: attrType} - }, - peg$c17 = "(", - peg$c18 = { type: "literal", value: "(", description: "\"(\"" }, - peg$c19 = ")", - peg$c20 = { type: "literal", value: ")", description: "\")\"" }, - peg$c21 = function(val) { return val }, - peg$c22 = "+", - peg$c23 = { type: "literal", value: "+", description: "\"+\"" }, - peg$c24 = function(arg1, arg2) { - var attrType = checkFunction('+', [arg1, arg2]) - return {type: 'add', args: [arg1, arg2], attrType: attrType} - }, - peg$c25 = "-", - peg$c26 = { type: "literal", value: "-", description: "\"-\"" }, - peg$c27 = function(arg1, arg2) { - var attrType = checkFunction('-', [arg1, arg2]) - return {type: 'subtract', args: [arg1, arg2], attrType: attrType} - }, - peg$c28 = function(op) { return op }, - peg$c29 = function(head, tail, args) { - var name = head + tail.join('') - var attrType = checkFunction(name, args) - return {type: 'function', name: name, args: args, attrType: attrType} - }, - peg$c30 = "#", - peg$c31 = { type: "literal", value: "#", description: "\"#\"" }, - peg$c32 = function(head, tail) { - return resolveAttrName(head + tail.join('')) - }, - peg$c33 = ":", - peg$c34 = { type: "literal", value: ":", description: "\":\"" }, - peg$c35 = function(head, tail) { - return resolveAttrVal(head + tail.join('')) - }, - peg$c36 = "[", - peg$c37 = { type: "literal", value: "[", description: "\"[\"" }, - peg$c38 = /^[0-9]/, - peg$c39 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c40 = "]", - peg$c41 = { type: "literal", value: "]", description: "\"]\"" }, - peg$c42 = function(head, ix) { - return +(ix.join('')) - }, - peg$c43 = ".", - peg$c44 = { type: "literal", value: ".", description: "\".\"" }, - peg$c45 = function(head, prop) { - return prop - }, - peg$c46 = function(head, tail) { - var path = [head].concat(tail) - if (path.length > 1) { - nestedPaths[path[0]] = true - } - return path - }, - peg$c47 = function(head, tail) { - var name = head + tail.join('') - checkReserved(name) - return name - }, - peg$c48 = /^[a-zA-Z]/, - peg$c49 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, - peg$c50 = "_", - peg$c51 = { type: "literal", value: "_", description: "\"_\"" }, - peg$c52 = "set", - peg$c53 = { type: "literal", value: "SET", description: "\"SET\"" }, - peg$c54 = "remove", - peg$c55 = { type: "literal", value: "REMOVE", description: "\"REMOVE\"" }, - peg$c56 = "add", - peg$c57 = { type: "literal", value: "ADD", description: "\"ADD\"" }, - peg$c58 = "delete", - peg$c59 = { type: "literal", value: "DELETE", description: "\"DELETE\"" }, - peg$c60 = { type: "other", description: "whitespace" }, - peg$c61 = /^[ \t\r\n]/, - peg$c62 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" }, + any: function(expectation) { + return "any character"; + }, - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, + end: function(expectation) { + return "end of input"; + }, - peg$result; + other: function(expectation) { + return expectation.description; + } + }; - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } + function literalEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } - function text() { - return input.substring(peg$savedPos, peg$currPos); - } + function classEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/\]/g, '\\]') + .replace(/\^/g, '\\^') + .replace(/-/g, '\\-') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } - function location() { - return peg$computeLocation(peg$savedPos, peg$currPos); - } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } - function expected(description) { - throw peg$buildException( - null, - [{ type: "other", description: description }], - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); - } + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, j; - function error(message) { - throw peg$buildException( - message, - null, - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); } - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], - p, ch; + descriptions.sort(); - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; } + } + descriptions.length = j; + } - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column, - seenCR: details.seenCR - }; - - while (p < pos) { - ch = input.charAt(p); - if (ch === "\n") { - if (!details.seenCR) { details.line++; } - details.column = 1; - details.seenCR = false; - } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { - details.line++; - details.column = 1; - details.seenCR = true; - } else { - details.column++; - details.seenCR = false; - } + switch (descriptions.length) { + case 1: + return descriptions[0]; - p++; - } + case 2: + return descriptions[0] + " or " + descriptions[1]; - peg$posDetailsCache[pos] = details; - return details; - } + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; } + } - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } - return { - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; +}; + +function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + + var peg$FAILED = {}, + + peg$startRuleFunctions = { Start: peg$parseStart }, + peg$startRuleFunction = peg$parseStart, + + peg$c0 = function(sections) { + return checkErrors() || {sections: sections, paths: paths, nestedPaths: nestedPaths} + }, + peg$c1 = function(head, sec) { return sec }, + peg$c2 = function(head, tail) { + return [].concat.apply(head, tail) + }, + peg$c3 = function(args) { + checkSection('SET') + return args + }, + peg$c4 = function(args) { + checkSection('REMOVE') + return args + }, + peg$c5 = function(args) { + checkSection('ADD') + return args + }, + peg$c6 = function(args) { + checkSection('DELETE') + return args + }, + peg$c7 = ",", + peg$c8 = peg$literalExpectation(",", false), + peg$c9 = function(head, expr) { return expr }, + peg$c10 = function(head, tail) { + return [head].concat(tail) + }, + peg$c11 = "=", + peg$c12 = peg$literalExpectation("=", false), + peg$c13 = function(path, val) { + checkPath(path) + return {type: 'set', path: path, val: val, attrType: getType(val)} + }, + peg$c14 = function(path) { + checkPath(path) + return {type: 'remove', path: path} + }, + peg$c15 = function(path, val) { + checkPath(path) + var attrType = checkOperator('ADD', val) + return {type: 'add', path: path, val: val, attrType: attrType} + }, + peg$c16 = function(path, val) { + checkPath(path) + var attrType = checkOperator('DELETE', val) + return {type: 'delete', path: path, val: val, attrType: attrType} + }, + peg$c17 = "(", + peg$c18 = peg$literalExpectation("(", false), + peg$c19 = ")", + peg$c20 = peg$literalExpectation(")", false), + peg$c21 = function(val) { return val }, + peg$c22 = "+", + peg$c23 = peg$literalExpectation("+", false), + peg$c24 = function(arg1, arg2) { + var attrType = checkFunction('+', [arg1, arg2]) + return {type: 'add', args: [arg1, arg2], attrType: attrType} + }, + peg$c25 = "-", + peg$c26 = peg$literalExpectation("-", false), + peg$c27 = function(arg1, arg2) { + var attrType = checkFunction('-', [arg1, arg2]) + return {type: 'subtract', args: [arg1, arg2], attrType: attrType} + }, + peg$c28 = function(op) { return op }, + peg$c29 = function(head, tail, args) { + var name = head + tail.join('') + var attrType = checkFunction(name, args) + return {type: 'function', name: name, args: args, attrType: attrType} + }, + peg$c30 = "#", + peg$c31 = peg$literalExpectation("#", false), + peg$c32 = function(head, tail) { + return resolveAttrName(head + tail.join('')) + }, + peg$c33 = ":", + peg$c34 = peg$literalExpectation(":", false), + peg$c35 = function(head, tail) { + return resolveAttrVal(head + tail.join('')) + }, + peg$c36 = "[", + peg$c37 = peg$literalExpectation("[", false), + peg$c38 = /^[0-9]/, + peg$c39 = peg$classExpectation([["0", "9"]], false, false), + peg$c40 = "]", + peg$c41 = peg$literalExpectation("]", false), + peg$c42 = function(head, ix) { + return +(ix.join('')) + }, + peg$c43 = ".", + peg$c44 = peg$literalExpectation(".", false), + peg$c45 = function(head, prop) { + return prop + }, + peg$c46 = function(head, tail) { + var path = [head].concat(tail) + if (path.length > 1) { + nestedPaths[path[0]] = true + } + return path + }, + peg$c47 = function(head, tail) { + var name = head + tail.join('') + checkReserved(name) + return name + }, + peg$c48 = /^[a-zA-Z]/, + peg$c49 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false), + peg$c50 = "_", + peg$c51 = peg$literalExpectation("_", false), + peg$c52 = "set", + peg$c53 = peg$literalExpectation("SET", true), + peg$c54 = "remove", + peg$c55 = peg$literalExpectation("REMOVE", true), + peg$c56 = "add", + peg$c57 = peg$literalExpectation("ADD", true), + peg$c58 = "delete", + peg$c59 = peg$literalExpectation("DELETE", true), + peg$c60 = peg$otherExpectation("whitespace"), + peg$c61 = /^[ \t\r\n]/, + peg$c62 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false), + + peg$currPos = 0, + peg$savedPos = 0, + peg$posDetailsCache = [{ line: 1, column: 1 }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); } - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } + function text() { + return input.substring(peg$savedPos, peg$currPos); + } - peg$maxFailExpected.push(expected); - } + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } - function peg$buildException(message, expected, found, location) { - function cleanupExpected(expected) { - var i = 1; + function expected(description, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) - expected.sort(function(a, b) { - if (a.description < b.description) { - return -1; - } else if (a.description > b.description) { - return 1; - } else { - return 0; - } - }); + throw peg$buildStructuredError( + [peg$otherExpectation(description)], + input.substring(peg$savedPos, peg$currPos), + location + ); + } - while (i < expected.length) { - if (expected[i - 1] === expected[i]) { - expected.splice(i, 1); - } else { - i++; - } - } - } + function error(message, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) - function buildMessage(expected, found) { - function stringEscape(s) { - function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } - - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\x08/g, '\\b') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\f/g, '\\f') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) - .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) - .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); - } + throw peg$buildSimpleError(message, location); + } + + function peg$literalExpectation(text, ignoreCase) { + return { type: "literal", text: text, ignoreCase: ignoreCase }; + } - var expectedDescs = new Array(expected.length), - expectedDesc, foundDesc, i; + function peg$classExpectation(parts, inverted, ignoreCase) { + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; + } - for (i = 0; i < expected.length; i++) { - expectedDescs[i] = expected[i].description; - } + function peg$anyExpectation() { + return { type: "any" }; + } - expectedDesc = expected.length > 1 - ? expectedDescs.slice(0, -1).join(", ") - + " or " - + expectedDescs[expected.length - 1] - : expectedDescs[0]; + function peg$endExpectation() { + return { type: "end" }; + } + + function peg$otherExpectation(description) { + return { type: "other", description: description }; + } - foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], p; - return "Expected " + expectedDesc + " but " + foundDesc + " found."; + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; } - if (expected !== null) { - cleanupExpected(expected); + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; } - return new peg$SyntaxError( - message !== null ? message : buildMessage(expected, found), - expected, - found, - location - ); + peg$posDetailsCache[pos] = details; + return details; } + } - function peg$parseStart() { - var s0, s1, s2, s3; + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parseSectionList(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c0(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildSimpleError(message, location) { + return new peg$SyntaxError(message, null, null, location); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError( + peg$SyntaxError.buildMessage(expected, found), + expected, + found, + location + ); + } + + function peg$parseStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseSectionList(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c0(s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -370,17 +422,39 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseSectionList() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseSection(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parseSectionList() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseSection(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseSection(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c1(s1, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -397,28 +471,35 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseSection(); - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c1(s1, s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c2(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseSection() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseSetToken(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseSetArgumentList(); + if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c2(s1, s2); + s1 = peg$c3(s3); s0 = s1; } else { peg$currPos = s0; @@ -428,22 +509,20 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - - function peg$parseSection() { - var s0, s1, s2, s3; - + if (s0 === peg$FAILED) { s0 = peg$currPos; - s1 = peg$parseSetToken(); + s1 = peg$parseRemoveToken(); if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { - s3 = peg$parseSetArgumentList(); + s3 = peg$parseRemoveArgumentList(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c3(s3); + s1 = peg$c4(s3); s0 = s1; } else { peg$currPos = s0; @@ -459,14 +538,14 @@ module.exports = (function() { } if (s0 === peg$FAILED) { s0 = peg$currPos; - s1 = peg$parseRemoveToken(); + s1 = peg$parseAddToken(); if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { - s3 = peg$parseRemoveArgumentList(); + s3 = peg$parseAddArgumentList(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c4(s3); + s1 = peg$c5(s3); s0 = s1; } else { peg$currPos = s0; @@ -482,14 +561,14 @@ module.exports = (function() { } if (s0 === peg$FAILED) { s0 = peg$currPos; - s1 = peg$parseAddToken(); + s1 = peg$parseDeleteToken(); if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { - s3 = peg$parseAddArgumentList(); + s3 = peg$parseDeleteArgumentList(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c5(s3); + s1 = peg$c6(s3); s0 = s1; } else { peg$currPos = s0; @@ -503,43 +582,56 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseDeleteToken(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseDeleteArgumentList(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c6(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } } } - - return s0; } - function peg$parseSetArgumentList() { - var s0, s1, s2, s3, s4, s5, s6, s7; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseSetExpression(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parseSetArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseSetExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c7; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseSetExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c9(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -574,34 +666,48 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c7; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseSetExpression(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c9(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c10(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseRemoveArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseRemoveExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c7; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseRemoveExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c9(s1, s7); + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -610,30 +716,16 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s1, s2); - s0 = s1; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } - - return s0; - } - - function peg$parseRemoveArgumentList() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parseRemoveExpression(); - if (s1 !== peg$FAILED) { - s2 = []; + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -668,34 +760,48 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c7; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseRemoveExpression(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c9(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c10(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseAddArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseAddExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c7; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseAddExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c9(s1, s7); + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -704,30 +810,16 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s1, s2); - s0 = s1; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } - - return s0; - } - - function peg$parseAddArgumentList() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parseAddExpression(); - if (s1 !== peg$FAILED) { - s2 = []; + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -762,34 +854,48 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c7; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseAddExpression(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c9(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c10(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseDeleteArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseDeleteExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c7; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseDeleteExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c9(s1, s7); + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -798,30 +904,16 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s1, s2); - s0 = s1; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } - - return s0; - } - - function peg$parseDeleteArgumentList() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parseDeleteExpression(); - if (s1 !== peg$FAILED) { - s2 = []; + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -856,86 +948,46 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c7; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseDeleteExpression(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c9(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c10(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseSetExpression() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - s1 = peg$parsePathExpression(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c11; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseSetValueParens(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c13(s1, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseSetExpression() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsePathExpression(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c11; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c12); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseSetValueParens(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c13(s1, s5); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -952,41 +1004,41 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseRemoveExpression() { - var s0, s1; + return s0; + } - s0 = peg$currPos; - s1 = peg$parsePathExpression(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c14(s1); - } - s0 = s1; + function peg$parseRemoveExpression() { + var s0, s1; - return s0; + s0 = peg$currPos; + s1 = peg$parsePathExpression(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c14(s1); } + s0 = s1; - function peg$parseAddExpression() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - s1 = peg$parsePathExpression(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseExpressionAttributeValue(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c15(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseAddExpression() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsePathExpression(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseExpressionAttributeValue(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c15(s1, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -995,23 +1047,76 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseDeleteExpression() { + var s0, s1, s2, s3; - return s0; + s0 = peg$currPos; + s1 = peg$parsePathExpression(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseExpressionAttributeValue(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c16(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseDeleteExpression() { - var s0, s1, s2, s3; + return s0; + } + + function peg$parseSetValueParens() { + var s0, s1, s2, s3, s4, s5; - s0 = peg$currPos; - s1 = peg$parsePathExpression(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseExpressionAttributeValue(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c16(s1, s3); - s0 = s1; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseSetValue(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c19; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c21(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1024,43 +1129,40 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseSetValue(); } - function peg$parseSetValueParens() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c17; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseSetValue(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c19; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c20); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c21(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseSetValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseOperandParens(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s3 = peg$c22; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parseOperandParens(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c24(s1, s5); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1077,27 +1179,22 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseSetValue(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - - function peg$parseSetValue() { - var s0, s1, s2, s3, s4, s5; - + if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseOperandParens(); if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 43) { - s3 = peg$c22; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c25; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c23); } + if (peg$silentFails === 0) { peg$fail(peg$c26); } } if (s3 !== peg$FAILED) { s4 = peg$parse_(); @@ -1105,7 +1202,7 @@ module.exports = (function() { s5 = peg$parseOperandParens(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c24(s1, s5); + s1 = peg$c27(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -1128,87 +1225,42 @@ module.exports = (function() { s0 = peg$FAILED; } if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseOperandParens(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 45) { - s3 = peg$c25; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c26); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseOperandParens(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c27(s1, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parseOperandParens(); - } + s0 = peg$parseOperandParens(); } - - return s0; } - function peg$parseOperandParens() { - var s0, s1, s2, s3, s4, s5; + return s0; + } - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c17; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseOperand(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c19; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c20); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c28(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + function peg$parseOperandParens() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseOperand(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c19; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c28(s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1225,82 +1277,82 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseOperand(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$parseOperand(); } - function peg$parseOperand() { - var s0; + return s0; + } + + function peg$parseOperand() { + var s0; - s0 = peg$parseFunction(); + s0 = peg$parseFunction(); + if (s0 === peg$FAILED) { + s0 = peg$parseExpressionAttributeValue(); if (s0 === peg$FAILED) { - s0 = peg$parseExpressionAttributeValue(); - if (s0 === peg$FAILED) { - s0 = peg$parsePathExpression(); - } + s0 = peg$parsePathExpression(); } - - return s0; } - function peg$parseFunction() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseIdentifierStart(); - if (s2 !== peg$FAILED) { - s3 = []; + function peg$parseFunction() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseIdentifierStart(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s5 = peg$c17; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseFunctionArgumentList(); - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s9 = peg$c19; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c20); } - } - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c29(s2, s3, s7); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseFunctionArgumentList(); + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s9 = peg$c19; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c29(s2, s3, s7); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1333,17 +1385,57 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseFunctionArgumentList() { - var s0, s1, s2, s3, s4, s5, s6, s7; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseOperandParens(); - if (s1 !== peg$FAILED) { - s2 = []; + function peg$parseFunctionArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseOperandParens(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c7; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseOperandParens(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c9(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -1378,46 +1470,55 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c7; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseOperandParens(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c9(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c10(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseExpressionAttributeName() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 35) { + s2 = peg$c30; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseIdentifierPart(); } - if (s2 !== peg$FAILED) { + if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c10(s1, s2); + s1 = peg$c32(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -1427,47 +1528,47 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseExpressionAttributeName() { - var s0, s1, s2, s3, s4; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; + function peg$parseExpressionAttributeValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c33; + peg$currPos++; } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 35) { - s2 = peg$c30; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c31); } - } - if (s2 !== peg$FAILED) { - s3 = []; + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c32(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c35(s2, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1476,66 +1577,132 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseExpressionAttributeValue() { - var s0, s1, s2, s3, s4; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c33; + function peg$parsePathExpression() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parseIdentifier(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 91) { + s5 = peg$c36; peg$currPos++; } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = []; + if (peg$c38.test(input.charAt(peg$currPos))) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + if (s8 !== peg$FAILED) { + while (s8 !== peg$FAILED) { + s7.push(s8); + if (peg$c38.test(input.charAt(peg$currPos))) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + } + } else { + s7 = peg$FAILED; + } + if (s7 !== peg$FAILED) { + s8 = peg$parse_(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s9 = peg$c40; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s9 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c42(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; } - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c35(s2, s3); - s0 = s1; + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseIdentifier(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c45(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } - - return s0; - } - - function peg$parsePathExpression() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - - s0 = peg$currPos; - s1 = peg$parseIdentifier(); - if (s1 !== peg$FAILED) { - s2 = []; + while (s3 !== peg$FAILED) { + s2.push(s3); s3 = peg$currPos; s4 = peg$parse_(); if (s4 !== peg$FAILED) { @@ -1623,126 +1790,11 @@ module.exports = (function() { if (s5 !== peg$FAILED) { s6 = peg$parse_(); if (s6 !== peg$FAILED) { - s7 = peg$parseIdentifier(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c45(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 91) { - s5 = peg$c36; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c37); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = []; - if (peg$c38.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } - } - if (s8 !== peg$FAILED) { - while (s8 !== peg$FAILED) { - s7.push(s8); - if (peg$c38.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } - } - } - } else { - s7 = peg$FAILED; - } - if (s7 !== peg$FAILED) { - s8 = peg$parse_(); - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 93) { - s9 = peg$c40; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c41); } - } - if (s9 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c42(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s5 = peg$c43; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c44); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseIdentifier(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c45(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + s7 = peg$parseIdentifier(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c45(s1, s7); + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -1755,55 +1807,55 @@ module.exports = (function() { peg$currPos = s3; s3 = peg$FAILED; } + } else { + peg$currPos = s3; + s3 = peg$FAILED; } } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c46(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c46(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseIdentifier() { - var s0, s1, s2, s3, s4; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseReservedWord(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseIdentifierStart(); - if (s2 !== peg$FAILED) { - s3 = []; + function peg$parseIdentifier() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseIdentifierStart(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== peg$FAILED) { + s3.push(s4); s4 = peg$parseIdentifierPart(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseIdentifierPart(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c47(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c47(s2, s3); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1812,249 +1864,262 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$parseExpressionAttributeName(); - } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } + if (s0 === peg$FAILED) { + s0 = peg$parseExpressionAttributeName(); + } + + return s0; + } - function peg$parseIdentifierStart() { - var s0; + function peg$parseIdentifierStart() { + var s0; - if (peg$c48.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); + if (peg$c48.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c50; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 95) { - s0 = peg$c50; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } - } + if (peg$silentFails === 0) { peg$fail(peg$c51); } } - - return s0; } - function peg$parseIdentifierPart() { - var s0; + return s0; + } - s0 = peg$parseIdentifierStart(); - if (s0 === peg$FAILED) { - if (peg$c38.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } - } - } + function peg$parseIdentifierPart() { + var s0; - return s0; + s0 = peg$parseIdentifierStart(); + if (s0 === peg$FAILED) { + if (peg$c38.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } } - function peg$parseAttributePart() { - var s0; + return s0; + } + + function peg$parseAttributePart() { + var s0; - s0 = peg$parseIdentifierPart(); + s0 = peg$parseIdentifierPart(); + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 35) { + s0 = peg$c30; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 35) { - s0 = peg$c30; + if (input.charCodeAt(peg$currPos) === 58) { + s0 = peg$c33; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c31); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 58) { - s0 = peg$c33; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } - } + if (peg$silentFails === 0) { peg$fail(peg$c34); } } } - - return s0; } - function peg$parseReservedWord() { - var s0; + return s0; + } + + function peg$parseReservedWord() { + var s0; - s0 = peg$parseSetToken(); + s0 = peg$parseSetToken(); + if (s0 === peg$FAILED) { + s0 = peg$parseRemoveToken(); if (s0 === peg$FAILED) { - s0 = peg$parseRemoveToken(); + s0 = peg$parseAddToken(); if (s0 === peg$FAILED) { - s0 = peg$parseAddToken(); - if (s0 === peg$FAILED) { - s0 = peg$parseDeleteToken(); - } + s0 = peg$parseDeleteToken(); } } - - return s0; } - function peg$parseSetToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c52) { - s1 = input.substr(peg$currPos, 3); - peg$currPos += 3; + function peg$parseSetToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c52) { + s1 = input.substr(peg$currPos, 3); + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseRemoveToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c54) { - s1 = input.substr(peg$currPos, 6); - peg$currPos += 6; + function peg$parseRemoveToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c54) { + s1 = input.substr(peg$currPos, 6); + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseAddToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c56) { - s1 = input.substr(peg$currPos, 3); - peg$currPos += 3; + function peg$parseAddToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c56) { + s1 = input.substr(peg$currPos, 3); + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseDeleteToken() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c58) { - s1 = input.substr(peg$currPos, 6); - peg$currPos += 6; + function peg$parseDeleteToken() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c58) { + s1 = input.substr(peg$currPos, 6); + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseAttributePart(); + peg$silentFails--; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } + peg$currPos = s2; + s2 = peg$FAILED; } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - s3 = peg$parseAttributePart(); - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parse_() { - var s0, s1; + return s0; + } - peg$silentFails++; - s0 = []; + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + while (s1 !== peg$FAILED) { + s0.push(s1); if (peg$c61.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; @@ -2062,238 +2127,227 @@ module.exports = (function() { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c62); } } - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c61.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } - } - - return s0; } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + + return s0; + } - // Declared by PEG: input, options, parser, text(), location(), expected(), error() + // Declared by PEG: input, options, parser, text(), location(), expected(), error() - var context = options.context - var attrNames = context.attrNames || Object.create(null) - var attrVals = context.attrVals || Object.create(null) - var unusedAttrNames = context.unusedAttrNames || Object.create(null) - var unusedAttrVals = context.unusedAttrVals || Object.create(null) - var isReserved = context.isReserved - var errors = Object.create(null) - var sections = Object.create(null) - var paths = [] - var nestedPaths = Object.create(null) + var context = options.context + var attrNames = context.attrNames || Object.create(null) + var attrVals = context.attrVals || Object.create(null) + var unusedAttrNames = context.unusedAttrNames || Object.create(null) + var unusedAttrVals = context.unusedAttrVals || Object.create(null) + var isReserved = context.isReserved + var errors = Object.create(null) + var sections = Object.create(null) + var paths = [] + var nestedPaths = Object.create(null) - function checkReserved(name) { - if (isReserved(name) && !errors.reserved) { - errors.reserved = 'Attribute name is a reserved keyword; reserved keyword: ' + name - } + function checkReserved(name) { + if (isReserved(name) && !errors.reserved) { + errors.reserved = 'Attribute name is a reserved keyword; reserved keyword: ' + name } + } - function checkFunction(name, args) { - if (errors.unknownFunction) { - return - } - var functions = { - 'if_not_exists': 2, - 'list_append': 2, - '+': 2, - '-': 2, - } - var numOperands = functions[name] - if (numOperands == null) { - errors.unknownFunction = 'Invalid function name; function: ' + name - return - } - if (errors.function) { - return - } - if (numOperands != args.length) { - errors.function = 'Incorrect number of operands for operator or function; ' + - 'operator or function: ' + name + ', number of operands: ' + args.length - return - } - switch (name) { - case 'if_not_exists': - if (!Array.isArray(args[0])) { - errors.function = 'Operator or function requires a document path; ' + - 'operator or function: ' + name + function checkFunction(name, args) { + if (errors.unknownFunction) { + return + } + var functions = { + 'if_not_exists': 2, + 'list_append': 2, + '+': 2, + '-': 2, + } + var numOperands = functions[name] + if (numOperands == null) { + errors.unknownFunction = 'Invalid function name; function: ' + name + return + } + if (errors.function) { + return + } + if (numOperands != args.length) { + errors.function = 'Incorrect number of operands for operator or function; ' + + 'operator or function: ' + name + ', number of operands: ' + args.length + return + } + switch (name) { + case 'if_not_exists': + if (!Array.isArray(args[0])) { + errors.function = 'Operator or function requires a document path; ' + + 'operator or function: ' + name + return + } + return getType(args[1]) + case 'list_append': + for (var i = 0; i < args.length; i++) { + var type = getImmediateType(args[i]) + if (type && type != 'L') { + errors.function = 'Incorrect operand type for operator or function; ' + + 'operator or function: ' + name + ', operand type: ' + type return } - return getType(args[1]) - case 'list_append': - for (var i = 0; i < args.length; i++) { - var type = getImmediateType(args[i]) - if (type && type != 'L') { - errors.function = 'Incorrect operand type for operator or function; ' + - 'operator or function: ' + name + ', operand type: ' + type - return - } - } - return 'L' - case '+': - case '-': - for (var i = 0; i < args.length; i++) { - var type = getImmediateType(args[i]) - if (type && type != 'N') { - errors.function = 'Incorrect operand type for operator or function; ' + - 'operator or function: ' + name + ', operand type: ' + type - return - } + } + return 'L' + case '+': + case '-': + for (var i = 0; i < args.length; i++) { + var type = getImmediateType(args[i]) + if (type && type != 'N') { + errors.function = 'Incorrect operand type for operator or function; ' + + 'operator or function: ' + name + ', operand type: ' + type + return } - return 'N' - } + } + return 'N' } + } - function checkSection(type) { - if (errors.section) { - return - } - if (sections[type]) { - errors.section = 'The "' + type + '" section can only be used once in an update expression;' - return - } - sections[type] = true + function checkSection(type) { + if (errors.section) { + return } - - function resolveAttrName(name) { - if (errors.attrName) { - return - } - if (!attrNames[name]) { - errors.attrName = 'An expression attribute name used in the document path is not defined; attribute name: ' + name - return - } - delete unusedAttrNames[name] - return attrNames[name] + if (sections[type]) { + errors.section = 'The "' + type + '" section can only be used once in an update expression;' + return } + sections[type] = true + } - function resolveAttrVal(name) { - if (errors.attrVal) { - return - } - if (!attrVals[name]) { - errors.attrVal = 'An expression attribute value used in expression is not defined; attribute value: ' + name - return - } - delete unusedAttrVals[name] - return attrVals[name] + function resolveAttrName(name) { + if (errors.attrName) { + return } + if (!attrNames[name]) { + errors.attrName = 'An expression attribute name used in the document path is not defined; attribute name: ' + name + return + } + delete unusedAttrNames[name] + return attrNames[name] + } - function checkPath(path) { - if (errors.pathOverlap || !Array.isArray(path)) { - return - } - for (var i = 0; i < paths.length; i++) { - checkPaths(paths[i], path) - if (errors.pathOverlap) { - return - } - } - paths.push(path) + function resolveAttrVal(name) { + if (errors.attrVal) { + return + } + if (!attrVals[name]) { + errors.attrVal = 'An expression attribute value used in expression is not defined; attribute value: ' + name + return } + delete unusedAttrVals[name] + return attrVals[name] + } - function checkPaths(path1, path2) { - for (var i = 0; i < path1.length && i < path2.length; i++) { - if (typeof path1[i] !== typeof path2[i]) { - errors.pathConflict = 'Two document paths conflict with each other; ' + - 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) - return - } - if (path1[i] !== path2[i]) return - } + function checkPath(path) { + if (errors.pathOverlap || !Array.isArray(path)) { + return + } + for (var i = 0; i < paths.length; i++) { + checkPaths(paths[i], path) if (errors.pathOverlap) { return } - errors.pathOverlap = 'Two document paths overlap with each other; ' + - 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) - } - - function pathStr(path) { - return '[' + path.map(function(piece) { - return typeof piece == 'number' ? '[' + piece + ']' : piece - }).join(', ') + ']' } + paths.push(path) + } - function checkOperator(operator, val) { - if (errors.operand || !val) { + function checkPaths(path1, path2) { + for (var i = 0; i < path1.length && i < path2.length; i++) { + if (typeof path1[i] !== typeof path2[i]) { + errors.pathConflict = 'Two document paths conflict with each other; ' + + 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) return } - var typeMappings = { - S: 'STRING', - N: 'NUMBER', - B: 'BINARY', - NULL: 'NULL', - BOOL: 'BOOLEAN', - L: 'LIST', - M: 'MAP', - } - var type = getImmediateType(val) - if (typeMappings[type] && !(operator == 'ADD' && type == 'N')) { - errors.operand = 'Incorrect operand type for operator or function; operator: ' + - operator + ', operand type: ' + typeMappings[type] - } - return type + if (path1[i] !== path2[i]) return } - - function getType(val) { - if (!val || typeof val != 'object' || Array.isArray(val)) return null - if (val.attrType) return val.attrType - return getImmediateType(val) + if (errors.pathOverlap) { + return } + errors.pathOverlap = 'Two document paths overlap with each other; ' + + 'must remove or rewrite one of these paths; path one: ' + pathStr(path1) + ', path two: ' + pathStr(path2) + } - function getImmediateType(val) { - if (!val || typeof val != 'object' || Array.isArray(val) || val.attrType) return null - var types = ['S', 'N', 'B', 'NULL', 'BOOL', 'SS', 'NS', 'BS', 'L', 'M'] - for (var i = 0; i < types.length; i++) { - if (val[types[i]] != null) return types[i] - } - return null - } + function pathStr(path) { + return '[' + path.map(function(piece) { + return typeof piece == 'number' ? '[' + piece + ']' : piece + }).join(', ') + ']' + } - function checkErrors() { - var errorOrder = ['reserved', 'unknownFunction', 'section', 'attrName', - 'attrVal', 'pathOverlap', 'pathConflict', 'operand', 'function'] - for (var i = 0; i < errorOrder.length; i++) { - if (errors[errorOrder[i]]) return errors[errorOrder[i]] - } - return null - } + function checkOperator(operator, val) { + if (errors.operand || !val) { + return + } + var typeMappings = { + S: 'STRING', + N: 'NUMBER', + B: 'BINARY', + NULL: 'NULL', + BOOL: 'BOOLEAN', + L: 'LIST', + M: 'MAP', + } + var type = getImmediateType(val) + if (typeMappings[type] && !(operator == 'ADD' && type == 'N')) { + errors.operand = 'Incorrect operand type for operator or function; operator: ' + + operator + ', operand type: ' + typeMappings[type] + } + return type + } + function getType(val) { + if (!val || typeof val != 'object' || Array.isArray(val)) return null + if (val.attrType) return val.attrType + return getImmediateType(val) + } - peg$result = peg$startRuleFunction(); + function getImmediateType(val) { + if (!val || typeof val != 'object' || Array.isArray(val) || val.attrType) return null + var types = ['S', 'N', 'B', 'NULL', 'BOOL', 'SS', 'NS', 'BS', 'L', 'M'] + for (var i = 0; i < types.length; i++) { + if (val[types[i]] != null) return types[i] + } + return null + } - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail({ type: "end", description: "end of input" }); + function checkErrors() { + var errorOrder = ['reserved', 'unknownFunction', 'section', 'attrName', + 'attrVal', 'pathOverlap', 'pathConflict', 'operand', 'function'] + for (var i = 0; i < errorOrder.length; i++) { + if (errors[errorOrder[i]]) return errors[errorOrder[i]] } + return null + } + - throw peg$buildException( - null, - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); } + + throw peg$buildStructuredError( + peg$maxFailExpected, + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + peg$maxFailPos < input.length + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) + ); } +} - return { - SyntaxError: peg$SyntaxError, - parse: peg$parse - }; -})(); +module.exports = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; diff --git a/package.json b/package.json index 1da4e2d..3c488e8 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "aws4": "^1.3.2", "istanbul": "^0.4.3", "mocha": "^2.4.5", - "pegjs": "^0.9.0", "should": "^8.3.1" + "pegjs": "^0.10.0", } } From 074abe9fc1a015dd4447faf84f85dcc5bc800608 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Thu, 29 Dec 2016 12:07:01 -0500 Subject: [PATCH 05/39] Update all dev deps --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3c488e8..dd9434c 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "leveldown": "^1.4.4" }, "devDependencies": { - "aws4": "^1.3.2", - "istanbul": "^0.4.3", - "mocha": "^2.4.5", - "should": "^8.3.1" + "aws4": "^1.5.0", + "istanbul": "^0.4.5", + "mocha": "^3.2.0", "pegjs": "^0.10.0", + "should": "^11.1.2" } } From efbf1babd2f5d0109b71ef570975ed2d1113a3b6 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Thu, 29 Dec 2016 12:07:57 -0500 Subject: [PATCH 06/39] Update all deps inc leveldb/levelup/etc --- package.json | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index dd9434c..76d204f 100644 --- a/package.json +++ b/package.json @@ -22,16 +22,17 @@ "author": "Michael Hart ", "license": "MIT", "dependencies": { - "async": "^1.5.2", + "async": "^2.1.4", "big.js": "^3.1.3", - "buffer-crc32": "^0.2.5", + "buffer-crc32": "^0.2.13", "lazy": "^1.0.11", - "level-sublevel": "^6.5.4", - "levelup": "^1.3.1", - "lock": "^0.1.2", - "memdown": "^1.1.2", + "level-sublevel": "^6.6.1", + "leveldown": "^1.5.1", + "levelup": "^1.3.3", + "lock": "^0.1.3", + "memdown": "^1.2.4", "minimist": "^1.2.0", - "once": "^1.3.3" + "once": "^1.4.0" }, "optionalDependencies": { "leveldown": "^1.4.4" From 86cf86902c67d16e8fb182edce9c4b9341f03860 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Thu, 29 Dec 2016 12:08:52 -0500 Subject: [PATCH 07/39] 1.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76d204f..5399ac3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynalite", - "version": "1.0.4", + "version": "1.1.0", "description": "An implementation of Amazon's DynamoDB built on LevelDB", "main": "index.js", "bin": "cli.js", From e41ee7e6ee1454c73e1a487e6354d4d81485c955 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Sat, 4 Feb 2017 21:27:46 -0500 Subject: [PATCH 08/39] Allow SIGINT to exit if we're PID 1 (as in Docker) --- cli.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli.js b/cli.js index 3489432..34e29e5 100755 --- a/cli.js +++ b/cli.js @@ -24,6 +24,9 @@ if (argv.help) { ].join('\n')) } +// If we're PID 1, eg in a docker container, SIGINT won't end the process as usual +if (process.pid == 1) process.on('SIGINT', process.exit) + var server = require('./index.js')(argv).listen(argv.port || 4567, function() { var address = server.address(), protocol = argv.ssl ? 'https' : 'http' // eslint-disable-next-line no-console From 2d41ab1561629b2ef782aac7716ec7753dd4bab1 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Sat, 4 Feb 2017 21:27:56 -0500 Subject: [PATCH 09/39] 1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5399ac3..978095c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynalite", - "version": "1.1.0", + "version": "1.1.1", "description": "An implementation of Amazon's DynamoDB built on LevelDB", "main": "index.js", "bin": "cli.js", From 0eb4fffe730d9b18cea35bafc83e4918396d308c Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Tue, 28 Feb 2017 12:21:07 -0500 Subject: [PATCH 10/39] Do not reuse item var in index insertion. Fixes #72 --- db/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/index.js b/db/index.js index 61d9cd9..12a8874 100644 --- a/db/index.js +++ b/db/index.js @@ -906,19 +906,19 @@ function updateIndexes(store, table, existingItem, item, cb) { function getIndexActions(indexes, existingItem, item, table) { var puts = [], deletes = [], tableKeys = table.KeySchema.map(function(key) { return key.AttributeName }) indexes.forEach(function(index) { - var indexKeys = index.KeySchema.map(function(key) { return key.AttributeName }), key = null + var indexKeys = index.KeySchema.map(function(key) { return key.AttributeName }), key = null, itemPieces = item if (item && indexKeys.every(function(key) { return item[key] != null })) { if (index.Projection.ProjectionType != 'ALL') { var indexAttrs = indexKeys.concat(tableKeys, index.Projection.NonKeyAttributes || []) - item = indexAttrs.reduce(function(obj, attr) { + itemPieces = indexAttrs.reduce(function(obj, attr) { obj[attr] = item[attr] return obj }, Object.create(null)) } - key = createIndexKey(item, table, index.KeySchema) - puts.push({index: index.IndexName, key: key, item: item}) + key = createIndexKey(itemPieces, table, index.KeySchema) + puts.push({index: index.IndexName, key: key, item: itemPieces}) } if (existingItem && indexKeys.every(function(key) { return existingItem[key] != null })) { From 862127b3b3cde37d5be0ef9f3982a50cdb29922f Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Tue, 28 Feb 2017 12:21:16 -0500 Subject: [PATCH 11/39] 1.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 978095c..2ac3597 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynalite", - "version": "1.1.1", + "version": "1.1.2", "description": "An implementation of Amazon's DynamoDB built on LevelDB", "main": "index.js", "bin": "cli.js", From 5c013d00ed28fb2bf815d55043b96a365d1d9151 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Wed, 1 Mar 2017 17:27:57 -0500 Subject: [PATCH 12/39] Don't supply location for memdown Otherwise memdown will use a global store and be stateful over server instantiations Fixes #75 --- db/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/index.js b/db/index.js index 12a8874..c783a15 100644 --- a/db/index.js +++ b/db/index.js @@ -45,7 +45,7 @@ function create(options) { if (options.maxItemSizeKb == null) options.maxItemSizeKb = exports.MAX_SIZE / 1024 options.maxItemSize = options.maxItemSizeKb * 1024 - var db = levelup(options.path || '/does/not/matter', options.path ? {} : {db: memdown}), + var db = levelup(options.path, options.path ? {} : {db: memdown}), sublevelDb = sublevel(db), tableDb = sublevelDb.sublevel('table', {valueEncoding: 'json'}), subDbs = Object.create(null) From 7aa897c0f416a1480beb09bdeb488a21ddbdd47c Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Wed, 1 Mar 2017 17:28:32 -0500 Subject: [PATCH 13/39] 1.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ac3597..87a00ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynalite", - "version": "1.1.2", + "version": "1.2.0", "description": "An implementation of Amazon's DynamoDB built on LevelDB", "main": "index.js", "bin": "cli.js", From 61ca991cc8f59e4bde69040ea854649c9ea31bad Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 6 Nov 2017 17:36:21 +0200 Subject: [PATCH 14/39] update and introduce trireme --- package.json | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index a3548de..a2bf5c9 100644 --- a/package.json +++ b/package.json @@ -22,29 +22,32 @@ "author": "Michael Hart ", "license": "MIT", "dependencies": { - "async": "^1.5.2", + "abstract-leveldown": "^3.0.0", + "async": "^2.1.4", "big.js": "^3.1.3", "buffer-crc32": "^0.2.13", "dateformat": "*", "lazy": "^1.0.11", - "level-sublevel": "^6.5.4", - "levelup": "^1.3.3", - "lock": "^0.1.2", - "memdown": "^1.1.2", + "level-sublevel": "^6.6.1", + "levelup": "^2.0.0", + "lock": "^0.1.3", + "memdown": "^1.2.4", "minimist": "^1.2.0", "node-stringify": "*", - "once": "^1.3.3", + "once": "^1.4.0", "pad": "*", - "winston": "*" + "winston": "*", + "trireme": "^0.9.0", + "trireme-jdbc": "^1.0.1" }, "optionalDependencies": { - "leveldown": "^1.5.0" + "leveldown": "^1.5.1" }, "devDependencies": { - "aws4": "^1.3.2", - "istanbul": "^0.4.3", - "mocha": "^2.4.5", - "pegjs": "^0.9.0", - "should": "^8.3.1" + "aws4": "^1.5.0", + "istanbul": "^0.4.5", + "mocha": "^3.2.0", + "pegjs": "^0.10.0", + "should": "^11.1.2" } } From ea40c886ca3a6b82047a0d463cfcf6864a94197b Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 6 Nov 2017 17:37:53 +0200 Subject: [PATCH 15/39] jdbcdown --- db/jdbcdown/encoding.js | 25 +++++ db/jdbcdown/index.js | 186 ++++++++++++++++++++++++++++++++++ db/jdbcdown/iterator.js | 216 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 427 insertions(+) create mode 100644 db/jdbcdown/encoding.js create mode 100644 db/jdbcdown/index.js create mode 100644 db/jdbcdown/iterator.js diff --git a/db/jdbcdown/encoding.js b/db/jdbcdown/encoding.js new file mode 100644 index 0000000..2f7eff2 --- /dev/null +++ b/db/jdbcdown/encoding.js @@ -0,0 +1,25 @@ +'use strict'; + +function encode(value, isValue) { + if (isValue && !value) { + value = new Buffer(''); + } + if (!Buffer.isBuffer(value) && typeof value !== 'string') { + value = String(value); + } + if (!Buffer.isBuffer(value)) { + value = new Buffer(value); + } + return value; +} + +function decode(value, asBuffer) { + if (asBuffer) { + return value; + } else { + return value.toString(); + } +} + +exports.encode = encode; +exports.decode = decode; \ No newline at end of file diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js new file mode 100644 index 0000000..9175d81 --- /dev/null +++ b/db/jdbcdown/index.js @@ -0,0 +1,186 @@ +'use strict'; +var jdbc = require('trireme-jdbc'); +var inherits = require('inherits'); +var AbstractLevelDOWN = require('abstract-leveldown').AbstractLevelDOWN; +var Iter = require('./iterator'); +var fs = require('fs'); +var Promise = require('bluebird'); +var url = require('url'); +// Todo: break to one meta-table for tables and separate tables for each dynamo table. +// Currently, everything is on one table +var TABLENAME = 'takipi_jdbcdown'; +var debug = require('debug')('jdbcdown'); +var util = require('./encoding'); +module.exports = JDBCdown; + +inherits(JDBCdown, AbstractLevelDOWN); + +function JDBCdown(jdbcUrl, jdbcUser, jdbcPassword) { + AbstractLevelDOWN.call(this, jdbcUrl); + + var pool = connection(jdbcUrl, jdbcUser, jdbcPassword); + this.pool = pool; + this.tablename = TABLENAME; +} + +JDBCdown.prototype._open = function(options, callback) { + this.tablename = TABLENAME; + + var tableCreateStr = 'CREATE TABLE IF NOT EXISTS ' + this.tablename + '(' + + 'K VARCHAR(3072) NOT NULL, V BLOB, PRIMARY KEY(K)) ' + + 'ENGINE=InnoDB'; + + this.pool.execute(tableCreateStr, + function(err, result) { + callback(); + }); +} + +JDBCdown.destroy = function(location, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + // unsupported so we don't accidently destory our data: + // + // this.pool.execute('drop table if exists ' + this.tableName, + // function(err, result) { + // if (err) { + // console.log("ERROR:" + err) + // }; + // callback(); + // }); +}; + + +JDBCdown.prototype._get = function(key, options, cb) { + var self = this; + var asBuffer = true; + if (options.asBuffer === false) { + asBuffer = false; + } + if (options.raw) { + asBuffer = false; + } + key = util.encode(key); + + this.pool.execute("SELECT V FROM " + this.tablename + " WHERE K = ?", [key], function(err, res, rows) { + if (err) { + return cb(err.stack); + } + if (rows === undefined) { + return cb(new Error('NotFound')); + } + if (rows.length === 0) { + return cb(new Error('NotFound')); + } + + try { + rows.forEach(function(row) { + var value = row.V; + + if (value === undefined || value === null) { + return cb(new Error('NotFound')); + } + // protoect + var decodedVal = util.decode(value, asBuffer, true); + cb(null, decodedVal); + }); + } catch (e) { + console.log(e); + cb(new Error('NotFound')); + } + }); +} + +JDBCdown.prototype._put = function(key, value, opt, cb) { + var self = this; + value = util.encode(value, true); + key = util.encode(key); + + insertHelper(this.pool, cb, key, value); +} + + +JDBCdown.prototype._del = function(key, opt, cb) { + var self = this; + key = util.encode(key); + deleteHelper(this.pool, cb, key); +} + +function unique(array) { + var things = {}; + array.forEach(function(item) { + things[item.key] = item; + }); + return Object.keys(things).map(function(key) { + return things[key]; + }); +} + +JDBCdown.prototype._batch = function(array, options, callback) { + var inserts = 0; + this.pool.beginTransaction(function(err, tran) { + return Promise.all(unique(array).map(function(item) { + var key = util.encode(item.key); + + if (item.type === 'del') { + return deleteHelper(tran, function() {}, key); + } else { + var value = util.encode(item.value, true); + inserts++; + return insertHelper(tran, function() {}, key, value); + } + })).then(function() { + tran.commit(function(err) { + if (err) { + console.log(err) + } + }); + callback(); + }); + }); +} + + +JDBCdown.prototype._close = function(callback) { + console.log('closing connection'); + this.pool.close(); +}; + +JDBCdown.prototype.iterator = function(options) { + return new Iter(this, options); +}; + +function connection(url, user, password) { + console.log('connecting...') + return new jdbc.Database({ + url: url, + properties: { + user: user, + password: password, + }, + minConnections: 1, + maxConnections: 30, + idleTimeout: 60 + }); +} + +function insertHelper(db, cb, key, value) { + db.execute("INSERT INTO " + TABLENAME + " (K, V) VALUES (?,?) ON DUPLICATE KEY UPDATE V=?", [key, value, value], function(err) { + if (err) { + console.log(err) + } + cb(); + }); +} + +function deleteHelper(db, cb, key, value) { + db.execute("DELETE FROM " + TABLENAME + " where K=?", [key], function(err) { + if (err) { + console.log(err); + } + + cb(); + }); +} \ No newline at end of file diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js new file mode 100644 index 0000000..38c1213 --- /dev/null +++ b/db/jdbcdown/iterator.js @@ -0,0 +1,216 @@ +'use strict'; +var inherits = require('inherits'); +var AbstractIterator = require('abstract-leveldown/abstract-iterator'); +var util = require('./encoding'); +var PassThrough = require('stream').PassThrough; + +function goodOptions(opts, name) { + if (!(name in opts)) { + return; + } + var thing = opts[name]; + if (thing === null) { + delete opts[name]; + return; + } + if (Buffer.isBuffer(thing) || typeof thing === 'string') { + if (!thing.length) { + delete opts[name]; + return; + } + + opts[name] = util.encode(thing); + } +} + +function Iterator(db, options, cb) { + AbstractIterator.call(this, db); + options = options || {}; + this._order = !options.reverse; + this._options = options; + names.forEach(function (i) { + goodOptions(options, i); + }); + + this._stream = new PassThrough({ + objectMode: true + }) + + this._stream.once('end', function() { + self._endEmitted = true + }) + + this._count = 0; + var self = this; + if ('limit' in options) { + this._limit = options.limit; + } else { + this._limit = -1; + } + + if ('keyAsBuffer' in options) { + this._keyAsBuffer = options.keyAsBuffer; + } else { + this._keyAsBuffer = true; + } + if ('valueAsBuffer' in options) { + this._valueAsBuffer = options.valueAsBuffer; + } else { + this._valueAsBuffer = true; + } + + var statement = this.buildSQL(); + if (this._limit === 0) { + this._next = function (cb) { + process.nextTick(cb); + }; + return; + } + + var __stream = this._stream; + + // TODO: trireme-jdbc has executeStream, which doesn't seem to work. + // best to use an actual stream, or add a limit to fetched rows + db.pool.execute(statement.sql, statement.args, + function(err, result, rows) { + var ended =false; + if ((!rows) || (rows.length == 0)) + { + __stream.end(); + } + else + { + rows.forEach(function(row) { + __stream.write(row, function(){if (ended){__stream.end();}}); + }); + } + ended = true; + }); +} + +inherits(Iterator, AbstractIterator); +module.exports = Iterator; +var names = [ + 'start', + 'end', + 'gt', + 'gte', + 'lt', + 'lte' +]; + +Iterator.prototype._next = function(callback) { + var self = this + , obj = this._stream.read() + , onReadable = function() { + self._stream.removeListener('end', onEnd) + self._next(callback) + } + , onEnd = function() { + self._stream.removeListener('readable', onReadable) + callback() + } + , key + , value + + if (this._endEmitted) + callback() + else if (obj === null) { + this._stream.once('readable', onReadable) + + this._stream.once('end', onEnd) + } + else { + key = obj.K + if (!this._keyAsBuffer) key = key.toString() + + value = obj.V + if (!this._valueAsBuffer) value = value.toString() + + callback(null, key, value) + } +} + +Iterator.prototype._end = function(callback) { + this._stream.end() + callback() +} + +Iterator.prototype.buildSQL = function () { + var self = this; + var sql = "select K, V from " + this.tableName + " where "; + var args = []; + var statement = {sql: sql, args: args}; + + if (this._order) { + if ('start' in this._options) { + if (this._options.exclusiveStart) { + if ('start' in this._options) { + this._options.gt = this._options.start; + } + } else { + if ('start' in this._options) { + this._options.gte = this._options.start; + } + } + } + if ('end' in this._options) { + this._options.lte = this._options.end; + } + } else { + if ('start' in this._options) { + if (this._options.exclusiveStart) { + if ('start' in this._options) { + this._options.lt = this._options.start; + } + } else { + if ('start' in this._options) { + this._options.lte = this._options.start; + } + } + } + if ('end' in this._options) { + this._options.gte = this._options.end; + } + } + + if ('lt' in this._options) { + appendWhere(statement, 'K <', this._options.lt); + } + if ('lte' in this._options) { + appendWhere(statement, 'K <=', this._options.lte); + } + if ('gt' in this._options) { + appendWhere(statement, 'K >', this._options.gt); + } + if ('gte' in this._options) { + appendWhere(statement, 'K >=', this._options.gte); + } + + statement.sql += " 1=1 "; + + if (this._order) { + appendOrderBy(statement, true); + } + else { + appendOrderBy(statement, false); + } + + if (this._limit > 0) { + statement.sql = statement.sql + " limit ?"; + statement.args.push(this._limit); + } + + return statement; +}; + +function appendWhere(statement, condition, appendee) +{ + statement.sql += (condition + " '" + util.decode(appendee) + "' AND "); +} + +function appendOrderBy(statement, bool) { + statement.sql += " order by K " + (bool? "ASC" : "DESC"); +} + +module.exports = Iterator; From 57a8206b6a78e114b61983a728956437956e8640 Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 6 Nov 2017 17:42:05 +0200 Subject: [PATCH 16/39] optional jdbc / leveldown --- db/index.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/db/index.js b/db/index.js index 795b53b..f982838 100644 --- a/db/index.js +++ b/db/index.js @@ -45,8 +45,22 @@ function create(options) { if (options.maxItemSizeKb == null) options.maxItemSizeKb = exports.MAX_SIZE / 1024 options.maxItemSize = options.maxItemSizeKb * 1024 - var db = levelup(options.path || '/does/not/matter', options.path ? options : {db: memdown}), - sublevelDb = sublevel(db), + var db; + + if (options.jdbc) { + var jdbcdown = require('./jdbcdown'); + db = levelup(new jdbcdown(options.jdbc)); + } + else if (options.path) { + var leveldown = require('leveldown'); + db = levelup(leveldown(options.path)); + } + else + { + db = levelup(memdown()); + } + + var sublevelDb = sublevel(db), tableDb = sublevelDb.sublevel('table', {valueEncoding: 'json'}), subDbs = Object.create(null) From 219401ca38d6404b2086e2bc7eb278b53e7adbde Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 6 Nov 2017 20:51:14 +0200 Subject: [PATCH 17/39] some more tweaks --- db/index.js | 2 +- db/jdbcdown/index.js | 1 - package.json | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/index.js b/db/index.js index f982838..f4c61ef 100644 --- a/db/index.js +++ b/db/index.js @@ -49,7 +49,7 @@ function create(options) { if (options.jdbc) { var jdbcdown = require('./jdbcdown'); - db = levelup(new jdbcdown(options.jdbc)); + db = levelup(new jdbcdown(options.jdbc, options.jdbcUser, options.jdbcPassword)); } else if (options.path) { var leveldown = require('leveldown'); diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js index 9175d81..f54ec04 100644 --- a/db/jdbcdown/index.js +++ b/db/jdbcdown/index.js @@ -9,7 +9,6 @@ var url = require('url'); // Todo: break to one meta-table for tables and separate tables for each dynamo table. // Currently, everything is on one table var TABLENAME = 'takipi_jdbcdown'; -var debug = require('debug')('jdbcdown'); var util = require('./encoding'); module.exports = JDBCdown; diff --git a/package.json b/package.json index a2bf5c9..cdee08c 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "dateformat": "*", "lazy": "^1.0.11", "level-sublevel": "^6.6.1", + "leveldown": "^1.9.0", "levelup": "^2.0.0", "lock": "^0.1.3", "memdown": "^1.2.4", From 78b8ffded458ade4e27d6a1d529f1abbb64a5085 Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Wed, 8 Nov 2017 07:19:35 +0200 Subject: [PATCH 18/39] upgrade --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 801e02c..aa67dfa 100644 --- a/package.json +++ b/package.json @@ -29,16 +29,17 @@ "dateformat": "*", "lazy": "^1.0.11", "level-sublevel": "^6.6.1", - "levelup": "^1.3.1", + "leveldown": "^1.5.1", + "levelup": "^2.0.0", "lock": "^0.1.3", "memdown": "^1.2.4", "minimist": "^1.2.0", "node-stringify": "*", - "once": "^1.3.3", + "once": "^1.4.0", "pad": "*", - "winston": "*", "trireme": "^0.9.0", - "trireme-jdbc": "^1.0.1" + "trireme-jdbc": "^1.0.1", + "winston": "*" }, "optionalDependencies": { "leveldown": "^1.5.1" From 95d8a0ce4014008b371a85eccecd8ccef2bbe121 Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Wed, 8 Nov 2017 07:20:24 +0200 Subject: [PATCH 19/39] support multiple tables --- db/index.js | 2 +- db/jdbcdown/index.js | 49 ++++++++++++++++++++++++----------------- db/jdbcdown/iterator.js | 2 +- index.js | 3 ++- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/db/index.js b/db/index.js index 4146536..a0b534e 100644 --- a/db/index.js +++ b/db/index.js @@ -49,7 +49,7 @@ function create(options) { if (options.jdbc) { var jdbcdown = require('./jdbcdown'); - var db = levelup(options.path || '/does/not/matter', options.path ? {} : {db: memdown}), + db = levelup(new jdbcdown(options.jdbc, options.jdbcUser, options.jdbcPassword, options.table)); } else if (options.path) { var leveldown = require('leveldown'); diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js index f54ec04..6b3ebe6 100644 --- a/db/jdbcdown/index.js +++ b/db/jdbcdown/index.js @@ -8,24 +8,24 @@ var Promise = require('bluebird'); var url = require('url'); // Todo: break to one meta-table for tables and separate tables for each dynamo table. // Currently, everything is on one table -var TABLENAME = 'takipi_jdbcdown'; var util = require('./encoding'); module.exports = JDBCdown; +// db pool shared by all different instances +var pool; + inherits(JDBCdown, AbstractLevelDOWN); -function JDBCdown(jdbcUrl, jdbcUser, jdbcPassword) { +function JDBCdown(jdbcUrl, jdbcUser, jdbcPassword, tableName) { AbstractLevelDOWN.call(this, jdbcUrl); - var pool = connection(jdbcUrl, jdbcUser, jdbcPassword); + initPool(jdbcUrl, jdbcUser, jdbcPassword); this.pool = pool; - this.tablename = TABLENAME; + this.tableName = tableName;; } JDBCdown.prototype._open = function(options, callback) { - this.tablename = TABLENAME; - - var tableCreateStr = 'CREATE TABLE IF NOT EXISTS ' + this.tablename + '(' + + var tableCreateStr = 'CREATE TABLE IF NOT EXISTS ' + this.tableName + '(' + 'K VARCHAR(3072) NOT NULL, V BLOB, PRIMARY KEY(K)) ' + 'ENGINE=InnoDB'; @@ -63,7 +63,7 @@ JDBCdown.prototype._get = function(key, options, cb) { } key = util.encode(key); - this.pool.execute("SELECT V FROM " + this.tablename + " WHERE K = ?", [key], function(err, res, rows) { + this.pool.execute("SELECT V FROM " + this.tableName + " WHERE K = ?", [key], function(err, res, rows) { if (err) { return cb(err.stack); } @@ -93,18 +93,17 @@ JDBCdown.prototype._get = function(key, options, cb) { } JDBCdown.prototype._put = function(key, value, opt, cb) { - var self = this; value = util.encode(value, true); key = util.encode(key); - insertHelper(this.pool, cb, key, value); + insertHelper(this.pool, cb, key, value, this.tableName); } JDBCdown.prototype._del = function(key, opt, cb) { var self = this; key = util.encode(key); - deleteHelper(this.pool, cb, key); + deleteHelper(this.pool, cb, key, this.tableName); } function unique(array) { @@ -118,17 +117,18 @@ function unique(array) { } JDBCdown.prototype._batch = function(array, options, callback) { + var self = this; var inserts = 0; this.pool.beginTransaction(function(err, tran) { return Promise.all(unique(array).map(function(item) { var key = util.encode(item.key); if (item.type === 'del') { - return deleteHelper(tran, function() {}, key); + return deleteHelper(tran, function() {}, key, self.tableName); } else { var value = util.encode(item.value, true); inserts++; - return insertHelper(tran, function() {}, key, value); + return insertHelper(tran, function() {}, key, value, self.tableName); } })).then(function() { tran.commit(function(err) { @@ -151,9 +151,16 @@ JDBCdown.prototype.iterator = function(options) { return new Iter(this, options); }; -function connection(url, user, password) { - console.log('connecting...') - return new jdbc.Database({ +function initPool(url, user, password) { + + if (pool) + { + return; + } + + console.log('connecting to ' + url + ' with user: ' + user); + + pool = new jdbc.Database({ url: url, properties: { user: user, @@ -163,10 +170,12 @@ function connection(url, user, password) { maxConnections: 30, idleTimeout: 60 }); + + console.log('successfully created pool'); } -function insertHelper(db, cb, key, value) { - db.execute("INSERT INTO " + TABLENAME + " (K, V) VALUES (?,?) ON DUPLICATE KEY UPDATE V=?", [key, value, value], function(err) { +function insertHelper(db, cb, key, value, tableName) { + db.execute("INSERT INTO " + tableName + " (K, V) VALUES (?,?) ON DUPLICATE KEY UPDATE V=?", [key, value, value], function(err) { if (err) { console.log(err) } @@ -174,8 +183,8 @@ function insertHelper(db, cb, key, value) { }); } -function deleteHelper(db, cb, key, value) { - db.execute("DELETE FROM " + TABLENAME + " where K=?", [key], function(err) { +function deleteHelper(db, cb, key, value, tableName) { + db.execute("DELETE FROM " + tableName + " where K=?", [key], function(err) { if (err) { console.log(err); } diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js index 38c1213..3e13404 100644 --- a/db/jdbcdown/iterator.js +++ b/db/jdbcdown/iterator.js @@ -138,7 +138,7 @@ Iterator.prototype._end = function(callback) { Iterator.prototype.buildSQL = function () { var self = this; - var sql = "select K, V from " + this.tableName + " where "; + var sql = "select K, V from " + this._options.table + " where "; var args = []; var statement = {sql: sql, args: args}; diff --git a/index.js b/index.js index b3c33a1..c83ad7a 100644 --- a/index.js +++ b/index.js @@ -453,7 +453,7 @@ function getStore(stores, options, action, data) if (options.flat_layout) { - table = "" + table = ""; } else { @@ -472,6 +472,7 @@ function getStore(stores, options, action, data) } newOptions.path = newOptions.path + "/" + table + newOptions.table = table; store = db.create(newOptions); } From 3d244eb6782ce1081b2786cbac94b7cadd717aee Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Wed, 8 Nov 2017 07:22:19 +0200 Subject: [PATCH 20/39] optional leveldown --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index aa67dfa..9f687e5 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "dateformat": "*", "lazy": "^1.0.11", "level-sublevel": "^6.6.1", - "leveldown": "^1.5.1", "levelup": "^2.0.0", "lock": "^0.1.3", "memdown": "^1.2.4", From ab0d4bb1a14e3a9be25e21b0b8ed0333da69be2f Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Thu, 9 Nov 2017 01:02:04 +0200 Subject: [PATCH 21/39] missing dependencies --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 9f687e5..1f96f3c 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,10 @@ "abstract-leveldown": "^3.0.0", "async": "^2.1.4", "big.js": "^3.1.3", + "bluebird": "^3.5.1", "buffer-crc32": "^0.2.13", "dateformat": "*", + "inherit": "^2.2.6", "lazy": "^1.0.11", "level-sublevel": "^6.6.1", "levelup": "^2.0.0", From 5191b76e338b5b89cb5cf7ee0aa290ea3b064aad Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Sun, 12 Nov 2017 11:53:45 +0200 Subject: [PATCH 22/39] add inherits dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f96f3c..fd3732b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bluebird": "^3.5.1", "buffer-crc32": "^0.2.13", "dateformat": "*", - "inherit": "^2.2.6", + "inherits": "^2.0.3", "lazy": "^1.0.11", "level-sublevel": "^6.6.1", "levelup": "^2.0.0", From 2e8aca765963dae65e2a559d6c0f8ffbaf33836e Mon Sep 17 00:00:00 2001 From: mervyn2017 Date: Sun, 12 Nov 2017 15:37:48 +0200 Subject: [PATCH 23/39] Upgrade dynalite to levelup v2 --- db/index.js | 4 +++- package.json | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/db/index.js b/db/index.js index 795b53b..599afdb 100644 --- a/db/index.js +++ b/db/index.js @@ -3,6 +3,8 @@ var crypto = require('crypto'), async = require('async'), Lazy = require('lazy'), levelup = require('levelup'), + encode = require('encoding-down'), + leveldown = require('leveldown'), memdown = require('memdown'), sublevel = require('level-sublevel'), Lock = require('lock'), @@ -45,7 +47,7 @@ function create(options) { if (options.maxItemSizeKb == null) options.maxItemSizeKb = exports.MAX_SIZE / 1024 options.maxItemSize = options.maxItemSizeKb * 1024 - var db = levelup(options.path || '/does/not/matter', options.path ? options : {db: memdown}), + var db = levelup(encode(leveldown(options.path || '/does/not/matter')), options.path ? options : {db: memdown}), sublevelDb = sublevel(db), tableDb = sublevelDb.sublevel('table', {valueEncoding: 'json'}), subDbs = Object.create(null) diff --git a/package.json b/package.json index a3548de..24baa12 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "dateformat": "*", "lazy": "^1.0.11", "level-sublevel": "^6.5.4", - "levelup": "^1.3.3", + "encoding-down": "^2.3.4", + "levelup": "^2.0.0", "lock": "^0.1.2", "memdown": "^1.1.2", "minimist": "^1.2.0", @@ -38,7 +39,7 @@ "winston": "*" }, "optionalDependencies": { - "leveldown": "^1.5.0" + "leveldown": "^2.0.0" }, "devDependencies": { "aws4": "^1.3.2", From 43a047a2156b95a7c5c44a8c0bc91b2643dd65ff Mon Sep 17 00:00:00 2001 From: mervyn2017 Date: Sun, 12 Nov 2017 15:38:55 +0200 Subject: [PATCH 24/39] Upgrade dynalite to levelup v2 --- db/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/index.js b/db/index.js index 599afdb..564f3ad 100644 --- a/db/index.js +++ b/db/index.js @@ -3,8 +3,8 @@ var crypto = require('crypto'), async = require('async'), Lazy = require('lazy'), levelup = require('levelup'), - encode = require('encoding-down'), - leveldown = require('leveldown'), + encode = require('encoding-down'), + leveldown = require('leveldown'), memdown = require('memdown'), sublevel = require('level-sublevel'), Lock = require('lock'), From b1d7e53fc8cea7007ad7e37a3c36fdff9ca87fdf Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 13 Nov 2017 06:53:40 +0200 Subject: [PATCH 25/39] pass table to iterator --- db/jdbcdown/iterator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js index 3e13404..80d11fc 100644 --- a/db/jdbcdown/iterator.js +++ b/db/jdbcdown/iterator.js @@ -28,6 +28,8 @@ function Iterator(db, options, cb) { options = options || {}; this._order = !options.reverse; this._options = options; + this.table = db.table; + names.forEach(function (i) { goodOptions(options, i); }); @@ -138,7 +140,7 @@ Iterator.prototype._end = function(callback) { Iterator.prototype.buildSQL = function () { var self = this; - var sql = "select K, V from " + this._options.table + " where "; + var sql = "select K, V from " + this.table + " where "; var args = []; var statement = {sql: sql, args: args}; From cb4e78575ee83b6c873917915b4b098c2971476c Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 13 Nov 2017 12:28:14 +0200 Subject: [PATCH 26/39] fix tableName --- db/jdbcdown/iterator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js index 80d11fc..0e84f3a 100644 --- a/db/jdbcdown/iterator.js +++ b/db/jdbcdown/iterator.js @@ -28,7 +28,7 @@ function Iterator(db, options, cb) { options = options || {}; this._order = !options.reverse; this._options = options; - this.table = db.table; + this.tableName = db.tableName; names.forEach(function (i) { goodOptions(options, i); @@ -140,7 +140,7 @@ Iterator.prototype._end = function(callback) { Iterator.prototype.buildSQL = function () { var self = this; - var sql = "select K, V from " + this.table + " where "; + var sql = "select K, V from " + this.tableName + " where "; var args = []; var statement = {sql: sql, args: args}; From a80b1db4cc28868dd0c8d6b55b88cbf5c4e6d9f3 Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Mon, 13 Nov 2017 21:15:48 +0200 Subject: [PATCH 27/39] fix wrong args count --- db/jdbcdown/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js index 6b3ebe6..ebed189 100644 --- a/db/jdbcdown/index.js +++ b/db/jdbcdown/index.js @@ -21,7 +21,7 @@ function JDBCdown(jdbcUrl, jdbcUser, jdbcPassword, tableName) { initPool(jdbcUrl, jdbcUser, jdbcPassword); this.pool = pool; - this.tableName = tableName;; + this.tableName = tableName; } JDBCdown.prototype._open = function(options, callback) { @@ -183,7 +183,7 @@ function insertHelper(db, cb, key, value, tableName) { }); } -function deleteHelper(db, cb, key, value, tableName) { +function deleteHelper(db, cb, key, tableName) { db.execute("DELETE FROM " + tableName + " where K=?", [key], function(err) { if (err) { console.log(err); From 8fd93d355d2622034f7cadd3245a291ba57e390f Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Tue, 14 Nov 2017 13:39:56 +0200 Subject: [PATCH 28/39] better logging --- db/jdbcdown/index.js | 10 +++++++--- db/jdbcdown/iterator.js | 12 +++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js index ebed189..e20727c 100644 --- a/db/jdbcdown/index.js +++ b/db/jdbcdown/index.js @@ -65,6 +65,7 @@ JDBCdown.prototype._get = function(key, options, cb) { this.pool.execute("SELECT V FROM " + this.tableName + " WHERE K = ?", [key], function(err, res, rows) { if (err) { + console.error(err); return cb(err.stack); } if (rows === undefined) { @@ -86,7 +87,7 @@ JDBCdown.prototype._get = function(key, options, cb) { cb(null, decodedVal); }); } catch (e) { - console.log(e); + console.error(e); cb(new Error('NotFound')); } }); @@ -120,6 +121,9 @@ JDBCdown.prototype._batch = function(array, options, callback) { var self = this; var inserts = 0; this.pool.beginTransaction(function(err, tran) { + if (err) { + console.error(err); + } return Promise.all(unique(array).map(function(item) { var key = util.encode(item.key); @@ -177,7 +181,7 @@ function initPool(url, user, password) { function insertHelper(db, cb, key, value, tableName) { db.execute("INSERT INTO " + tableName + " (K, V) VALUES (?,?) ON DUPLICATE KEY UPDATE V=?", [key, value, value], function(err) { if (err) { - console.log(err) + console.error(err) } cb(); }); @@ -186,7 +190,7 @@ function insertHelper(db, cb, key, value, tableName) { function deleteHelper(db, cb, key, tableName) { db.execute("DELETE FROM " + tableName + " where K=?", [key], function(err) { if (err) { - console.log(err); + console.error(err); } cb(); diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js index 0e84f3a..cf8e2fc 100644 --- a/db/jdbcdown/iterator.js +++ b/db/jdbcdown/iterator.js @@ -75,9 +75,11 @@ function Iterator(db, options, cb) { // best to use an actual stream, or add a limit to fetched rows db.pool.execute(statement.sql, statement.args, function(err, result, rows) { + if (err) { + console.error(err); + } var ended =false; - if ((!rows) || (rows.length == 0)) - { + if ((!rows) || (rows.length == 0)) { __stream.end(); } else @@ -199,8 +201,7 @@ Iterator.prototype.buildSQL = function () { } if (this._limit > 0) { - statement.sql = statement.sql + " limit ?"; - statement.args.push(this._limit); + statement.sql = statement.sql + " limit " + this._limit; } return statement; @@ -208,7 +209,8 @@ Iterator.prototype.buildSQL = function () { function appendWhere(statement, condition, appendee) { - statement.sql += (condition + " '" + util.decode(appendee) + "' AND "); + statement.sql += (condition + " ? AND "); + statement.args.push(util.encode(appendee)); } function appendOrderBy(statement, bool) { From ef375a64e09d82f4c551de318ae8cb4f5ab67528 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Wed, 22 Nov 2017 17:51:36 +0200 Subject: [PATCH 29/39] minor fixes --- db/jdbcdown/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js index e20727c..4576488 100644 --- a/db/jdbcdown/index.js +++ b/db/jdbcdown/index.js @@ -26,11 +26,15 @@ function JDBCdown(jdbcUrl, jdbcUser, jdbcPassword, tableName) { JDBCdown.prototype._open = function(options, callback) { var tableCreateStr = 'CREATE TABLE IF NOT EXISTS ' + this.tableName + '(' + - 'K VARCHAR(3072) NOT NULL, V BLOB, PRIMARY KEY(K)) ' + + 'K VARCHAR(767) NOT NULL, V BLOB, PRIMARY KEY(K)) ' + 'ENGINE=InnoDB'; this.pool.execute(tableCreateStr, function(err, result) { + if (err) { + console.error(err); + } + callback(); }); } @@ -66,7 +70,7 @@ JDBCdown.prototype._get = function(key, options, cb) { this.pool.execute("SELECT V FROM " + this.tableName + " WHERE K = ?", [key], function(err, res, rows) { if (err) { console.error(err); - return cb(err.stack); + return cb(new Error("Error occurred")); } if (rows === undefined) { return cb(new Error('NotFound')); From 14c87195f7d6d83c9556989720d3ad4bb01ed727 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Tue, 28 Nov 2017 18:31:35 +0200 Subject: [PATCH 30/39] some ops --- trireme/.gitignore | 1 + trireme/build.gradle | 30 +++ trireme/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54227 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + trireme/gradlew | 172 ++++++++++++++++++ trireme/gradlew.bat | 84 +++++++++ trireme/settings.gradle | 19 ++ 7 files changed, 312 insertions(+) create mode 100644 trireme/.gitignore create mode 100644 trireme/build.gradle create mode 100644 trireme/gradle/wrapper/gradle-wrapper.jar create mode 100644 trireme/gradle/wrapper/gradle-wrapper.properties create mode 100755 trireme/gradlew create mode 100644 trireme/gradlew.bat create mode 100644 trireme/settings.gradle diff --git a/trireme/.gitignore b/trireme/.gitignore new file mode 100644 index 0000000..4a8da3b --- /dev/null +++ b/trireme/.gitignore @@ -0,0 +1 @@ +.gradle \ No newline at end of file diff --git a/trireme/build.gradle b/trireme/build.gradle new file mode 100644 index 0000000..2406cb9 --- /dev/null +++ b/trireme/build.gradle @@ -0,0 +1,30 @@ +apply plugin: "java" +apply plugin: "distribution" + +repositories { + mavenCentral() +} + +dependencies { + compile "mysql:mysql-connector-java:5.1.6" +} + +distributions { + main { + contents { + from(configurations.compile.resolve()) { + into("libs") + } + } + } +} + +task copyTar(dependsOn: distTar) { + if (rootProject.hasProperty("tarTargetFile")) { + def tarFile ="$buildDir/distributions/${project.name}.tar" + + println "Copying $tarFile to $tarTargetFile" + + ant.copy(file:tarFile, tofile:tarTargetFile) + } +} diff --git a/trireme/gradle/wrapper/gradle-wrapper.jar b/trireme/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..51288f9c2f05faf8d42e1a751a387ca7923882c3 GIT binary patch literal 54227 zcmaI7W0WS{vNc-lF59+k+qP}nt}ffQZQE5{wp~xzc30g#d_WEY_lIM<*>kEH?T**n)L|d4_rKbms*8e?2n)Ki&=O?<4J<%>V7R{?iBg zUq0qeh9)+q|G%!t|L*GUWa!{v>h%8_vhfuLJO%*-l>FD9;-818|MyT)4^v}T7kei< zV;e(f=M?n_Z{$_P@0tV}PfeKL81;-1K%hd2jPC7;DA>wd?+UcoR*R#W($?M))u>gd zdn}ehUd3m+8_k40@?K-j2J`KZyalp1AAH~OemS09)oMlsj}Ip=JKY&CS%B#&?VkHQ zbp0RoxZiO54G4JffN7@lTM-EP35bJi7)bfM8EqjCYYcnn{VS&2QEn5KJxt6fN4jA5 z35`f+Sduq7yq)PG@7FzVP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dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/trireme/gradlew.bat b/trireme/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/trireme/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/trireme/settings.gradle b/trireme/settings.gradle new file mode 100644 index 0000000..2cac456 --- /dev/null +++ b/trireme/settings.gradle @@ -0,0 +1,19 @@ +/* + * This settings file was auto generated by the Gradle buildInit task + * by 'david' at '11/28/17 1:54 PM' with Gradle 3.2.1 + * + * The settings file is used to specify which projects to include in your build. + * In a single project build this file can be empty or even removed. + * + * Detailed information about configuring a multi-project build in Gradle can be found + * in the user guide at https://docs.gradle.org/3.2.1/userguide/multi_project_builds.html + */ + +/* +// To declare projects as part of a multi-project build use the 'include' method +include 'shared' +include 'api' +include 'services:webservice' +*/ + +rootProject.name = 'trireme' From 7dc275b3763c58694ef119e1f2031b6daf5b0469 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Tue, 28 Nov 2017 18:32:38 +0200 Subject: [PATCH 31/39] empty settings.gradle --- trireme/settings.gradle | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/trireme/settings.gradle b/trireme/settings.gradle index 2cac456..fe5fd35 100644 --- a/trireme/settings.gradle +++ b/trireme/settings.gradle @@ -1,19 +1 @@ -/* - * This settings file was auto generated by the Gradle buildInit task - * by 'david' at '11/28/17 1:54 PM' with Gradle 3.2.1 - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be empty or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/3.2.1/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'trireme' From e10c1293e7d72ace1ad52c59f17dae9a08af4f0a Mon Sep 17 00:00:00 2001 From: David Levanon Date: Tue, 28 Nov 2017 18:33:04 +0200 Subject: [PATCH 32/39] add run.sh --- trireme/src/main/dist/run.sh | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 trireme/src/main/dist/run.sh diff --git a/trireme/src/main/dist/run.sh b/trireme/src/main/dist/run.sh new file mode 100755 index 0000000..ad86cdc --- /dev/null +++ b/trireme/src/main/dist/run.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +declare -r script_dir=`cd "$( dirname "$0" )" && pwd` + +function generate_trireme_classpath() +{ + for jarFile in $script_dir/libs/*.jar; do + echo "$jarFile:" + done +} + +function goto_dynalite_home() +{ + while [ ! -r cli.js ]; do + cd .. + + if [ "$(pwd)" == "$(dirname `pwd`)" ]; then + echo "Unable to find dynalite home" + return 1 + fi + done + + return 0 +} + +function main() +{ + local dynalite_options=$1 + local jdbc_connection_string=$2 + local jdbc_user=$3 + local jdbc_password=$4 + + local trireme_classpath=$(generate_trireme_classpath) + + echo "About to run: " + echo trireme cli.js $dynalite_options \ + --jdbc $jdbc_connection_string --jdbcUser $jdbc_user --jdbcPassword $jdbc_password + echo "Trireme classpath is: $trireme_classpath" + + export TRIREME_CLASSPATH="$trireme_classpath" + + if ! goto_dynalite_home; then + exit 1 + fi + + trireme cli.js $dynalite_options \ + --jdbc $jdbc_connection_string --jdbcUser $jdbc_user --jdbcPassword $jdbc_password +} + +main $@ From 81e270efe5b15646f3a60540e733672494a433c4 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Tue, 28 Nov 2017 18:56:52 +0200 Subject: [PATCH 33/39] Fix run --- trireme/src/main/dist/run.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/trireme/src/main/dist/run.sh b/trireme/src/main/dist/run.sh index ad86cdc..da3db8f 100755 --- a/trireme/src/main/dist/run.sh +++ b/trireme/src/main/dist/run.sh @@ -25,16 +25,10 @@ function goto_dynalite_home() function main() { - local dynalite_options=$1 - local jdbc_connection_string=$2 - local jdbc_user=$3 - local jdbc_password=$4 - local trireme_classpath=$(generate_trireme_classpath) echo "About to run: " - echo trireme cli.js $dynalite_options \ - --jdbc $jdbc_connection_string --jdbcUser $jdbc_user --jdbcPassword $jdbc_password + echo trireme cli.js $@ echo "Trireme classpath is: $trireme_classpath" export TRIREME_CLASSPATH="$trireme_classpath" @@ -43,8 +37,7 @@ function main() exit 1 fi - trireme cli.js $dynalite_options \ - --jdbc $jdbc_connection_string --jdbcUser $jdbc_user --jdbcPassword $jdbc_password + trireme cli.js $@ } main $@ From 8f1a7e7fa9488b1ebc90b0848645e8ed13f05dcc Mon Sep 17 00:00:00 2001 From: David Levanon Date: Tue, 28 Nov 2017 19:03:45 +0200 Subject: [PATCH 34/39] dolast --- trireme/build.gradle | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/trireme/build.gradle b/trireme/build.gradle index 2406cb9..3ac7054 100644 --- a/trireme/build.gradle +++ b/trireme/build.gradle @@ -20,11 +20,13 @@ distributions { } task copyTar(dependsOn: distTar) { - if (rootProject.hasProperty("tarTargetFile")) { - def tarFile ="$buildDir/distributions/${project.name}.tar" - - println "Copying $tarFile to $tarTargetFile" - - ant.copy(file:tarFile, tofile:tarTargetFile) + doLast { + if (rootProject.hasProperty("tarTargetFile")) { + def tarFile ="$buildDir/distributions/${project.name}.tar" + + println "Copying $tarFile to $tarTargetFile" + + ant.copy(file:tarFile, tofile:tarTargetFile) + } } } From af7af88b9dc4dfe46387c87db5c8fd18512820a5 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Sun, 31 Dec 2017 15:41:13 +0200 Subject: [PATCH 35/39] add packages lock file --- package-lock.json | 1694 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1694 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..060ac78 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1694 @@ +{ + "name": "dynalite", + "version": "1.2.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "abstract-leveldown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz", + "integrity": "sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ==", + "requires": { + "xtend": "4.0.1" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.3" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "optional": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "optional": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "4.17.4" + } + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" + }, + "bindings": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", + "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==", + "optional": true + }, + "bl": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.8.2.tgz", + "integrity": "sha1-yba8oI0bwuoA/Ir7Txpf0eHGbk4=", + "requires": { + "readable-stream": "1.0.34" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" + }, + "bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4=", + "requires": { + "bytewise-core": "1.2.3", + "typewise": "1.0.3" + } + }, + "bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI=", + "requires": { + "typewise-core": "1.2.0" + } + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "clone": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" + }, + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" + }, + "dateformat": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.2.tgz", + "integrity": "sha1-mk30v/FYrC80vGN6vbFUcWB+Flk=" + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "optional": true + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "optional": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "requires": { + "clone": "1.0.3" + } + }, + "deferred-leveldown": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-0.2.0.tgz", + "integrity": "sha1-LO8fER4cV4cNi7uK8mUOWHzS9bQ=", + "requires": { + "abstract-leveldown": "0.12.4" + }, + "dependencies": { + "abstract-leveldown": { + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-0.12.4.tgz", + "integrity": "sha1-KeGOYy5g5OIh1YECR4UqY9ey5BA=", + "requires": { + "xtend": "3.0.0" + } + }, + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=" + } + } + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "optional": true + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", + "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", + "requires": { + "once": "1.4.0" + } + }, + "errno": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.6.tgz", + "integrity": "sha512-IsORQDpaaSwcDP4ZZnHxgE85werpo34VYn1Ud3mq+eUsF593faR8oCZNXrROVkpFu2TsbrNhHin0aUrTsQ9vNw==", + "requires": { + "prr": "1.0.1" + }, + "dependencies": { + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "expand-template": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.0.tgz", + "integrity": "sha512-kkjwkMqj0h4w/sb32ERCDxCQkREMCAgS39DscDnSwDsbxnwwM1BTZySdC3Bn1lhY7vL08n9GoO/fVTynjDgRyQ==", + "optional": true + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + }, + "fast-future": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fast-future/-/fast-future-1.0.2.tgz", + "integrity": "sha1-hDWpqqAteSSNF9cE52JZMB2ZKAo=", + "optional": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "optional": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", + "optional": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "optional": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "optional": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.11", + "js-yaml": "3.10.0", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.0", + "wordwrap": "1.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + } + } + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz", + "integrity": "sha1-2qBoIGKCVCwIgojpdcKXwa53tpA=" + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "level-errors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.1.2.tgz", + "integrity": "sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w==", + "requires": { + "errno": "0.1.6" + } + }, + "level-iterator-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-2.0.0.tgz", + "integrity": "sha512-TWOYw8HR5mhj6xwoVLo0yu26RPL6v28KgvhK1kY1CJf9LyL+rJXjx99zhORTYhN9ysOBIH+iaxAiqRteA+C1/g==", + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "xtend": "4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "level-post": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-post/-/level-post-1.0.5.tgz", + "integrity": "sha1-KmY5BAm/ahYhpES6tvAWREzJgCw=", + "requires": { + "ltgt": "2.1.3" + } + }, + "level-sublevel": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/level-sublevel/-/level-sublevel-6.6.1.tgz", + "integrity": "sha1-+ad/dSGrcKj46S7VbyGjx4hqRIU=", + "requires": { + "bytewise": "1.1.0", + "levelup": "0.19.1", + "ltgt": "2.1.3", + "pull-level": "2.0.3", + "pull-stream": "3.6.1", + "typewiselite": "1.0.0", + "xtend": "4.0.1" + }, + "dependencies": { + "levelup": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-0.19.1.tgz", + "integrity": "sha1-86anIFJyxLXzXkEv8ASgOgrt9Qs=", + "requires": { + "bl": "0.8.2", + "deferred-leveldown": "0.2.0", + "errno": "0.1.6", + "prr": "0.0.0", + "readable-stream": "1.0.34", + "semver": "5.1.1", + "xtend": "3.0.0" + }, + "dependencies": { + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=" + } + } + } + } + }, + "leveldown": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-1.9.0.tgz", + "integrity": "sha512-3MwcrnCUIuFiKp/jSrG1UqDTV4k1yH8f5HH6T9dpqCKG+lRxcfo2KwAqbzTT+TTKfCbaATeHMy9mm1y6sI3ZvA==", + "optional": true, + "requires": { + "abstract-leveldown": "2.7.2", + "bindings": "1.3.0", + "fast-future": "1.0.2", + "nan": "2.7.0", + "prebuild-install": "2.4.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "optional": true, + "requires": { + "xtend": "4.0.1" + } + } + } + }, + "levelup": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-2.0.1.tgz", + "integrity": "sha1-PckbPmMtN8nlRiOchkEYsATJ+GA=", + "requires": { + "deferred-leveldown": "2.0.3", + "level-errors": "1.1.2", + "level-iterator-stream": "2.0.0", + "xtend": "4.0.1" + }, + "dependencies": { + "deferred-leveldown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-2.0.3.tgz", + "integrity": "sha512-8c2Hv+vIwKNc7qqy4zE3t5DIsln+FQnudcyjLYstHwLFg7XnXZT/H8gQb8lj6xi8xqGM0Bz633ZWcCkonycBTA==", + "requires": { + "abstract-leveldown": "3.0.0" + } + } + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lock": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/lock/-/lock-0.1.4.tgz", + "integrity": "sha1-/sfervF+fDoKVeHaBCgD4l2RdF0=" + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true, + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._basecreate": "3.0.3", + "lodash._isiterateecall": "3.0.9" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "looper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/looper/-/looper-2.0.0.tgz", + "integrity": "sha1-Zs0Md0rz1P7axTeU90LbVtqPCew=" + }, + "ltgt": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.3.tgz", + "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ=" + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "2.7.2", + "functional-red-black-tree": "1.0.1", + "immediate": "3.2.3", + "inherits": "2.0.3", + "ltgt": "2.2.0", + "safe-buffer": "5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "4.0.1" + } + }, + "ltgt": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.0.tgz", + "integrity": "sha1-tlul/LNJopkkyOMz98alVi8uSEI=" + } + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", + "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", + "optional": true + }, + "node-abi": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.1.2.tgz", + "integrity": "sha512-hmUtb8m75RSi7N+zZLYqe75XDvZB+6LyTBPkj2DConvNgQet2e3BIqEwe1LLvqMrfyjabuT5ZOrTioLCH1HTdA==", + "optional": true, + "requires": { + "semver": "5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "optional": true + } + } + }, + "node-stringify": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-stringify/-/node-stringify-0.2.1.tgz", + "integrity": "sha512-EdzBiPO2hmQOpG8eZtJmBK0bAWPTdla2GAU4Tb7fztLkAiMEYcJAHWvC/4FI8E9ZOxB1zmoAJpM6upTQ54xNDw==" + }, + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", + "optional": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1.0.9" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "optional": true + }, + "pad": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pad/-/pad-2.0.3.tgz", + "integrity": "sha512-YVlBmpDQilhUl69RY/0Ku9Il0sNPLgVOVePhCJUfN8qDZKrq1zIY+ZwtCLtaWFtJzuJswwAcZHxf4a5RliV2pQ==", + "requires": { + "wcwidth": "1.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=", + "dev": true + }, + "prebuild-install": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.4.1.tgz", + "integrity": "sha512-99TyEFYTTkBWANT+mwSptmLb9ZCLQ6qKIUE36fXSIOtShB0JNprL2hzBD8F1yIuT9btjFrFEwbRHXhqDi1HmRA==", + "optional": true, + "requires": { + "expand-template": "1.1.0", + "github-from-package": "0.0.0", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "node-abi": "2.1.2", + "noop-logger": "0.1.1", + "npmlog": "4.1.2", + "os-homedir": "1.0.2", + "pump": "1.0.3", + "rc": "1.2.2", + "simple-get": "1.4.3", + "tar-fs": "1.16.0", + "tunnel-agent": "0.6.0", + "xtend": "4.0.1" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "prr": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=" + }, + "pull-cat": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/pull-cat/-/pull-cat-1.1.11.tgz", + "integrity": "sha1-tkLdElXaN2pwa220+pYvX9t0wxs=" + }, + "pull-level": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pull-level/-/pull-level-2.0.3.tgz", + "integrity": "sha1-lQBjXiV5Rdb+7eGF9deiR3NFWxc=", + "requires": { + "level-post": "1.0.5", + "pull-cat": "1.1.11", + "pull-live": "1.0.1", + "pull-pushable": "2.1.1", + "pull-stream": "3.6.1", + "pull-window": "2.1.4", + "stream-to-pull-stream": "1.7.2" + } + }, + "pull-live": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pull-live/-/pull-live-1.0.1.tgz", + "integrity": "sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU=", + "requires": { + "pull-cat": "1.1.11", + "pull-stream": "3.6.1" + } + }, + "pull-pushable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pull-pushable/-/pull-pushable-2.1.1.tgz", + "integrity": "sha1-hmZqu+P1QC8ffq0D7v1pt4Xspbg=" + }, + "pull-stream": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.1.tgz", + "integrity": "sha1-xcKuSlEkbv7rzGXAQSo9clqSzgA=" + }, + "pull-window": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/pull-window/-/pull-window-2.1.4.tgz", + "integrity": "sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA=", + "requires": { + "looper": "2.0.0" + } + }, + "pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "requires": { + "end-of-stream": "1.4.0", + "once": "1.4.0" + } + }, + "rc": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", + "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "semver": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.1.1.tgz", + "integrity": "sha1-oykqNz5vPgeY2gsgZBuanFvEfhk=" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "optional": true + }, + "should": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/should/-/should-11.2.1.tgz", + "integrity": "sha1-kPVRRVUtAc/CAGZuToGKHJZw7aI=", + "dev": true, + "requires": { + "should-equal": "1.0.1", + "should-format": "3.0.3", + "should-type": "1.4.0", + "should-type-adaptors": "1.1.0", + "should-util": "1.0.0" + } + }, + "should-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-1.0.1.tgz", + "integrity": "sha1-C26VFvJgGp+wuy3MNpr6HH4gCvc=", + "dev": true, + "requires": { + "should-type": "1.4.0" + } + }, + "should-format": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", + "dev": true, + "requires": { + "should-type": "1.4.0", + "should-type-adaptors": "1.1.0" + } + }, + "should-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", + "dev": true + }, + "should-type-adaptors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", + "dev": true, + "requires": { + "should-type": "1.4.0", + "should-util": "1.0.0" + } + }, + "should-util": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", + "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "optional": true + }, + "simple-get": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-1.4.3.tgz", + "integrity": "sha1-6XVe2kB+ltpAxeUVjJ6jezO+y+s=", + "optional": true, + "requires": { + "once": "1.4.0", + "unzip-response": "1.0.2", + "xtend": "4.0.1" + } + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + }, + "stream-to-pull-stream": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/stream-to-pull-stream/-/stream-to-pull-stream-1.7.2.tgz", + "integrity": "sha1-dXYJrhzr0zx0MtSvvjH/eGULnd4=", + "requires": { + "looper": "3.0.0", + "pull-stream": "3.6.1" + }, + "dependencies": { + "looper": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/looper/-/looper-3.0.0.tgz", + "integrity": "sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k=" + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "optional": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + }, + "tar-fs": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.0.tgz", + "integrity": "sha512-I9rb6v7mjWLtOfCau9eH5L7sLJyU2BnxtEZRQ5Mt+eRKmf1F0ohXmT/Jc3fr52kDvjJ/HV5MH3soQfPL5bQ0Yg==", + "optional": true, + "requires": { + "chownr": "1.0.1", + "mkdirp": "0.5.1", + "pump": "1.0.3", + "tar-stream": "1.5.5" + } + }, + "tar-stream": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", + "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", + "optional": true, + "requires": { + "bl": "1.2.1", + "end-of-stream": "1.4.0", + "readable-stream": "2.3.3", + "xtend": "4.0.1" + }, + "dependencies": { + "bl": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz", + "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=", + "optional": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "trireme": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/trireme/-/trireme-0.9.0.tgz", + "integrity": "sha1-3XdUoo4j3l4Md3BeWIamJy8iJ3o=" + }, + "trireme-jdbc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trireme-jdbc/-/trireme-jdbc-1.0.1.tgz", + "integrity": "sha1-R1lsBCtoi2jA0mEa2ryn1qBPnQE=", + "requires": { + "semver": "4.0.3" + }, + "dependencies": { + "semver": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.0.3.tgz", + "integrity": "sha1-95ybpnDvzMAp2YpQF972SwzhZE4=" + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "optional": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE=", + "requires": { + "typewise-core": "1.2.0" + } + }, + "typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU=" + }, + "typewiselite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typewiselite/-/typewiselite-1.0.0.tgz", + "integrity": "sha1-yIgvobsQksBgBal/NO9chQjjZk4=" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "unzip-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-1.0.2.tgz", + "integrity": "sha1-uYTwh3/AqJwsdzzB73tbIytbBv4=", + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "requires": { + "defaults": "1.0.3" + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "winston": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.0.tgz", + "integrity": "sha1-gIBQuT1SZh7Z+2wms/DIJnCLCu4=", + "requires": { + "async": "1.0.0", + "colors": "1.0.3", + "cycle": "1.0.3", + "eyes": "0.1.8", + "isstream": "0.1.2", + "stack-trace": "0.0.10" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" + } + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } +} From 11466047521cee7b6687edd8f33739d5a40790d5 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Wed, 17 Jan 2018 14:44:16 +0200 Subject: [PATCH 36/39] add stack trace to errors --- cli.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cli.js b/cli.js index c4a6903..6831962 100755 --- a/cli.js +++ b/cli.js @@ -32,6 +32,7 @@ if (process.pid == 1) process.on('SIGINT', process.exit) process.on('uncaughtException', function (exception) { console.log("an Uncaught Exception occurred"); console.log(exception); + console.log(exception.stack); process.exit(125); }); From d1bfb3ebe27e156b067b3e240e467f29b549c56f Mon Sep 17 00:00:00 2001 From: shimonmagal Date: Wed, 17 Jan 2018 23:18:47 +0200 Subject: [PATCH 37/39] fix iterator limit --- db/jdbcdown/iterator.js | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js index cf8e2fc..6381082 100644 --- a/db/jdbcdown/iterator.js +++ b/db/jdbcdown/iterator.js @@ -71,25 +71,41 @@ function Iterator(db, options, cb) { var __stream = this._stream; - // TODO: trireme-jdbc has executeStream, which doesn't seem to work. - // best to use an actual stream, or add a limit to fetched rows + // TODO: trireme-jdbc has executeStream, which doesn't seem to work with limit <= 10. + // So while the bug is fixed, we use the execute function db.pool.execute(statement.sql, statement.args, function(err, result, rows) { if (err) { console.error(err); + return; } + var ended =false; if ((!rows) || (rows.length == 0)) { __stream.end(); + return; } - else - { - rows.forEach(function(row) { - __stream.write(row, function(){if (ended){__stream.end();}}); - }); - } - ended = true; + + var rowCount = 0; + + rows.forEach(function(row) { + rowCount++; + + try + { + __stream.write(row, function(){ + if (rowCount >= rows.length){ + __stream.end(); + } + }); + } + catch (e) + { + console.error(e); + return; + } }); + }); } inherits(Iterator, AbstractIterator); @@ -136,7 +152,6 @@ Iterator.prototype._next = function(callback) { } Iterator.prototype._end = function(callback) { - this._stream.end() callback() } From ba427d65ef8a333c105dad6bf11337d97ba1a9a2 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Thu, 18 Jan 2018 10:48:17 +0200 Subject: [PATCH 38/39] add stack trace to the log --- db/jdbcdown/iterator.js | 1 + 1 file changed, 1 insertion(+) diff --git a/db/jdbcdown/iterator.js b/db/jdbcdown/iterator.js index 6381082..51902d0 100644 --- a/db/jdbcdown/iterator.js +++ b/db/jdbcdown/iterator.js @@ -102,6 +102,7 @@ function Iterator(db, options, cb) { catch (e) { console.error(e); + console.error(e.stack); return; } }); From ab08e6fffe804233f44fe752602f15814b754cf6 Mon Sep 17 00:00:00 2001 From: David Levanon Date: Thu, 10 May 2018 17:21:45 +0300 Subject: [PATCH 39/39] split tables --- db/jdbcdown/index.js | 22 +++++++++------------- index.js | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/db/jdbcdown/index.js b/db/jdbcdown/index.js index 4576488..b30630a 100644 --- a/db/jdbcdown/index.js +++ b/db/jdbcdown/index.js @@ -11,16 +11,12 @@ var url = require('url'); var util = require('./encoding'); module.exports = JDBCdown; -// db pool shared by all different instances -var pool; - inherits(JDBCdown, AbstractLevelDOWN); function JDBCdown(jdbcUrl, jdbcUser, jdbcPassword, tableName) { AbstractLevelDOWN.call(this, jdbcUrl); - initPool(jdbcUrl, jdbcUser, jdbcPassword); - this.pool = pool; + this.pool = initPool(jdbcUrl, jdbcUser, jdbcPassword, tableName); this.tableName = tableName; } @@ -159,16 +155,14 @@ JDBCdown.prototype.iterator = function(options) { return new Iter(this, options); }; -function initPool(url, user, password) { - - if (pool) - { - return; - } +function initPool(url, user, password, tableName) { + var parts = url.split(";"); + parts[0] = parts[0] + "_" + tableName; + url = parts.join(";"); - console.log('connecting to ' + url + ' with user: ' + user); + console.log('connecting to ' + url + ' with user: ' + user + ', table: ' + tableName); - pool = new jdbc.Database({ + var pool = new jdbc.Database({ url: url, properties: { user: user, @@ -180,6 +174,8 @@ function initPool(url, user, password) { }); console.log('successfully created pool'); + + return pool; } function insertHelper(db, cb, key, value, tableName) { diff --git a/index.js b/index.js index c83ad7a..0b0e15c 100644 --- a/index.js +++ b/index.js @@ -472,7 +472,7 @@ function getStore(stores, options, action, data) } newOptions.path = newOptions.path + "/" + table - newOptions.table = table; + newOptions.table = table; store = db.create(newOptions); }