diff --git a/.vscode/settings.json b/.vscode/settings.json index 0cc33a7..2f6c012 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,6 +22,7 @@ "oracledb", "PDBS", "pdbseed", + "peggy", "pegjs", "plsql", "PLUGGABLE", diff --git a/package.json b/package.json index d11f36c..f7c0aca 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "inquirer": "7.3.3", "inquirer-autocomplete-prompt": "1.2.0", "json-schema-to-markdown": "1.1.1", - "pegjs": "0.10.0", + "peggy": "1.2.0", "tap": "^16.3.2", "ut-run": "^10.70.27", "why-is-node-running": "^2.2.2" @@ -33,8 +33,8 @@ "scripts": { "lint": "ut-lint .", "release": "ut-release", - "genParser": "pegjs --allowed-start-rules create,createBody parsers/mssqlSP.pegjs", - "genParserOracle": "pegjs parsers/oracleSP.pegjs", + "genParser": "peggy --allowed-start-rules create,createBody parsers/mssqlSP.pegjs", + "genParserOracle": "peggy parsers/oracleSP.pegjs", "changelog": "ut-changelog", "check": "ut-check", "cover": "ut-cover-parallel", diff --git a/parsers/mssqlDefault.js b/parsers/mssqlDefault.js index cdb50f1..bf1af65 100644 --- a/parsers/mssqlDefault.js +++ b/parsers/mssqlDefault.js @@ -1,671 +1,780 @@ -module.exports = (function() { - /* - * Generated by PEG.js 0.8.0. - * - * http://pegjs.majda.cz/ - */ - - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - } - - function SyntaxError(message, expected, found, offset, line, column) { - this.message = message; - this.expected = expected; - this.found = found; - this.offset = offset; - this.line = line; - this.column = column; - - this.name = "SyntaxError"; - } - - peg$subclass(SyntaxError, Error); - - function parse(input) { - var options = arguments.length > 1 ? arguments[1] : {}, - - peg$FAILED = {}, - - peg$startRuleFunctions = { default: peg$parsedefault }, - peg$startRuleFunction = peg$parsedefault, - - peg$c0 = peg$FAILED, - peg$c1 = function(v) {return v}, - peg$c2 = null, - peg$c3 = function() {var result = Number.parseFloat(text()); return Number.isNaN(result)?text():result;}, - peg$c4 = [], - peg$c5 = /^[^'\r\n]/, - peg$c6 = { type: "class", value: "[^'\\r\\n]", description: "[^'\\r\\n]" }, - peg$c7 = function(s) {return s.join('')}, - peg$c8 = function() {return '\''}, - peg$c9 = /^[0-9]/, - peg$c10 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c11 = "'", - peg$c12 = { type: "literal", value: "'", description: "\"'\"" }, - peg$c13 = ".", - peg$c14 = { type: "literal", value: ".", description: "\".\"" }, - peg$c15 = "e", - peg$c16 = { type: "literal", value: "E", description: "\"E\"" }, - peg$c17 = "+", - peg$c18 = { type: "literal", value: "+", description: "\"+\"" }, - peg$c19 = "-", - peg$c20 = { type: "literal", value: "-", description: "\"-\"" }, - peg$c21 = "(", - peg$c22 = { type: "literal", value: "(", description: "\"(\"" }, - peg$c23 = ")", - peg$c24 = { type: "literal", value: ")", description: "\")\"" }, - - peg$currPos = 0, - peg$reportedPos = 0, - peg$cachedPos = 0, - peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, - 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 + "\"."); +// Generated by Peggy 1.2.0. +// +// https://peggyjs.org/ + +"use strict"; + +function peg$subclass(child, parent) { + function C() { this.constructor = child; } + C.prototype = parent.prototype; + child.prototype = new C(); +} + +function peg$SyntaxError(message, expected, found, location) { + var self = Error.call(this, message); + if (Object.setPrototypeOf) { + Object.setPrototypeOf(self, peg$SyntaxError.prototype); + } + self.expected = expected; + self.found = found; + self.location = location; + self.name = "SyntaxError"; + return self; +} + +peg$subclass(peg$SyntaxError, Error); + +function peg$padEnd(str, targetLength, padString) { + padString = padString || " "; + if (str.length > targetLength) { return str; } + targetLength -= str.length; + padString += padString.repeat(targetLength); + return str + padString.slice(0, targetLength); +} + +peg$SyntaxError.prototype.format = function(sources) { + var str = "Error: " + this.message; + if (this.location) { + var src = null; + var k; + for (k = 0; k < sources.length; k++) { + if (sources[k].source === this.location.source) { + src = sources[k].text.split(/\r\n|\n|\r/g); + break; } - - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } - - function text() { - return input.substring(peg$reportedPos, peg$currPos); + var s = this.location.start; + var loc = this.location.source + ":" + s.line + ":" + s.column; + if (src) { + var e = this.location.end; + var filler = peg$padEnd("", s.line.toString().length); + var line = src[s.line - 1]; + var last = s.line === e.line ? e.column : line.length + 1; + str += "\n --> " + loc + "\n" + + filler + " |\n" + + s.line + " | " + line + "\n" + + filler + " | " + peg$padEnd("", s.column - 1) + + peg$padEnd("", last - s.column, "^"); + } else { + str += "\n at " + loc; } - - function offset() { - return peg$reportedPos; + } + return str; +}; + +peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + + class: function(expectation) { + var escapedParts = expectation.parts.map(function(part) { + return Array.isArray(part) + ? classEscape(part[0]) + "-" + classEscape(part[1]) + : classEscape(part); + }); + + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + + any: function() { + return "any character"; + }, + + end: function() { + return "end of input"; + }, + + other: function(expectation) { + return expectation.description; } + }; - function line() { - return peg$computePosDetails(peg$reportedPos).line; - } + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } - function column() { - return peg$computePosDetails(peg$reportedPos).column; - } + 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 expected(description) { - throw peg$buildException( - null, - [{ type: "other", description: description }], - peg$reportedPos - ); - } + 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 error(message) { - throw peg$buildException(message, null, peg$reportedPos); - } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } - function peg$computePosDetails(pos) { - function advance(details, startPos, endPos) { - var p, ch; - - for (p = startPos; p < endPos; p++) { - 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; - } - } - } + function describeExpected(expected) { + var descriptions = expected.map(describeExpectation); + var i, j; + + descriptions.sort(); - if (peg$cachedPos !== pos) { - if (peg$cachedPos > pos) { - peg$cachedPos = 0; - peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; } - advance(peg$cachedPosDetails, peg$cachedPos, pos); - peg$cachedPos = pos; } - - return peg$cachedPosDetails; + descriptions.length = j; } - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } + switch (descriptions.length) { + case 1: + return descriptions[0]; - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } + case 2: + return descriptions[0] + " or " + descriptions[1]; - peg$maxFailExpected.push(expected); + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; } + } - function peg$buildException(message, expected, pos) { - function cleanupExpected(expected) { - var i = 1; + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } - expected.sort(function(a, b) { - if (a.description < b.description) { - return -1; - } else if (a.description > b.description) { - return 1; - } else { - return 0; - } - }); + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; +}; + +function peg$parse(input, options) { + options = options !== undefined ? options : {}; + + var peg$FAILED = {}; + var peg$source = options.grammarSource; + + var peg$startRuleFunctions = { default: peg$parsedefault }; + var peg$startRuleFunction = peg$parsedefault; + + var peg$c0 = "'"; + var peg$c1 = "."; + var peg$c2 = "e"; + var peg$c3 = "+"; + var peg$c4 = "-"; + var peg$c5 = "("; + var peg$c6 = ")"; + + var peg$r0 = /^[^'\r\n]/; + var peg$r1 = /^[0-9]/; + + var peg$e0 = peg$classExpectation(["'", "\r", "\n"], true, false); + var peg$e1 = peg$classExpectation([["0", "9"]], false, false); + var peg$e2 = peg$literalExpectation("'", false); + var peg$e3 = peg$literalExpectation(".", false); + var peg$e4 = peg$literalExpectation("E", true); + var peg$e5 = peg$literalExpectation("+", false); + var peg$e6 = peg$literalExpectation("-", false); + var peg$e7 = peg$literalExpectation("(", false); + var peg$e8 = peg$literalExpectation(")", false); + + var peg$f0 = function(v) {return v}; + var peg$f1 = function() {var result = Number.parseFloat(text()); return Number.isNaN(result)?text():result;}; + var peg$f2 = function(s) {return s.join('')}; + var peg$f3 = function() {return '\''}; + + var peg$currPos = 0; + var peg$savedPos = 0; + var peg$posDetailsCache = [{ line: 1, column: 1 }]; + var peg$maxFailPos = 0; + var peg$maxFailExpected = []; + var peg$silentFails = 0; + + var peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } - while (i < expected.length) { - if (expected[i - 1] === expected[i]) { - expected.splice(i, 1); - } else { - i++; - } - } - } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } - 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(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) - .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); - } + function text() { + return input.substring(peg$savedPos, peg$currPos); + } - var expectedDescs = new Array(expected.length), - expectedDesc, foundDesc, i; + function offset() { + return peg$savedPos; + } - for (i = 0; i < expected.length; i++) { - expectedDescs[i] = expected[i].description; - } + function range() { + return { + source: peg$source, + start: peg$savedPos, + end: peg$currPos + }; + } + + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } - expectedDesc = expected.length > 1 - ? expectedDescs.slice(0, -1).join(", ") - + " or " - + expectedDescs[expected.length - 1] - : expectedDescs[0]; + function expected(description, location) { + location = location !== undefined + ? location + : peg$computeLocation(peg$savedPos, peg$currPos); - foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + throw peg$buildStructuredError( + [peg$otherExpectation(description)], + input.substring(peg$savedPos, peg$currPos), + location + ); + } + + function error(message, location) { + location = location !== undefined + ? location + : peg$computeLocation(peg$savedPos, peg$currPos); + + throw peg$buildSimpleError(message, location); + } + + function peg$literalExpectation(text, ignoreCase) { + return { type: "literal", text: text, ignoreCase: ignoreCase }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; + } + + function peg$anyExpectation() { + return { type: "any" }; + } + + function peg$endExpectation() { + return { type: "end" }; + } - return "Expected " + expectedDesc + " but " + foundDesc + " found."; + function peg$otherExpectation(description) { + return { type: "other", description: description }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos]; + var p; + + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; } - var posDetails = peg$computePosDetails(pos), - found = pos < input.length ? input.charAt(pos) : null; + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; - if (expected !== null) { - cleanupExpected(expected); + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; } - return new SyntaxError( - message !== null ? message : buildMessage(expected, found), - expected, - found, - pos, - posDetails.line, - posDetails.column - ); + peg$posDetailsCache[pos] = details; + + return details; } + } - function peg$parsedefault() { - var s0, s1, s2, s3, s4, s5; + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos); + var endPosDetails = peg$computePosDetails(endPos); + + return { + source: peg$source, + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } - s0 = peg$currPos; - s1 = peg$parselparen(); - if (s1 !== peg$FAILED) { - s2 = peg$parselparen(); - if (s2 !== peg$FAILED) { - s3 = peg$parsedefault_value(); - if (s3 !== peg$FAILED) { - s4 = peg$parserparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parserparen(); - if (s5 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c1(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c0; - } + 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$parsedefault() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parselparen(); + if (s1 !== peg$FAILED) { + s2 = peg$parselparen(); + if (s2 !== peg$FAILED) { + s3 = peg$parsedefault_value(); + if (s3 !== peg$FAILED) { + s4 = peg$parserparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parserparen(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f0(s3); } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parselparen(); - if (s1 !== peg$FAILED) { - s2 = peg$parsedefault_value(); - if (s2 !== peg$FAILED) { - s3 = peg$parserparen(); - if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c1(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c0; - } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parselparen(); + if (s1 !== peg$FAILED) { + s2 = peg$parsedefault_value(); + if (s2 !== peg$FAILED) { + s3 = peg$parserparen(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f0(s2); } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - - return s0; } - function peg$parsedefault_value() { - var s0; + return s0; + } - s0 = peg$parsesigned_number(); - if (s0 === peg$FAILED) { - s0 = peg$parsestring_literal(); - } + function peg$parsedefault_value() { + var s0; - return s0; + s0 = peg$parsesigned_number(); + if (s0 === peg$FAILED) { + s0 = peg$parsestring_literal(); } - function peg$parsesigned_number() { - var s0, s1, s2; + return s0; + } - s0 = peg$currPos; - s1 = peg$parseplus(); - if (s1 === peg$FAILED) { - s1 = peg$parseminus(); - } - if (s1 === peg$FAILED) { - s1 = peg$c2; - } - if (s1 !== peg$FAILED) { - s2 = peg$parsenumeric_literal(); - if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c3(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c0; - } - } else { - peg$currPos = s0; - s0 = peg$c0; - } + function peg$parsesigned_number() { + var s0, s1, s2, s3; - return s0; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseplus(); + if (s2 === peg$FAILED) { + s2 = peg$parseminus(); + } + if (s2 === peg$FAILED) { + s2 = null; + } + s3 = peg$parsenumeric_literal(); + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f1(); + } + s0 = s1; - function peg$parsestring_literal() { - var s0, s1, s2, s3; + return s0; + } - s0 = peg$currPos; - s1 = peg$parsequote(); - if (s1 !== peg$FAILED) { - s2 = []; - if (peg$c5.test(input.charAt(peg$currPos))) { + function peg$parsestring_literal() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsequote(); + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$r0.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e0); } + } + if (s3 === peg$FAILED) { + s3 = peg$parseqq(); + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$r0.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } + if (peg$silentFails === 0) { peg$fail(peg$e0); } } if (s3 === peg$FAILED) { s3 = peg$parseqq(); } - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$c5.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - if (s3 === peg$FAILED) { - s3 = peg$parseqq(); - } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsequote(); - if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c7(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c0; - } - } else { - peg$currPos = s0; - s0 = peg$c0; - } + } + s3 = peg$parsequote(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f2(s2); } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parseqq() { - var s0, s1, s2; + return s0; + } - s0 = peg$currPos; - s1 = peg$parsequote(); - if (s1 !== peg$FAILED) { - s2 = peg$parsequote(); - if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c8(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c0; - } + function peg$parseqq() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsequote(); + if (s1 !== peg$FAILED) { + s2 = peg$parsequote(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f3(); } else { peg$currPos = s0; - s0 = peg$c0; + s0 = peg$FAILED; } - - return s0; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parsenumeric_literal() { - var s0, s1, s2, s3, s4, s5, s6; + return s0; + } - s0 = peg$currPos; - s1 = peg$currPos; - s2 = []; - s3 = peg$parsedigit(); - if (s3 !== peg$FAILED) { - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parsedigit(); + function peg$parsenumeric_literal() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsedigit(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsedigit(); + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + s4 = peg$parsedecimal_point(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parsedigit(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsedigit(); + } + } else { + s5 = peg$FAILED; + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; } } else { - s2 = peg$c0; + peg$currPos = s3; + s3 = peg$FAILED; } + if (s3 === peg$FAILED) { + s3 = null; + } + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 === peg$FAILED) { + s1 = peg$currPos; + s2 = peg$parsedecimal_point(); if (s2 !== peg$FAILED) { - s3 = peg$currPos; - s4 = peg$parsedecimal_point(); + s3 = []; + s4 = peg$parsedigit(); if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$parsedigit(); - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$parsedigit(); - } - } else { - s5 = peg$c0; - } - if (s5 !== peg$FAILED) { - s4 = [s4, s5]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$c0; + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsedigit(); } } else { - peg$currPos = s3; - s3 = peg$c0; - } - if (s3 === peg$FAILED) { - s3 = peg$c2; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s2 = [s2, s3]; s1 = s2; } else { peg$currPos = s1; - s1 = peg$c0; + s1 = peg$FAILED; } } else { peg$currPos = s1; - s1 = peg$c0; + s1 = peg$FAILED; } - if (s1 === peg$FAILED) { - s1 = peg$currPos; - s2 = peg$parsedecimal_point(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$parsedigit(); - if (s4 !== peg$FAILED) { - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parsedigit(); - } - } else { - s3 = peg$c0; - } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$c0; - } - } else { - peg$currPos = s1; - s1 = peg$c0; + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseE(); + if (s3 !== peg$FAILED) { + s4 = peg$parseplus(); + if (s4 === peg$FAILED) { + s4 = peg$parseminus(); } - } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - s3 = peg$parseE(); - if (s3 !== peg$FAILED) { - s4 = peg$parseplus(); - if (s4 === peg$FAILED) { - s4 = peg$parseminus(); - } - if (s4 === peg$FAILED) { - s4 = peg$c2; - } - if (s4 !== peg$FAILED) { - s5 = []; + if (s4 === peg$FAILED) { + s4 = null; + } + s5 = []; + s6 = peg$parsedigit(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); s6 = peg$parsedigit(); - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$parsedigit(); - } - } else { - s5 = peg$c0; - } - if (s5 !== peg$FAILED) { - s3 = [s3, s4, s5]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$c0; - } - } else { - peg$currPos = s2; - s2 = peg$c0; } } else { - peg$currPos = s2; - s2 = peg$c0; + s5 = peg$FAILED; } - if (s2 === peg$FAILED) { - s2 = peg$c2; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; } else { - peg$currPos = s0; - s0 = peg$c0; + peg$currPos = s2; + s2 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$c0; + peg$currPos = s2; + s2 = peg$FAILED; } - - return s0; + if (s2 === peg$FAILED) { + s2 = null; + } + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - function peg$parsedigit() { - var s0; + return s0; + } - 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); } - } + function peg$parsedigit() { + var s0; - return s0; + if (peg$r1.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e1); } } - function peg$parsequote() { - var s0; + return s0; + } - if (input.charCodeAt(peg$currPos) === 39) { - s0 = peg$c11; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } + function peg$parsequote() { + var s0; - return s0; + if (input.charCodeAt(peg$currPos) === 39) { + s0 = peg$c0; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e2); } } - function peg$parsedecimal_point() { - var s0; + return s0; + } - if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c13; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c14); } - } + function peg$parsedecimal_point() { + var s0; - return s0; + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c1; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e3); } } - function peg$parseE() { - var s0; + return s0; + } - if (input.substr(peg$currPos, 1).toLowerCase() === peg$c15) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } + function peg$parseE() { + var s0; - return s0; + if (input.substr(peg$currPos, 1).toLowerCase() === peg$c2) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e4); } } - function peg$parseplus() { - var s0; + return s0; + } - if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c17; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } - } + function peg$parseplus() { + var s0; - return s0; + if (input.charCodeAt(peg$currPos) === 43) { + s0 = peg$c3; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e5); } } - function peg$parseminus() { - var s0; + return s0; + } - if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c19; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c20); } - } + function peg$parseminus() { + var s0; - return s0; + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c4; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e6); } } - function peg$parselparen() { - var s0; + return s0; + } - if (input.charCodeAt(peg$currPos) === 40) { - s0 = peg$c21; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c22); } - } + function peg$parselparen() { + var s0; - return s0; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c5; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e7); } } - function peg$parserparen() { - var s0; + return s0; + } - if (input.charCodeAt(peg$currPos) === 41) { - s0 = peg$c23; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c24); } - } + function peg$parserparen() { + var s0; - return s0; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c6; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e8); } } - peg$result = peg$startRuleFunction(); + return s0; + } - 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); + 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: SyntaxError, - parse: parse - }; -})(); +module.exports = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; diff --git a/parsers/mssqlSP.js b/parsers/mssqlSP.js index 86990bc..eb4f054 100644 --- a/parsers/mssqlSP.js +++ b/parsers/mssqlSP.js @@ -1,62 +1,95 @@ -/* - * Generated by PEG.js 0.10.0. - * - * http://pegjs.org/ - */ +// Generated by Peggy 1.2.0. +// +// https://peggyjs.org/ "use strict"; function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); + function C() { this.constructor = child; } + C.prototype = parent.prototype; + child.prototype = new C(); } 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); + var self = Error.call(this, message); + if (Object.setPrototypeOf) { + Object.setPrototypeOf(self, peg$SyntaxError.prototype); } + self.expected = expected; + self.found = found; + self.location = location; + self.name = "SyntaxError"; + return self; } peg$subclass(peg$SyntaxError, Error); +function peg$padEnd(str, targetLength, padString) { + padString = padString || " "; + if (str.length > targetLength) { return str; } + targetLength -= str.length; + padString += padString.repeat(targetLength); + return str + padString.slice(0, targetLength); +} + +peg$SyntaxError.prototype.format = function(sources) { + var str = "Error: " + this.message; + if (this.location) { + var src = null; + var k; + for (k = 0; k < sources.length; k++) { + if (sources[k].source === this.location.source) { + src = sources[k].text.split(/\r\n|\n|\r/g); + break; + } + } + var s = this.location.start; + var loc = this.location.source + ":" + s.line + ":" + s.column; + if (src) { + var e = this.location.end; + var filler = peg$padEnd("", s.line.toString().length); + var line = src[s.line - 1]; + var last = s.line === e.line ? e.column : line.length + 1; + str += "\n --> " + loc + "\n" + + filler + " |\n" + + s.line + " | " + line + "\n" + + filler + " | " + peg$padEnd("", s.column - 1) + + peg$padEnd("", last - s.column, "^"); + } else { + str += "\n at " + loc; + } + } + return str; +}; + peg$SyntaxError.buildMessage = function(expected, found) { var DESCRIBE_EXPECTATION_FNS = { - literal: function(expectation) { - return "\"" + literalEscape(expectation.text) + "\""; - }, - - "class": function(expectation) { - var escapedParts = "", - i; - - 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]); - } + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; - }, + class: function(expectation) { + var escapedParts = expectation.parts.map(function(part) { + return Array.isArray(part) + ? classEscape(part[0]) + "-" + classEscape(part[1]) + : classEscape(part); + }); - any: function(expectation) { - return "any character"; - }, + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, - end: function(expectation) { - return "end of input"; - }, + any: function() { + return "any character"; + }, - other: function(expectation) { - return expectation.description; - } - }; + end: function() { + return "end of input"; + }, + + other: function(expectation) { + return expectation.description; + } + }; function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); @@ -64,28 +97,28 @@ peg$SyntaxError.buildMessage = function(expected, found) { 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); }); + .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 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); }); + .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 describeExpectation(expectation) { @@ -93,12 +126,8 @@ peg$SyntaxError.buildMessage = function(expected, found) { } function describeExpected(expected) { - var descriptions = new Array(expected.length), - i, j; - - for (i = 0; i < expected.length; i++) { - descriptions[i] = describeExpectation(expected[i]); - } + var descriptions = expected.map(describeExpectation); + var i, j; descriptions.sort(); @@ -134,549 +163,553 @@ peg$SyntaxError.buildMessage = function(expected, found) { }; function peg$parse(input, options) { - options = options !== void 0 ? options : {}; - - var peg$FAILED = {}, - - peg$startRuleFunctions = { create: peg$parsecreate, createBody: peg$parsecreateBody }, - peg$startRuleFunction = peg$parsecreate, - - peg$c0 = "alter", - peg$c1 = peg$literalExpectation("ALTER", true), - peg$c2 = "create", - peg$c3 = peg$literalExpectation("CREATE", true), - peg$c4 = function(schema, table, doc, params) { - return { - type:'procedure', - name: '['+schema+'].['+table+']', - schema: schema, - table: table, - doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - params:params - } - }, - peg$c5 = function(schema, table, doc, params) { - return {schema, table, doc, params, text: text()} - }, - peg$c6 = function(header, body) { - return { - body: header.text + body.text, - statements: body.statements, - type:'procedure', - name: '['+header.schema+'].['+header.table+']', - schema: header.schema, - table: header.table, - doc: header.doc && header.doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - params:header.params - } - }, - peg$c7 = function(schema, table, doc, fields) { - return { - type:'table type', - name: '['+schema+'].['+table+']', - schema: schema, - table: table, - doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - fields:fields - } - }, - peg$c8 = function(schema, table, doc, fc, options) { - return { - type: 'table', - name: '['+schema+'].['+table+']', - schema: schema, - table: table, - doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - options: options && parseJSON(options.multi || options.single || ''), - fields: fc.filter(function(x){return x.isField}), - indexes: fc.filter(function(x){return x.type === 'INDEX'}), - constraints: fc.filter(function(x){return x.isConstraint}) - } - }, - peg$c9 = "[", - peg$c10 = peg$literalExpectation("[", false), - peg$c11 = /^[^\]]/, - peg$c12 = peg$classExpectation(["]"], true, false), - peg$c13 = "]", - peg$c14 = peg$literalExpectation("]", false), - peg$c15 = function(str) {return str}, - peg$c16 = /^[A-Za-z0-9_$]/, - peg$c17 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "$"], false, false), - peg$c18 = function(n, o, nn, oo) { - return { - name: nn, - order: oo - } - }, - peg$c19 = function(n, o, m) { - m.unshift({ - name: n, - order: o - }); - return m - }, - peg$c20 = ".", - peg$c21 = peg$literalExpectation(".", false), - peg$c22 = function(name) {return name}, - peg$c23 = function(name) {return '['+name+'].'}, - peg$c24 = function(ns, n) {return (ns||'')+'['+n+']'}, - peg$c25 = function(f, p, ws, r) { return [ws, r]}, - peg$c26 = function(f, p, q, e) { - - var x=[p]; - q.forEach(function(pp){ - x.push(pp[0]); - x.push(pp[1]); - }); - x.push(e) - var lastParam; - var lastComment=f[0] && f[f.length-1].multi; - var y = []; - x.forEach(function(pp, i){ - if (i % 2 === 0) { - lastParam = pp; - lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); - y.push(pp); - } else { - if (pp.length && pp[0]){ - pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); - lastComment = pp[pp.length-1].multi; - pp[0].multi && (lastComment = pp[0].multi); - } - } - }); - return y - - }, - peg$c27 = function(f, p, q, e) { - - var x=[p]; - q.forEach(function(pp){ - x.push(pp[0]); - x.push(pp[1]); - }); - x.push(e) - var lastParam; - var lastComment=f[0] && f[f.length-1].multi; - var y = []; - x.forEach(function(pp, i){ - if (i % 2 === 0) { - lastParam = pp; - lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); - y.push(pp); - } else { - if (pp.length && pp[0]){ - pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); - lastComment = pp[pp.length-1].multi; - pp[0].multi && (lastComment = pp[0].multi); - } + options = options !== undefined ? options : {}; + + var peg$FAILED = {}; + var peg$source = options.grammarSource; + + var peg$startRuleFunctions = { create: peg$parsecreate, createBody: peg$parsecreateBody }; + var peg$startRuleFunction = peg$parsecreate; + + var peg$c0 = "alter"; + var peg$c1 = "create"; + var peg$c2 = "["; + var peg$c3 = "]"; + var peg$c4 = "."; + var peg$c5 = "="; + var peg$c6 = "readonly"; + var peg$c7 = "@"; + var peg$c8 = "default"; + var peg$c9 = "CONSTRAINT"; + var peg$c10 = "primary key"; + var peg$c11 = "clustered"; + var peg$c12 = "nonclustered"; + var peg$c13 = "asc"; + var peg$c14 = "desc"; + var peg$c15 = "no action"; + var peg$c16 = "set default"; + var peg$c17 = "set null"; + var peg$c18 = "cascade"; + var peg$c19 = "restrict"; + var peg$c20 = "delete"; + var peg$c21 = "update"; + var peg$c22 = "insert"; + var peg$c23 = "foreign key"; + var peg$c24 = "references"; + var peg$c25 = "on"; + var peg$c26 = "unique"; + var peg$c27 = "check"; + var peg$c28 = "("; + var peg$c29 = ")"; + var peg$c30 = "null"; + var peg$c31 = "not null"; + var peg$c32 = "IDENTITY"; + var peg$c33 = "max"; + var peg$c34 = "'"; + var peg$c35 = "e"; + var peg$c36 = "type"; + var peg$c37 = "procedure"; + var peg$c38 = "as"; + var peg$c39 = "table"; + var peg$c40 = "+"; + var peg$c41 = "-"; + var peg$c42 = ","; + var peg$c43 = "output"; + var peg$c44 = "out"; + var peg$c45 = "\t"; + var peg$c46 = "\v"; + var peg$c47 = "\f"; + var peg$c48 = " "; + var peg$c49 = "\xA0"; + var peg$c50 = "\uFEFF"; + var peg$c51 = "\n"; + var peg$c52 = "\r\n"; + var peg$c53 = "\r"; + var peg$c54 = "\u2028"; + var peg$c55 = "\u2029"; + var peg$c56 = "*/"; + var peg$c57 = "/*"; + var peg$c58 = "--"; + var peg$c59 = "index"; + var peg$c60 = "WHERE"; + var peg$c61 = "case"; + var peg$c62 = "end"; + var peg$c63 = "from"; + var peg$c64 = "join"; + var peg$c65 = "into"; + var peg$c66 = ";"; + var peg$c67 = "set"; + var peg$c68 = "select"; + var peg$c69 = "declare"; + var peg$c70 = "cursor"; + var peg$c71 = "open"; + var peg$c72 = "fetch"; + var peg$c73 = "close"; + var peg$c74 = "deallocate"; + var peg$c75 = "begin"; + var peg$c76 = "try"; + var peg$c77 = "catch"; + var peg$c78 = "else"; + var peg$c79 = "if"; + var peg$c80 = "while"; + var peg$c81 = "raiserror"; + var peg$c82 = "throw"; + var peg$c83 = "return"; + var peg$c84 = "rollback"; + var peg$c85 = "transaction"; + var peg$c86 = "commit"; + var peg$c87 = "exec"; + var peg$c88 = "drop"; + var peg$c89 = "merge"; + var peg$c90 = "when"; + var peg$c91 = "union"; + var peg$c92 = "all"; + var peg$c93 = "rename"; + var peg$c94 = "with"; + var peg$c95 = "deny"; + var peg$c96 = "grant"; + var peg$c97 = "revoke"; + var peg$c98 = "truncate"; + var peg$c99 = "disable"; + var peg$c100 = "trigger"; + var peg$c101 = "enable"; + var peg$c102 = "bulk"; + var peg$c103 = "waitfor"; + var peg$c104 = "except"; + var peg$c105 = "intersect"; + + var peg$r0 = /^[^\]]/; + var peg$r1 = /^[A-Za-z0-9_$]/; + var peg$r2 = /^[^()]/; + var peg$r3 = /^[^']/; + var peg$r4 = /^[0-9]/; + var peg$r5 = /^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; + var peg$r6 = /^[\n\r\u2028\u2029]/; + var peg$r7 = /^[^A-Za-z0-9_]/; + + var peg$e0 = peg$literalExpectation("ALTER", true); + var peg$e1 = peg$literalExpectation("CREATE", true); + var peg$e2 = peg$literalExpectation("[", false); + var peg$e3 = peg$classExpectation(["]"], true, false); + var peg$e4 = peg$literalExpectation("]", false); + var peg$e5 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "$"], false, false); + var peg$e6 = peg$literalExpectation(".", false); + var peg$e7 = peg$literalExpectation("=", false); + var peg$e8 = peg$literalExpectation("READONLY", true); + var peg$e9 = peg$literalExpectation("@", false); + var peg$e10 = peg$literalExpectation("DEFAULT", true); + var peg$e11 = peg$literalExpectation("CONSTRAINT", false); + var peg$e12 = peg$literalExpectation("PRIMARY KEY", true); + var peg$e13 = peg$literalExpectation("CLUSTERED", true); + var peg$e14 = peg$literalExpectation("NONCLUSTERED", true); + var peg$e15 = peg$literalExpectation("ASC", true); + var peg$e16 = peg$literalExpectation("DESC", true); + var peg$e17 = peg$literalExpectation("NO ACTION", true); + var peg$e18 = peg$literalExpectation("SET DEFAULT", true); + var peg$e19 = peg$literalExpectation("SET NULL", true); + var peg$e20 = peg$literalExpectation("CASCADE", true); + var peg$e21 = peg$literalExpectation("RESTRICT", true); + var peg$e22 = peg$literalExpectation("DELETE", true); + var peg$e23 = peg$literalExpectation("UPDATE", true); + var peg$e24 = peg$literalExpectation("INSERT", true); + var peg$e25 = peg$literalExpectation("FOREIGN KEY", true); + var peg$e26 = peg$literalExpectation("REFERENCES", true); + var peg$e27 = peg$literalExpectation("ON", true); + var peg$e28 = peg$literalExpectation("UNIQUE", true); + var peg$e29 = peg$literalExpectation("CHECK", true); + var peg$e30 = peg$classExpectation(["(", ")"], true, false); + var peg$e31 = peg$literalExpectation("(", false); + var peg$e32 = peg$literalExpectation(")", false); + var peg$e33 = peg$literalExpectation("NULL", true); + var peg$e34 = peg$literalExpectation("NOT NULL", true); + var peg$e35 = peg$literalExpectation("IDENTITY", false); + var peg$e36 = peg$literalExpectation("max", true); + var peg$e37 = peg$classExpectation(["'"], true, false); + var peg$e38 = peg$classExpectation([["0", "9"]], false, false); + var peg$e39 = peg$literalExpectation("'", false); + var peg$e40 = peg$literalExpectation("E", true); + var peg$e41 = peg$literalExpectation("TYPE", true); + var peg$e42 = peg$literalExpectation("PROCEDURE", true); + var peg$e43 = peg$literalExpectation("AS", true); + var peg$e44 = peg$literalExpectation("TABLE", true); + var peg$e45 = peg$anyExpectation(); + var peg$e46 = peg$literalExpectation("+", false); + var peg$e47 = peg$literalExpectation("-", false); + var peg$e48 = peg$literalExpectation(",", false); + var peg$e49 = peg$literalExpectation("output", true); + var peg$e50 = peg$literalExpectation("out", true); + var peg$e51 = peg$classExpectation([" ", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u202F", "\u205F", "\u3000"], false, false); + var peg$e52 = peg$otherExpectation("whitespace"); + var peg$e53 = peg$literalExpectation("\t", false); + var peg$e54 = peg$literalExpectation("\v", false); + var peg$e55 = peg$literalExpectation("\f", false); + var peg$e56 = peg$literalExpectation(" ", false); + var peg$e57 = peg$literalExpectation("\xA0", false); + var peg$e58 = peg$literalExpectation("\uFEFF", false); + var peg$e59 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false); + var peg$e60 = peg$otherExpectation("end of line"); + var peg$e61 = peg$literalExpectation("\n", false); + var peg$e62 = peg$literalExpectation("\r\n", false); + var peg$e63 = peg$literalExpectation("\r", false); + var peg$e64 = peg$literalExpectation("\u2028", false); + var peg$e65 = peg$literalExpectation("\u2029", false); + var peg$e66 = peg$otherExpectation("comment"); + var peg$e67 = peg$literalExpectation("*/", false); + var peg$e68 = peg$literalExpectation("/*", false); + var peg$e69 = peg$literalExpectation("--", false); + var peg$e70 = peg$literalExpectation("INDEX", true); + var peg$e71 = peg$literalExpectation("WHERE", false); + var peg$e72 = peg$literalExpectation("CASE", true); + var peg$e73 = peg$literalExpectation("END", true); + var peg$e74 = peg$literalExpectation("FROM", true); + var peg$e75 = peg$literalExpectation("JOIN", true); + var peg$e76 = peg$literalExpectation("INTO", true); + var peg$e77 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], true, false); + var peg$e78 = peg$literalExpectation(";", false); + var peg$e79 = peg$literalExpectation("SET", true); + var peg$e80 = peg$literalExpectation("SELECT", true); + var peg$e81 = peg$literalExpectation("DECLARE", true); + var peg$e82 = peg$literalExpectation("CURSOR", true); + var peg$e83 = peg$literalExpectation("OPEN", true); + var peg$e84 = peg$literalExpectation("FETCH", true); + var peg$e85 = peg$literalExpectation("CLOSE", true); + var peg$e86 = peg$literalExpectation("DEALLOCATE", true); + var peg$e87 = peg$literalExpectation("BEGIN", true); + var peg$e88 = peg$literalExpectation("TRY", true); + var peg$e89 = peg$literalExpectation("CATCH", true); + var peg$e90 = peg$literalExpectation("ELSE", true); + var peg$e91 = peg$literalExpectation("IF", true); + var peg$e92 = peg$literalExpectation("WHILE", true); + var peg$e93 = peg$literalExpectation("RAISERROR", true); + var peg$e94 = peg$literalExpectation("THROW", true); + var peg$e95 = peg$literalExpectation("RETURN", true); + var peg$e96 = peg$literalExpectation("ROLLBACK", true); + var peg$e97 = peg$literalExpectation("TRANSACTION", true); + var peg$e98 = peg$literalExpectation("COMMIT", true); + var peg$e99 = peg$literalExpectation("EXEC", true); + var peg$e100 = peg$literalExpectation("DROP", true); + var peg$e101 = peg$literalExpectation("MERGE", true); + var peg$e102 = peg$literalExpectation("WHEN", true); + var peg$e103 = peg$literalExpectation("UNION", true); + var peg$e104 = peg$literalExpectation("ALL", true); + var peg$e105 = peg$literalExpectation("RENAME", true); + var peg$e106 = peg$literalExpectation("WITH", true); + var peg$e107 = peg$literalExpectation("DENY", true); + var peg$e108 = peg$literalExpectation("GRANT", true); + var peg$e109 = peg$literalExpectation("REVOKE", true); + var peg$e110 = peg$literalExpectation("TRUNCATE", true); + var peg$e111 = peg$literalExpectation("DISABLE", true); + var peg$e112 = peg$literalExpectation("TRIGGER", true); + var peg$e113 = peg$literalExpectation("ENABLE", true); + var peg$e114 = peg$literalExpectation("BULK", true); + var peg$e115 = peg$literalExpectation("WAITFOR", true); + var peg$e116 = peg$literalExpectation("EXCEPT", true); + var peg$e117 = peg$literalExpectation("INTERSECT", true); + + var peg$f0 = function(schema, table, doc, params) { + return { + type:'procedure', + name: '['+schema+'].['+table+']', + schema: schema, + table: table, + doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + params:params } - }); - return y - - - }, - peg$c28 = function(f, p, ws, r) {return [ws, r]}, - peg$c29 = function(f, p, q, e) { - var x=[p]; - q.forEach(function(pp){ - x.push(pp[0]); - x.push(pp[1]); - }); - x.push(e) - var lastParam; - var lastComment=f[0] && f[f.length-1].multi; - var y = []; - x.forEach(function(pp, i){ - if (i % 2 === 0) { - lastParam = pp; - lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); - y.push(pp); - } else { - if (pp.length && pp[0]){ - pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); - lastComment = pp[pp.length-1].multi; - pp[0].multi && (lastComment = pp[0].multi); - } + }; + var peg$f1 = function(schema, table, doc, params) { + return {schema, table, doc, params, text: text()} + }; + var peg$f2 = function(header, body) { + return { + body: header.text + body.text, + statements: body.statements, + type:'procedure', + name: '['+header.schema+'].['+header.table+']', + schema: header.schema, + table: header.table, + doc: header.doc && header.doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + params:header.params } - }); - return y - - }, - peg$c30 = "=", - peg$c31 = peg$literalExpectation("=", false), - peg$c32 = "readonly", - peg$c33 = peg$literalExpectation("READONLY", true), - peg$c34 = function(n, t, d, o) {return {name:n, def:t, out:!!o, default:!!d}}, - peg$c35 = "@", - peg$c36 = peg$literalExpectation("@", false), - peg$c37 = function(n) {return n}, - peg$c38 = function(n, t, i, not_nullable, d) { - var identity = !!i; - var result = { - column:n, - type:t.type, - nullable:!not_nullable, - length:Array.isArray(t.size) ? t.size[0] : t.size, - scale:Array.isArray(t.size) ? t.size[1] : null, - identity: i || false, - isField:true, - default:d + }; + var peg$f3 = function(schema, table, doc, fields) { + return { + type:'table type', + name: '['+schema+'].['+table+']', + schema: schema, + table: table, + doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + fields:fields } - return result - }, - peg$c39 = "default", - peg$c40 = peg$literalExpectation("DEFAULT", true), - peg$c41 = function(v) {return v}, - peg$c42 = function() {return null}, - peg$c43 = "CONSTRAINT", - peg$c44 = peg$literalExpectation("CONSTRAINT", false), - peg$c45 = function(n, c) { - c.isConstraint = true; - c.name = n; - return c - }, - peg$c46 = "primary key", - peg$c47 = peg$literalExpectation("PRIMARY KEY", true), - peg$c48 = function(c, n) { - return { - type: "PRIMARY KEY", - clustered: !!c && c.toLowerCase() === "clustered", - columns: n - } - }, - peg$c49 = "clustered", - peg$c50 = peg$literalExpectation("CLUSTERED", true), - peg$c51 = "nonclustered", - peg$c52 = peg$literalExpectation("NONCLUSTERED", true), - peg$c53 = "asc", - peg$c54 = peg$literalExpectation("ASC", true), - peg$c55 = "desc", - peg$c56 = peg$literalExpectation("DESC", true), - peg$c57 = "no action", - peg$c58 = peg$literalExpectation("NO ACTION", true), - peg$c59 = "set default", - peg$c60 = peg$literalExpectation("SET DEFAULT", true), - peg$c61 = "set null", - peg$c62 = peg$literalExpectation("SET NULL", true), - peg$c63 = "cascade", - peg$c64 = peg$literalExpectation("CASCADE", true), - peg$c65 = "restrict", - peg$c66 = peg$literalExpectation("RESTRICT", true), - peg$c67 = "delete", - peg$c68 = peg$literalExpectation("DELETE", true), - peg$c69 = "update", - peg$c70 = peg$literalExpectation("UPDATE", true), - peg$c71 = "insert", - peg$c72 = peg$literalExpectation("INSERT", true), - peg$c73 = "foreign key", - peg$c74 = peg$literalExpectation("FOREIGN KEY", true), - peg$c75 = "references", - peg$c76 = peg$literalExpectation("REFERENCES", true), - peg$c77 = function(n, t, c, a) { + }; + var peg$f4 = function(schema, table, doc, fc, options) { + return { + type: 'table', + name: '['+schema+'].['+table+']', + schema: schema, + table: table, + doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + options: options && parseJSON(options.multi || options.single || ''), + fields: fc.filter(function(x){return x.isField}), + indexes: fc.filter(function(x){return x.type === 'INDEX'}), + constraints: fc.filter(function(x){return x.isConstraint}) + } + }; + var peg$f5 = function(str) {return str}; + var peg$f6 = function(n, o, nn, oo) { return { - type: "FOREIGN KEY", - referenceTable: t, - referenceColumn: c, - actionClauses: a - } - }, - peg$c78 = "on", - peg$c79 = peg$literalExpectation("ON", true), - peg$c80 = function(c, a) { - return { - type: "CLAUSE_ACTION", - clause: c, - action: a - } - }, - peg$c81 = function(w, ac) {return [w, ac]}, - peg$c82 = function(q) { - var y = []; - q.forEach(function(pp){ - y.push(pp[1]); - }); - return y; - }, - peg$c83 = "unique", - peg$c84 = peg$literalExpectation("UNIQUE", true), - peg$c85 = function(c, n) { - return { - type: "UNIQUE", - columns: n + name: nn, + order: oo } - }, - peg$c86 = "check", - peg$c87 = peg$literalExpectation("CHECK", true), - peg$c88 = function(e) { - return { - type: "CHECK", - expression: e - } - }, - peg$c89 = function() {return text()}, - peg$c90 = /^[^()]/, - peg$c91 = peg$classExpectation(["(", ")"], true, false), - peg$c92 = "(", - peg$c93 = peg$literalExpectation("(", false), - peg$c94 = ")", - peg$c95 = peg$literalExpectation(")", false), - peg$c96 = "null", - peg$c97 = peg$literalExpectation("NULL", true), - peg$c98 = "not null", - peg$c99 = peg$literalExpectation("NOT NULL", true), - peg$c100 = function(x) {return x.toLowerCase() === "not null"}, - peg$c101 = "IDENTITY", - peg$c102 = peg$literalExpectation("IDENTITY", false), - peg$c103 = function(a) {return a || {}}, - peg$c104 = function(s, i) {return {seed: s, increment: i}}, - peg$c105 = function(n1, n2) {return {type:'table', typeName:n1+'.'+n2}}, - peg$c106 = "max", - peg$c107 = peg$literalExpectation("max", true), - peg$c108 = function(n, s) {return s}, - peg$c109 = function(n, s1, s2) {return [s1,s2]}, - peg$c110 = function(n, size) { - return {type:n.toLowerCase(), size:defaultSize(n.toLowerCase(), size)} - }, - peg$c111 = function() {var result = Number.parseFloat(text()); return Number.isNaN(result)?text():result;}, - peg$c112 = /^[^']/, - peg$c113 = peg$classExpectation(["'"], true, false), - peg$c114 = function(s) {return s.join('')}, - peg$c115 = function() {return '\''}, - peg$c116 = /^[0-9]/, - peg$c117 = peg$classExpectation([["0", "9"]], false, false), - peg$c118 = "'", - peg$c119 = peg$literalExpectation("'", false), - peg$c120 = "e", - peg$c121 = peg$literalExpectation("E", true), - peg$c122 = function() {return }, - peg$c123 = function(ws) {return ws.filter(function(x){return x})}, - peg$c124 = "type", - peg$c125 = peg$literalExpectation("TYPE", true), - peg$c126 = "procedure", - peg$c127 = peg$literalExpectation("PROCEDURE", true), - peg$c128 = "as", - peg$c129 = peg$literalExpectation("AS", true), - peg$c130 = "table", - peg$c131 = peg$literalExpectation("TABLE", true), - peg$c132 = peg$anyExpectation(), - peg$c133 = "+", - peg$c134 = peg$literalExpectation("+", false), - peg$c135 = "-", - peg$c136 = peg$literalExpectation("-", false), - peg$c137 = ",", - peg$c138 = peg$literalExpectation(",", false), - peg$c139 = "output", - peg$c140 = peg$literalExpectation("output", true), - peg$c141 = "out", - peg$c142 = peg$literalExpectation("out", true), - peg$c143 = /^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, - peg$c144 = peg$classExpectation([" ", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u202F", "\u205F", "\u3000"], false, false), - peg$c145 = peg$otherExpectation("whitespace"), - peg$c146 = "\t", - peg$c147 = peg$literalExpectation("\t", false), - peg$c148 = "\x0B", - peg$c149 = peg$literalExpectation("\x0B", false), - peg$c150 = "\f", - peg$c151 = peg$literalExpectation("\f", false), - peg$c152 = " ", - peg$c153 = peg$literalExpectation(" ", false), - peg$c154 = "\xA0", - peg$c155 = peg$literalExpectation("\xA0", false), - peg$c156 = "\uFEFF", - peg$c157 = peg$literalExpectation("\uFEFF", false), - peg$c158 = /^[\n\r\u2028\u2029]/, - peg$c159 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false), - peg$c160 = peg$otherExpectation("end of line"), - peg$c161 = "\n", - peg$c162 = peg$literalExpectation("\n", false), - peg$c163 = "\r\n", - peg$c164 = peg$literalExpectation("\r\n", false), - peg$c165 = "\r", - peg$c166 = peg$literalExpectation("\r", false), - peg$c167 = "\u2028", - peg$c168 = peg$literalExpectation("\u2028", false), - peg$c169 = "\u2029", - peg$c170 = peg$literalExpectation("\u2029", false), - peg$c171 = peg$otherExpectation("comment"), - peg$c172 = "*/", - peg$c173 = peg$literalExpectation("*/", false), - peg$c174 = function() {return {multi:text()}}, - peg$c175 = "/*", - peg$c176 = peg$literalExpectation("/*", false), - peg$c177 = function(x) {return x}, - peg$c178 = function() {return {single:text()}}, - peg$c179 = "--", - peg$c180 = peg$literalExpectation("--", false), - peg$c181 = "index", - peg$c182 = peg$literalExpectation("INDEX", true), - peg$c183 = "WHERE", - peg$c184 = peg$literalExpectation("WHERE", false), - peg$c185 = function(n, u, c, col) {return text().trim()}, - peg$c186 = function(n, u, c, col, filter) {return filter}, - peg$c187 = function(n, u, c, col, filter) { - return { - type: "INDEX", + }; + var peg$f7 = function(n, o, m) { + m.unshift({ name: n, - clustered: !!c && c.toLowerCase() === "clustered", - unique: !!u && u.toLowerCase() === "unique", - columns: col, - filter - } - }, - peg$c188 = function(x) { - const result = []; - x.forEach(item => { - if (item?.start) { - result.push(item) - } else { - result[result.length-1].statement += item.statement; - if (!item?.whitespace) result[result.length-1].location.end = item.location.end; - } - if (!item?.whitespace) { - result[result.length-1].index = result[result.length-1].statement.length; - if (/@@ROWCOUNT|ROWCOUNT_BIG/i.test(item.statement)) result[result.length-1].rowcount = true; - } - if (item?.reference) { - result[result.length-1].reference||=[]; - if (!result[result.length-1].reference.includes(item.reference)) result[result.length-1].reference.push(item.reference); - } - }) - const statements = result.reduceRight((prev, item) => { - if ( - (prev.length && prev[0].rowcount) || - (prev.length && prev[0].statement.startsWith(';')) || - (prev.length && prev[0].statement.match(/^(INSERT|UPDATE|DELETE|SET)\b/i) && item.statement.match(/^WHEN\b/i)) || - (prev.length && prev[0].statement.match(/^WHEN\b/i) && item.statement.match(/^(MERGE|WITH|INSERT|DELETE|UPDATE|SET)\b/i)) || - (prev.length && prev[0].statement.match(/^WITH\b/i) && item.statement.match(/^MERGE\b/i)) || - (prev.length && prev[0].statement.match(/^(WITH|UNION|EXCEPT|INTERSECT)\b/i) && item.statement.match(/^SELECT\b/i)) || - (prev.length && prev[0].statement.match(/^(UPDATE|INSERT|MERGE)\b/i) && item.statement.match(/^WITH\b/i)) || - (prev.length && prev[0].statement.match(/^SELECT\b/i) && item.statement.match(/^(INSERT|WITH|UNION|CURSOR|EXCEPT|INTERSECT)\b/i)) || - (prev.length && prev[0].statement.match(/^SET\b/i) && item.statement.match(/^UPDATE\b/i)) || - (prev.length && prev[0].statement.match(/^EXEC\b/i) && item.statement.match(/^INSERT\b/i)) || - (prev.length && prev[0].statement.match(/^CURSOR\b/i) && item.statement.match(/^DECLARE\b/i)) - ) { - prev[0].statement = item.statement + prev[0].statement; - prev[0].index += item.statement.length; - prev[0].location.start = item.location.start; - prev[0].rowcount = item.rowcount; - } else { - item.original = item.statement; - prev.unshift(item); - } - return prev; - }, []); + order: o + }); + return m + }; + var peg$f8 = function(name) {return name}; + var peg$f9 = function(name) {return '['+name+'].'}; + var peg$f10 = function(ns, n) {return (ns||'')+'['+n+']'}; + var peg$f11 = function(f, p, ws, r) { return [ws, r]}; + var peg$f12 = function(f, p, q, e) { + + var x=[p]; + q.forEach(function(pp){ + x.push(pp[0]); + x.push(pp[1]); + }); + x.push(e) + var lastParam; + var lastComment=f[0] && f[f.length-1].multi; + var y = []; + x.forEach(function(pp, i){ + if (i % 2 === 0) { + lastParam = pp; + lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); + y.push(pp); + } else { + if (pp.length && pp[0]){ + pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); + lastComment = pp[pp.length-1].multi; + pp[0].multi && (lastComment = pp[0].multi); + } + } + }); + return y + + }; + var peg$f13 = function(f, p, q, e) { + + var x=[p]; + q.forEach(function(pp){ + x.push(pp[0]); + x.push(pp[1]); + }); + x.push(e) + var lastParam; + var lastComment=f[0] && f[f.length-1].multi; + var y = []; + x.forEach(function(pp, i){ + if (i % 2 === 0) { + lastParam = pp; + lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); + y.push(pp); + } else { + if (pp.length && pp[0]){ + pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); + lastComment = pp[pp.length-1].multi; + pp[0].multi && (lastComment = pp[0].multi); + } + } + }); + return y + + + }; + var peg$f14 = function(f, p, ws, r) {return [ws, r]}; + var peg$f15 = function(f, p, q, e) { + var x=[p]; + q.forEach(function(pp){ + x.push(pp[0]); + x.push(pp[1]); + }); + x.push(e) + var lastParam; + var lastComment=f[0] && f[f.length-1].multi; + var y = []; + x.forEach(function(pp, i){ + if (i % 2 === 0) { + lastParam = pp; + lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); + y.push(pp); + } else { + if (pp.length && pp[0]){ + pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); + lastComment = pp[pp.length-1].multi; + pp[0].multi && (lastComment = pp[0].multi); + } + } + }); + return y + + }; + var peg$f16 = function(n, t, d, o) {return {name:n, def:t, out:!!o, default:!!d}}; + var peg$f17 = function(n) {return n}; + var peg$f18 = function(n, t, i, not_nullable, d) { + var identity = !!i; + var result = { + column:n, + type:t.type, + nullable:!not_nullable, + length:Array.isArray(t.size) ? t.size[0] : t.size, + scale:Array.isArray(t.size) ? t.size[1] : null, + identity: i || false, + isField:true, + default:d + } + return result + }; + var peg$f19 = function(v) {return v}; + var peg$f20 = function() {return null}; + var peg$f21 = function(n, c) { + c.isConstraint = true; + c.name = n; + return c + }; + var peg$f22 = function(c, n) { + return { + type: "PRIMARY KEY", + clustered: !!c && c.toLowerCase() === "clustered", + columns: n + } + }; + var peg$f23 = function(n, t, c, a) { + return { + type: "FOREIGN KEY", + referenceTable: t, + referenceColumn: c, + actionClauses: a + } + }; + var peg$f24 = function(c, a) { + return { + type: "CLAUSE_ACTION", + clause: c, + action: a + } + }; + var peg$f25 = function(w, ac) {return [w, ac]}; + var peg$f26 = function(q) { + var y = []; + q.forEach(function(pp){ + y.push(pp[1]); + }); + return y; + }; + var peg$f27 = function(c, n) { return { - text: statements.map(instrument).join('') + '\n', - statements + type: "UNIQUE", + columns: n } - }, - peg$c189 = function() {return {whitespace: true, statement: text(), location: location()}}, - peg$c190 = function() {return {statement: text(), location: location()}}, - peg$c191 = function(relation) {return {statement: text(), location: location(), reference: relation.reference}}, - peg$c192 = function() {return {start: true, statement: text(), location: location()}}, - peg$c193 = "case", - peg$c194 = peg$literalExpectation("CASE", true), - peg$c195 = "end", - peg$c196 = peg$literalExpectation("END", true), - peg$c197 = "from", - peg$c198 = peg$literalExpectation("FROM", true), - peg$c199 = "join", - peg$c200 = peg$literalExpectation("JOIN", true), - peg$c201 = "into", - peg$c202 = peg$literalExpectation("INTO", true), - peg$c203 = function(reference) {return {reference}}, - peg$c204 = /^[^A-Za-z0-9_]/, - peg$c205 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], true, false), - peg$c206 = ";", - peg$c207 = peg$literalExpectation(";", false), - peg$c208 = "set", - peg$c209 = peg$literalExpectation("SET", true), - peg$c210 = "select", - peg$c211 = peg$literalExpectation("SELECT", true), - peg$c212 = "declare", - peg$c213 = peg$literalExpectation("DECLARE", true), - peg$c214 = "cursor", - peg$c215 = peg$literalExpectation("CURSOR", true), - peg$c216 = "open", - peg$c217 = peg$literalExpectation("OPEN", true), - peg$c218 = "fetch", - peg$c219 = peg$literalExpectation("FETCH", true), - peg$c220 = "close", - peg$c221 = peg$literalExpectation("CLOSE", true), - peg$c222 = "deallocate", - peg$c223 = peg$literalExpectation("DEALLOCATE", true), - peg$c224 = "begin", - peg$c225 = peg$literalExpectation("BEGIN", true), - peg$c226 = "try", - peg$c227 = peg$literalExpectation("TRY", true), - peg$c228 = "catch", - peg$c229 = peg$literalExpectation("CATCH", true), - peg$c230 = "else", - peg$c231 = peg$literalExpectation("ELSE", true), - peg$c232 = "if", - peg$c233 = peg$literalExpectation("IF", true), - peg$c234 = "while", - peg$c235 = peg$literalExpectation("WHILE", true), - peg$c236 = "raiserror", - peg$c237 = peg$literalExpectation("RAISERROR", true), - peg$c238 = "throw", - peg$c239 = peg$literalExpectation("THROW", true), - peg$c240 = "return", - peg$c241 = peg$literalExpectation("RETURN", true), - peg$c242 = "rollback", - peg$c243 = peg$literalExpectation("ROLLBACK", true), - peg$c244 = "transaction", - peg$c245 = peg$literalExpectation("TRANSACTION", true), - peg$c246 = "commit", - peg$c247 = peg$literalExpectation("COMMIT", true), - peg$c248 = "exec", - peg$c249 = peg$literalExpectation("EXEC", true), - peg$c250 = "drop", - peg$c251 = peg$literalExpectation("DROP", true), - peg$c252 = "merge", - peg$c253 = peg$literalExpectation("MERGE", true), - peg$c254 = "when", - peg$c255 = peg$literalExpectation("WHEN", true), - peg$c256 = "union", - peg$c257 = peg$literalExpectation("UNION", true), - peg$c258 = "all", - peg$c259 = peg$literalExpectation("ALL", true), - peg$c260 = "rename", - peg$c261 = peg$literalExpectation("RENAME", true), - peg$c262 = "with", - peg$c263 = peg$literalExpectation("WITH", true), - peg$c264 = "deny", - peg$c265 = peg$literalExpectation("DENY", true), - peg$c266 = "grant", - peg$c267 = peg$literalExpectation("GRANT", true), - peg$c268 = "revoke", - peg$c269 = peg$literalExpectation("REVOKE", true), - peg$c270 = "truncate", - peg$c271 = peg$literalExpectation("TRUNCATE", true), - peg$c272 = "disable", - peg$c273 = peg$literalExpectation("DISABLE", true), - peg$c274 = "trigger", - peg$c275 = peg$literalExpectation("TRIGGER", true), - peg$c276 = "enable", - peg$c277 = peg$literalExpectation("ENABLE", true), - peg$c278 = "bulk", - peg$c279 = peg$literalExpectation("BULK", true), - peg$c280 = "waitfor", - peg$c281 = peg$literalExpectation("WAITFOR", true), - peg$c282 = "except", - peg$c283 = peg$literalExpectation("EXCEPT", true), - peg$c284 = "intersect", - peg$c285 = peg$literalExpectation("INTERSECT", true), - - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1 }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, - - peg$result; + }; + var peg$f28 = function(e) { + return { + type: "CHECK", + expression: e + } + }; + var peg$f29 = function() {return text()}; + var peg$f30 = function(x) {return x.toLowerCase() === "not null"}; + var peg$f31 = function(a) {return a || {}}; + var peg$f32 = function(s, i) {return {seed: s, increment: i}}; + var peg$f33 = function(n1, n2) {return {type:'table', typeName:n1+'.'+n2}}; + var peg$f34 = function(n, s) {return s}; + var peg$f35 = function(n, s1, s2) {return [s1,s2]}; + var peg$f36 = function(n, size) { + return {type:n.toLowerCase(), size:defaultSize(n.toLowerCase(), size)} + }; + var peg$f37 = function() {var result = Number.parseFloat(text()); return Number.isNaN(result)?text():result;}; + var peg$f38 = function(s) {return s.join('')}; + var peg$f39 = function() {return '\''}; + var peg$f40 = function() {return }; + var peg$f41 = function(ws) {return ws.filter(function(x){return x})}; + var peg$f42 = function() {return {multi:text()}}; + var peg$f43 = function(x) {return x}; + var peg$f44 = function() {return {single:text()}}; + var peg$f45 = function(n, u, c, col) {return text().trim()}; + var peg$f46 = function(n, u, c, col, filter) {return filter}; + var peg$f47 = function(n, u, c, col, filter) { + return { + type: "INDEX", + name: n, + clustered: !!c && c.toLowerCase() === "clustered", + unique: !!u && u.toLowerCase() === "unique", + columns: col, + filter + } + }; + var peg$f48 = function(x) { + const result = []; + x.forEach(item => { + if (item?.start) { + result.push(item) + } else { + result[result.length-1].statement += item.statement; + if (!item?.whitespace) result[result.length-1].location.end = item.location.end; + } + if (!item?.whitespace) { + result[result.length-1].index = result[result.length-1].statement.length; + if (/@@ROWCOUNT|ROWCOUNT_BIG/i.test(item.statement)) result[result.length-1].rowcount = true; + } + if (item?.reference) { + result[result.length-1].reference||=[]; + if (!result[result.length-1].reference.includes(item.reference)) result[result.length-1].reference.push(item.reference); + } + }) + const statements = result.reduceRight((prev, item) => { + if ( + (prev.length && prev[0].rowcount) || + (prev.length && prev[0].statement.startsWith(';')) || + (prev.length && prev[0].statement.match(/^(INSERT|UPDATE|DELETE|SET)\b/i) && item.statement.match(/^WHEN\b/i)) || + (prev.length && prev[0].statement.match(/^WHEN\b/i) && item.statement.match(/^(MERGE|WITH|INSERT|DELETE|UPDATE|SET)\b/i)) || + (prev.length && prev[0].statement.match(/^WITH\b/i) && item.statement.match(/^MERGE\b/i)) || + (prev.length && prev[0].statement.match(/^(WITH|UNION|EXCEPT|INTERSECT)\b/i) && item.statement.match(/^SELECT\b/i)) || + (prev.length && prev[0].statement.match(/^(UPDATE|INSERT|MERGE)\b/i) && item.statement.match(/^WITH\b/i)) || + (prev.length && prev[0].statement.match(/^SELECT\b/i) && item.statement.match(/^(INSERT|WITH|UNION|CURSOR|EXCEPT|INTERSECT)\b/i)) || + (prev.length && prev[0].statement.match(/^SET\b/i) && item.statement.match(/^UPDATE\b/i)) || + (prev.length && prev[0].statement.match(/^EXEC\b/i) && item.statement.match(/^INSERT\b/i)) || + (prev.length && prev[0].statement.match(/^CURSOR\b/i) && item.statement.match(/^DECLARE\b/i)) + ) { + prev[0].statement = item.statement + prev[0].statement; + prev[0].index += item.statement.length; + prev[0].location.start = item.location.start; + prev[0].rowcount = item.rowcount; + } else { + item.original = item.statement; + prev.unshift(item); + } + return prev; + }, []); + return { + text: statements.map(instrument).join('') + '\n', + statements + } + }; + var peg$f49 = function() {return {whitespace: true, statement: text(), location: location()}}; + var peg$f50 = function() {return {statement: text(), location: location()}}; + var peg$f51 = function(relation) {return {statement: text(), location: location(), reference: relation.reference}}; + var peg$f52 = function() {return {start: true, statement: text(), location: location()}}; + var peg$f53 = function(reference) {return {reference}}; + + var peg$currPos = 0; + var peg$savedPos = 0; + var peg$posDetailsCache = [{ line: 1, column: 1 }]; + var peg$maxFailPos = 0; + var peg$maxFailExpected = []; + var peg$silentFails = 0; + + var peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { @@ -690,12 +723,26 @@ function peg$parse(input, options) { return input.substring(peg$savedPos, peg$currPos); } + function offset() { + return peg$savedPos; + } + + function range() { + return { + source: peg$source, + start: peg$savedPos, + end: peg$currPos + }; + } + function location() { return peg$computeLocation(peg$savedPos, peg$currPos); } function expected(description, location) { - location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) + location = location !== undefined + ? location + : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildStructuredError( [peg$otherExpectation(description)], @@ -705,7 +752,9 @@ function peg$parse(input, options) { } function error(message, location) { - location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) + location = location !== undefined + ? location + : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildSimpleError(message, location); } @@ -731,7 +780,8 @@ function peg$parse(input, options) { } function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], p; + var details = peg$posDetailsCache[pos]; + var p; if (details) { return details; @@ -743,7 +793,7 @@ function peg$parse(input, options) { details = peg$posDetailsCache[p]; details = { - line: details.line, + line: details.line, column: details.column }; @@ -759,23 +809,25 @@ function peg$parse(input, options) { } peg$posDetailsCache[pos] = details; + return details; } } function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); + var startPosDetails = peg$computePosDetails(startPos); + var endPosDetails = peg$computePosDetails(endPos); return { + source: peg$source, start: { offset: startPos, - line: startPosDetails.line, + line: startPosDetails.line, column: startPosDetails.column }, end: { offset: endPos, - line: endPosDetails.line, + line: endPosDetails.line, column: endPosDetails.column } }; @@ -841,15 +893,15 @@ function peg$parse(input, options) { peg$currPos += 5; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c1); } + if (peg$silentFails === 0) { peg$fail(peg$e0); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } } @@ -861,54 +913,33 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsecreateoralter(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parsePROCEDURE(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parseschema(); - if (s6 !== peg$FAILED) { - s7 = peg$parsename(); - if (s7 !== peg$FAILED) { - s8 = peg$parseWhitespaceSingleLineComment(); - if (s8 === peg$FAILED) { - s8 = null; - } - if (s8 !== peg$FAILED) { - s9 = peg$parseparams(); - if (s9 === peg$FAILED) { - s9 = null; - } - if (s9 !== peg$FAILED) { - s10 = peg$parseAS(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews1(); - if (s11 !== peg$FAILED) { - s12 = peg$parsebody(); - if (s12 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c4(s6, s7, s8, s9); - 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; - } + s2 = peg$parsecreateoralter(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parsePROCEDURE(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parseschema(); + if (s6 !== peg$FAILED) { + s7 = peg$parsename(); + if (s7 !== peg$FAILED) { + s8 = peg$parseWhitespaceSingleLineComment(); + if (s8 === peg$FAILED) { + s8 = null; + } + s9 = peg$parseparams(); + if (s9 === peg$FAILED) { + s9 = null; + } + s10 = peg$parseAS(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews1(); + if (s11 !== peg$FAILED) { + s12 = peg$parsebody(); + peg$savedPos = s0; + s0 = peg$f0(s6, s7, s8, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -950,48 +981,32 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsecreateoralter(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parsePROCEDURE(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parseschema(); - if (s6 !== peg$FAILED) { - s7 = peg$parsename(); - if (s7 !== peg$FAILED) { - s8 = peg$parseWhitespaceSingleLineComment(); - if (s8 === peg$FAILED) { - s8 = null; - } - if (s8 !== peg$FAILED) { - s9 = peg$parseparams(); - if (s9 === peg$FAILED) { - s9 = null; - } - if (s9 !== peg$FAILED) { - s10 = peg$parseAS(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews1(); - if (s11 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c5(s6, s7, s8, s9); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s2 = peg$parsecreateoralter(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parsePROCEDURE(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parseschema(); + if (s6 !== peg$FAILED) { + s7 = peg$parsename(); + if (s7 !== peg$FAILED) { + s8 = peg$parseWhitespaceSingleLineComment(); + if (s8 === peg$FAILED) { + s8 = null; + } + s9 = peg$parseparams(); + if (s9 === peg$FAILED) { + s9 = null; + } + s10 = peg$parseAS(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews1(); + if (s11 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f1(s6, s7, s8, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1037,8 +1052,7 @@ function peg$parse(input, options) { s2 = peg$parsebodyParse(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c6(s1, s2); - s0 = s1; + s0 = peg$f2(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1056,67 +1070,41 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsecreateoralter(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parseTYPE(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parseschema(); - if (s6 !== peg$FAILED) { - s7 = peg$parsename(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews1(); - if (s8 !== peg$FAILED) { - s9 = peg$parseAS(); - if (s9 !== peg$FAILED) { - s10 = peg$parsews1(); - if (s10 !== peg$FAILED) { - s11 = peg$parseTABLE(); - if (s11 !== peg$FAILED) { - s12 = peg$parsews(); - if (s12 !== peg$FAILED) { - s13 = peg$parselparen(); - if (s13 !== peg$FAILED) { - s14 = peg$parseWhitespaceSingleLineComment(); - if (s14 === peg$FAILED) { - s14 = null; - } - if (s14 !== peg$FAILED) { - s15 = peg$parsefields(); - if (s15 !== peg$FAILED) { - s16 = peg$parsews(); - if (s16 !== peg$FAILED) { - s17 = peg$parserparen(); - if (s17 !== peg$FAILED) { - s18 = peg$parsews(); - if (s18 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c7(s6, s7, s14, s15); - 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; - } + s2 = peg$parsecreateoralter(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parseTYPE(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parseschema(); + if (s6 !== peg$FAILED) { + s7 = peg$parsename(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews1(); + if (s8 !== peg$FAILED) { + s9 = peg$parseAS(); + if (s9 !== peg$FAILED) { + s10 = peg$parsews1(); + if (s10 !== peg$FAILED) { + s11 = peg$parseTABLE(); + if (s11 !== peg$FAILED) { + s12 = peg$parsews(); + s13 = peg$parselparen(); + if (s13 !== peg$FAILED) { + s14 = peg$parseWhitespaceSingleLineComment(); + if (s14 === peg$FAILED) { + s14 = null; + } + s15 = peg$parsefields(); + if (s15 !== peg$FAILED) { + s16 = peg$parsews(); + s17 = peg$parserparen(); + if (s17 !== peg$FAILED) { + s18 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f3(s6, s7, s14, s15); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1178,77 +1166,38 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsecreateoralter(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parseTABLE(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parseschema(); - if (s6 !== peg$FAILED) { - s7 = peg$parsename(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parselparen(); - if (s9 !== peg$FAILED) { - s10 = peg$parseWhitespaceSingleLineComment(); - if (s10 === peg$FAILED) { - s10 = null; - } - if (s10 !== peg$FAILED) { - s11 = peg$parsefields_and_constraints(); - if (s11 !== peg$FAILED) { - s12 = peg$parsews(); - if (s12 !== peg$FAILED) { - s13 = peg$parserparen(); - if (s13 !== peg$FAILED) { - s14 = peg$parsewsnocomment(); - if (s14 === peg$FAILED) { - s14 = null; - } - if (s14 !== peg$FAILED) { - s15 = peg$parseComment(); - if (s15 === peg$FAILED) { - s15 = null; - } - if (s15 !== peg$FAILED) { - s16 = peg$parsews(); - if (s16 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c8(s6, s7, s10, s11, s15); - 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; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; + s2 = peg$parsecreateoralter(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parseTABLE(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parseschema(); + if (s6 !== peg$FAILED) { + s7 = peg$parsename(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + s9 = peg$parselparen(); + if (s9 !== peg$FAILED) { + s10 = peg$parseWhitespaceSingleLineComment(); + if (s10 === peg$FAILED) { + s10 = null; + } + s11 = peg$parsefields_and_constraints(); + if (s11 !== peg$FAILED) { + s12 = peg$parsews(); + s13 = peg$parserparen(); + if (s13 !== peg$FAILED) { + s14 = peg$parsewsnocomment(); + s15 = peg$parseComment(); + if (s15 === peg$FAILED) { + s15 = null; } + s16 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f4(s6, s7, s10, s11, s15); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1294,31 +1243,31 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { - s1 = peg$c9; + s1 = peg$c2; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c10); } + if (peg$silentFails === 0) { peg$fail(peg$e2); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = []; - if (peg$c11.test(input.charAt(peg$currPos))) { + if (peg$r0.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } + if (peg$silentFails === 0) { peg$fail(peg$e3); } } if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c11.test(input.charAt(peg$currPos))) { + if (peg$r0.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } + if (peg$silentFails === 0) { peg$fail(peg$e3); } } } } else { @@ -1331,16 +1280,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { - s3 = peg$c13; + s3 = peg$c3; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c14); } + if (peg$silentFails === 0) { peg$fail(peg$e4); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c15(s2); - s0 = s1; + s0 = peg$f5(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1364,22 +1312,22 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; - if (peg$c16.test(input.charAt(peg$currPos))) { + if (peg$r1.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$e5); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); - if (peg$c16.test(input.charAt(peg$currPos))) { + if (peg$r1.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$e5); } } } } else { @@ -1400,126 +1348,63 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsename(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parseorder(); - if (s4 === peg$FAILED) { - s4 = null; + s2 = peg$parsename(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s4 = peg$parseorder(); + if (s4 === peg$FAILED) { + s4 = null; + } + s5 = []; + s6 = peg$currPos; + s7 = peg$parsews(); + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsename(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parseorder(); + if (s12 === peg$FAILED) { + s12 = null; } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$currPos; - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsename(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parseorder(); - if (s12 === peg$FAILED) { - s12 = null; - } - if (s12 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c18(s2, s4, s10, s12); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$currPos; - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsename(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parseorder(); - if (s12 === peg$FAILED) { - s12 = null; - } - if (s12 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c18(s2, s4, s10, s12); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c19(s2, s4, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$savedPos = s6; + s6 = peg$f6(s2, s4, s10, s12); + } else { + peg$currPos = s6; + s6 = peg$FAILED; + } + } else { + peg$currPos = s6; + s6 = peg$FAILED; + } + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$currPos; + s7 = peg$parsews(); + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsename(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parseorder(); + if (s12 === peg$FAILED) { + s12 = null; } + peg$savedPos = s6; + s6 = peg$f6(s2, s4, s10, s12); } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } + peg$savedPos = s0; + s0 = peg$f7(s2, s4, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1535,16 +1420,15 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c20; + s2 = peg$c4; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$e6); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c22(s1); - s0 = s1; + s0 = peg$f8(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1564,16 +1448,15 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c20; + s2 = peg$c4; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$e6); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c23(s1); - s0 = s1; + s0 = peg$f9(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1596,16 +1479,10 @@ function peg$parse(input, options) { s1.push(s2); s2 = peg$parsenamespace(); } - if (s1 !== peg$FAILED) { - s2 = peg$parsename(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c24(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s2 = peg$parsename(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f10(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1625,24 +1502,13 @@ function peg$parse(input, options) { s3 = []; s4 = peg$currPos; s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parseparam(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c25(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parseparam(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f11(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -1655,24 +1521,13 @@ function peg$parse(input, options) { s3.push(s4); s4 = peg$currPos; s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parseparam(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c25(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parseparam(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f11(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -1682,16 +1537,10 @@ function peg$parse(input, options) { s4 = peg$FAILED; } } - if (s3 !== peg$FAILED) { - s4 = peg$parsews1(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c26(s1, s2, s3, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s4 = peg$parsews1(); + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f12(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1716,83 +1565,50 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsefield_or_constraint(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield_or_constraint(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c25(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + s2 = peg$parsefield_or_constraint(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield_or_constraint(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f11(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield_or_constraint(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c25(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield_or_constraint(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f11(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews1(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c27(s1, s2, s3, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s4; + s4 = peg$FAILED; } + } + s4 = peg$parsews1(); + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f13(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1824,87 +1640,49 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsefield(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c28(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + s2 = peg$parsefield(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f14(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c28(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f14(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c29(s1, s2, s3, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s4; + s4 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } + s4 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f15(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1925,29 +1703,19 @@ function peg$parse(input, options) { if (s3 !== peg$FAILED) { s4 = peg$currPos; s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s6 = peg$c30; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c31); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsevalue(); - if (s8 !== peg$FAILED) { - s5 = [s5, s6, s7, s8]; - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + if (input.charCodeAt(peg$currPos) === 61) { + s6 = peg$c5; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e7); } + } + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsevalue(); + if (s8 !== peg$FAILED) { + s5 = [s5, s6, s7, s8]; + s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -1959,66 +1727,50 @@ function peg$parse(input, options) { if (s4 === peg$FAILED) { s4 = null; } - if (s4 !== peg$FAILED) { - s5 = peg$currPos; - s6 = peg$parsews1(); - if (s6 !== peg$FAILED) { - s7 = peg$parseout(); - if (s7 !== peg$FAILED) { - s6 = [s6, s7]; - s5 = s6; - } else { - peg$currPos = s5; - s5 = peg$FAILED; - } + s5 = peg$currPos; + s6 = peg$parsews1(); + if (s6 !== peg$FAILED) { + s7 = peg$parseout(); + if (s7 !== peg$FAILED) { + s6 = [s6, s7]; + s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } - if (s5 === peg$FAILED) { - s5 = null; + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + if (s5 === peg$FAILED) { + s5 = null; + } + s6 = peg$currPos; + s7 = peg$parsews1(); + if (s7 !== peg$FAILED) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c6) { + s8 = input.substr(peg$currPos, 8); + peg$currPos += 8; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e8); } } - if (s5 !== peg$FAILED) { - s6 = peg$currPos; - s7 = peg$parsews1(); - if (s7 !== peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c32) { - s8 = input.substr(peg$currPos, 8); - peg$currPos += 8; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c33); } - } - if (s8 !== peg$FAILED) { - s7 = [s7, s8]; - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c34(s1, s3, s4, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s8 !== peg$FAILED) { + s7 = [s7, s8]; + s6 = s7; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } + if (s6 === peg$FAILED) { + s6 = null; + } + peg$savedPos = s0; + s0 = peg$f16(s1, s3, s4, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2040,18 +1792,17 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 64) { - s1 = peg$c35; + s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } + if (peg$silentFails === 0) { peg$fail(peg$e9); } } if (s1 !== peg$FAILED) { s2 = peg$parsename(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c37(s2); - s0 = s1; + s0 = peg$f17(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2078,32 +1829,16 @@ function peg$parse(input, options) { if (s4 === peg$FAILED) { s4 = null; } - if (s4 !== peg$FAILED) { - s5 = peg$parsenot_nullable(); - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsedefault(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c38(s1, s3, s4, s5, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; + s5 = peg$parsenot_nullable(); + if (s5 === peg$FAILED) { + s5 = null; } + s6 = peg$parsedefault(); + if (s6 === peg$FAILED) { + s6 = null; + } + peg$savedPos = s0; + s0 = peg$f18(s1, s3, s4, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2125,46 +1860,25 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c39) { - s2 = input.substr(peg$currPos, 7); - peg$currPos += 7; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c40); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parselparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsedefault_value(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parserparen(); - if (s8 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c41(s6); - 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 (input.substr(peg$currPos, 7).toLowerCase() === peg$c8) { + s2 = input.substr(peg$currPos, 7); + peg$currPos += 7; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e10); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s4 = peg$parselparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsedefault_value(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parserparen(); + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f19(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2196,7 +1910,7 @@ function peg$parse(input, options) { s1 = peg$parseexpression(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c42(); + s1 = peg$f20(); } s0 = s1; } @@ -2209,12 +1923,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 10) === peg$c43) { - s1 = peg$c43; + if (input.substr(peg$currPos, 10) === peg$c9) { + s1 = peg$c9; peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c44); } + if (peg$silentFails === 0) { peg$fail(peg$e11); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); @@ -2235,8 +1949,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c45(s3, s5); - s0 = s1; + s0 = peg$f21(s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2265,56 +1978,30 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c46) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c10) { s1 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } + if (peg$silentFails === 0) { peg$fail(peg$e12); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseclustered(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parselparen(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parsenames(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parserparen(); - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c48(s3, s7); - 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; - } + s3 = peg$parseclustered(); + if (s3 === peg$FAILED) { + s3 = null; + } + s4 = peg$parsews(); + s5 = peg$parselparen(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parsenames(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + s9 = peg$parserparen(); + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f22(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2338,20 +2025,20 @@ function peg$parse(input, options) { function peg$parseclustered() { var s0; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c49) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c11) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c50); } + if (peg$silentFails === 0) { peg$fail(peg$e13); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 12).toLowerCase() === peg$c51) { + if (input.substr(peg$currPos, 12).toLowerCase() === peg$c12) { s0 = input.substr(peg$currPos, 12); peg$currPos += 12; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$e14); } } } @@ -2361,20 +2048,20 @@ function peg$parse(input, options) { function peg$parseorder() { var s0; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c53) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c13) { s0 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c54); } + if (peg$silentFails === 0) { peg$fail(peg$e15); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c55) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c14) { s0 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c56); } + if (peg$silentFails === 0) { peg$fail(peg$e16); } } } @@ -2384,44 +2071,44 @@ function peg$parse(input, options) { function peg$parseaction() { var s0; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c57) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c15) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c58); } + if (peg$silentFails === 0) { peg$fail(peg$e17); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c59) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c16) { s0 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$e18); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c61) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c17) { s0 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } + if (peg$silentFails === 0) { peg$fail(peg$e19); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c63) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c18) { s0 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c64); } + if (peg$silentFails === 0) { peg$fail(peg$e20); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c65) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c19) { s0 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } + if (peg$silentFails === 0) { peg$fail(peg$e21); } } } } @@ -2434,28 +2121,28 @@ function peg$parse(input, options) { function peg$parseclause() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c67) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c20) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$e22); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c69) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c21) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$e23); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c71) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c22) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } } } @@ -2467,93 +2154,47 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18; s0 = peg$currPos; - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c73) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c23) { s1 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } + if (peg$silentFails === 0) { peg$fail(peg$e25); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parselparen(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parsename(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parserparen(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c75) { - s9 = input.substr(peg$currPos, 10); - peg$currPos += 10; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } - } - if (s9 !== peg$FAILED) { - s10 = peg$parsews(); - if (s10 !== peg$FAILED) { - s11 = peg$parsereference(); - if (s11 !== peg$FAILED) { - s12 = peg$parsews(); - if (s12 !== peg$FAILED) { - s13 = peg$parselparen(); - if (s13 !== peg$FAILED) { - s14 = peg$parsews(); - if (s14 !== peg$FAILED) { - s15 = peg$parsename(); - if (s15 !== peg$FAILED) { - s16 = peg$parsews(); - if (s16 !== peg$FAILED) { - s17 = peg$parserparen(); - if (s17 !== peg$FAILED) { - s18 = peg$parsefk_clause_actions(); - if (s18 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c77(s5, s11, s15, s18); - 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; - } - } 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; - } + s3 = peg$parselparen(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parsename(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parserparen(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c24) { + s9 = input.substr(peg$currPos, 10); + peg$currPos += 10; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e26); } + } + if (s9 !== peg$FAILED) { + s10 = peg$parsews(); + s11 = peg$parsereference(); + if (s11 !== peg$FAILED) { + s12 = peg$parsews(); + s13 = peg$parselparen(); + if (s13 !== peg$FAILED) { + s14 = peg$parsews(); + s15 = peg$parsename(); + if (s15 !== peg$FAILED) { + s16 = peg$parsews(); + s17 = peg$parserparen(); + if (s17 !== peg$FAILED) { + s18 = peg$parsefk_clause_actions(); + peg$savedPos = s0; + s0 = peg$f23(s5, s11, s15, s18); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2598,33 +2239,22 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c78) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c25) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseclause(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseaction(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c80(s3, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseclause(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parseaction(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f24(s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2648,102 +2278,62 @@ function peg$parse(input, options) { s1 = []; s2 = peg$currPos; s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parsefk_clause_action(); - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c81(s3, s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s4 = peg$parsefk_clause_action(); + if (s4 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f25(s3, s4); } else { peg$currPos = s2; s2 = peg$FAILED; - } - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$currPos; - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parsefk_clause_action(); - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c81(s3, s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c82(s1); - } - s0 = s1; - - return s0; - } - - function peg$parseunique_constraint() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c83) { - s1 = input.substr(peg$currPos, 6); - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseclustered(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parselparen(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parsenames(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parserparen(); - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c85(s3, s7); - 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; - } + } + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parsews(); + s4 = peg$parsefk_clause_action(); + if (s4 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f25(s3, s4); + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } + peg$savedPos = s0; + s1 = peg$f26(s1); + s0 = s1; + + return s0; + } + + function peg$parseunique_constraint() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c26) { + s1 = input.substr(peg$currPos, 6); + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e28); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsews(); + s3 = peg$parseclustered(); + if (s3 === peg$FAILED) { + s3 = null; + } + s4 = peg$parsews(); + s5 = peg$parselparen(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parsenames(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + s9 = peg$parserparen(); + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f27(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2768,41 +2358,25 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c86) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c27) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parselparen(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseexpression(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parserparen(); - if (s7 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c88(s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parselparen(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parseexpression(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parserparen(); + if (s7 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f28(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2832,21 +2406,11 @@ function peg$parse(input, options) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseterm(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s4 = [s4, s5, s6]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + s5 = peg$parseterm(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s4 = [s4, s5, s6]; + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -2855,34 +2419,18 @@ function peg$parse(input, options) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseterm(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s4 = [s4, s5, s6]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + s5 = peg$parseterm(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s4 = [s4, s5, s6]; + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c89(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f29(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2895,22 +2443,22 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = []; - if (peg$c90.test(input.charAt(peg$currPos))) { + if (peg$r2.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c90.test(input.charAt(peg$currPos))) { + if (peg$r2.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } } } else { @@ -2919,32 +2467,27 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c92; + s1 = peg$c28; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { s2 = peg$parseexpression(); if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s3 = peg$c94; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } - } - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.charCodeAt(peg$currPos) === 41) { + s3 = peg$c29; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e32); } + } + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2974,31 +2517,25 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c96) { - s2 = input.substr(peg$currPos, 4); - peg$currPos += 4; + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c30) { + s2 = input.substr(peg$currPos, 4); + peg$currPos += 4; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e33); } + } + if (s2 === peg$FAILED) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c31) { + s2 = input.substr(peg$currPos, 8); + peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c97); } - } - if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c98) { - s2 = input.substr(peg$currPos, 8); - peg$currPos += 8; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c99); } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c100(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e34); } } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f30(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3013,26 +2550,20 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews1(); if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 8) === peg$c101) { - s2 = peg$c101; + if (input.substr(peg$currPos, 8) === peg$c32) { + s2 = peg$c32; peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s2 !== peg$FAILED) { s3 = peg$parseidentity_arguments(); if (s3 === peg$FAILED) { s3 = null; } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c103(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f31(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3050,48 +2581,22 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parselparen(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parsesigned_number(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsesigned_number(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parserparen(); - if (s10 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c104(s4, s8); - 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; - } + s2 = peg$parselparen(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s4 = peg$parsesigned_number(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsesigned_number(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parserparen(); + if (s10 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f32(s4, s8); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3123,18 +2628,17 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c20; + s2 = peg$c4; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$e6); } } if (s2 !== peg$FAILED) { s3 = peg$parsename(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c105(s1, s3); - s0 = s1; + s0 = peg$f33(s1, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3159,41 +2663,25 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parselparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsesigned_number(); - if (s6 === peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c106) { - s6 = input.substr(peg$currPos, 3); - peg$currPos += 3; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c107); } - } - } - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parserparen(); - if (s8 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c108(s1, s6); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s4 = peg$parselparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsesigned_number(); + if (s6 === peg$FAILED) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c33) { + s6 = input.substr(peg$currPos, 3); + peg$currPos += 3; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e36); } + } + } + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parserparen(); + if (s8 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f34(s1, s6); } else { peg$currPos = s2; s2 = peg$FAILED; @@ -3209,48 +2697,22 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parselparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsesigned_number(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsesigned_number(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parserparen(); - if (s12 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c109(s1, s6, s10); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s4 = peg$parselparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsesigned_number(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsesigned_number(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parserparen(); + if (s12 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f35(s1, s6, s10); } else { peg$currPos = s2; s2 = peg$FAILED; @@ -3275,14 +2737,8 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c110(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f36(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3303,22 +2759,17 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s3 = peg$parsenumeric_literal(); - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } + s3 = peg$parsenumeric_literal(); + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c111(); + s1 = peg$f37(); } s0 = s1; @@ -3332,23 +2783,13 @@ function peg$parse(input, options) { s1 = peg$parselparen(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseexpression(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parserparen(); - if (s5 !== peg$FAILED) { - s1 = [s1, s2, s3, s4, s5]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseexpression(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parserparen(); + if (s5 !== peg$FAILED) { + s1 = [s1, s2, s3, s4, s5]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3367,12 +2808,12 @@ function peg$parse(input, options) { s0 = peg$parsestring_literal(); if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c96) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c30) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c97); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -3401,39 +2842,33 @@ function peg$parse(input, options) { s1 = peg$parsequote(); if (s1 !== peg$FAILED) { s2 = []; - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$r3.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s3 === peg$FAILED) { s3 = peg$parseqq(); } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$r3.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s3 === peg$FAILED) { s3 = peg$parseqq(); } } - if (s2 !== peg$FAILED) { - s3 = peg$parsequote(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c114(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parsequote(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f38(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3455,8 +2890,7 @@ function peg$parse(input, options) { s2 = peg$parsequote(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c115(); - s0 = s1; + s0 = peg$f39(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3512,13 +2946,8 @@ function peg$parse(input, options) { if (s3 === peg$FAILED) { s3 = null; } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } + s2 = [s2, s3]; + s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; @@ -3560,24 +2989,19 @@ function peg$parse(input, options) { if (s4 === peg$FAILED) { s4 = null; } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$parsedigit(); - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$parsedigit(); - } - } else { - s5 = peg$FAILED; - } - if (s5 !== peg$FAILED) { - s3 = [s3, s4, s5]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; + s5 = []; + s6 = peg$parsedigit(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsedigit(); } + } else { + s5 = peg$FAILED; + } + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; @@ -3589,13 +3013,8 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3607,12 +3026,12 @@ function peg$parse(input, options) { function peg$parsedigit() { var s0; - if (peg$c116.test(input.charAt(peg$currPos))) { + if (peg$r4.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c117); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } return s0; @@ -3622,11 +3041,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 39) { - s0 = peg$c118; + s0 = peg$c34; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } return s0; @@ -3636,11 +3055,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c20; + s0 = peg$c4; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$e6); } } return s0; @@ -3649,12 +3068,12 @@ function peg$parse(input, options) { function peg$parseE() { var s0; - if (input.substr(peg$currPos, 1).toLowerCase() === peg$c120) { + if (input.substr(peg$currPos, 1).toLowerCase() === peg$c35) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } return s0; @@ -3669,7 +3088,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3677,7 +3096,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3690,7 +3109,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3698,7 +3117,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3706,10 +3125,8 @@ function peg$parse(input, options) { } } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c123(s1); - } + peg$savedPos = s0; + s1 = peg$f41(s1); s0 = s1; return s0; @@ -3724,7 +3141,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3732,7 +3149,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3746,7 +3163,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3754,7 +3171,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3767,7 +3184,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c123(s1); + s1 = peg$f41(s1); } s0 = s1; @@ -3783,7 +3200,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3791,7 +3208,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; } @@ -3801,7 +3218,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3809,15 +3226,13 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c122(); + s3 = peg$f40(); } s2 = s3; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c123(s1); - } + peg$savedPos = s0; + s1 = peg$f41(s1); s0 = s1; return s0; @@ -3826,12 +3241,12 @@ function peg$parse(input, options) { function peg$parseCREATE() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } return s0; @@ -3840,12 +3255,12 @@ function peg$parse(input, options) { function peg$parseTYPE() { var s0; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c124) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c36) { s0 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } return s0; @@ -3854,12 +3269,12 @@ function peg$parse(input, options) { function peg$parsePROCEDURE() { var s0; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c126) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c37) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } return s0; @@ -3868,12 +3283,12 @@ function peg$parse(input, options) { function peg$parseAS() { var s0; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c128) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c38) { s0 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c129); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } return s0; @@ -3882,12 +3297,12 @@ function peg$parse(input, options) { function peg$parseTABLE() { var s0; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c130) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c39) { s0 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c131); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } return s0; @@ -3902,7 +3317,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -3911,7 +3326,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } } @@ -3922,11 +3337,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 40) { - s0 = peg$c92; + s0 = peg$c28; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } return s0; @@ -3936,11 +3351,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 41) { - s0 = peg$c94; + s0 = peg$c29; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } return s0; @@ -3950,11 +3365,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c133; + s0 = peg$c40; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } return s0; @@ -3964,11 +3379,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c135; + s0 = peg$c41; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c136); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } return s0; @@ -3978,11 +3393,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 44) { - s0 = peg$c137; + s0 = peg$c42; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c138); } + if (peg$silentFails === 0) { peg$fail(peg$e48); } } return s0; @@ -3991,20 +3406,20 @@ function peg$parse(input, options) { function peg$parseout() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c139) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c43) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c140); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c141) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c44) { s0 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c142); } + if (peg$silentFails === 0) { peg$fail(peg$e50); } } } @@ -4014,12 +3429,12 @@ function peg$parse(input, options) { function peg$parseZs() { var s0; - if (peg$c143.test(input.charAt(peg$currPos))) { + if (peg$r5.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c144); } + if (peg$silentFails === 0) { peg$fail(peg$e51); } } return s0; @@ -4033,7 +3448,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } return s0; @@ -4044,51 +3459,51 @@ function peg$parse(input, options) { peg$silentFails++; if (input.charCodeAt(peg$currPos) === 9) { - s0 = peg$c146; + s0 = peg$c45; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$e53); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 11) { - s0 = peg$c148; + s0 = peg$c46; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$e54); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 12) { - s0 = peg$c150; + s0 = peg$c47; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c151); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { - s0 = peg$c152; + s0 = peg$c48; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c153); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 160) { - s0 = peg$c154; + s0 = peg$c49; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$e57); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 65279) { - s0 = peg$c156; + s0 = peg$c50; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } if (s0 === peg$FAILED) { s0 = peg$parseZs(); @@ -4101,7 +3516,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$e52); } } return s0; @@ -4110,12 +3525,12 @@ function peg$parse(input, options) { function peg$parseLineTerminator() { var s0; - if (peg$c158.test(input.charAt(peg$currPos))) { + if (peg$r6.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c159); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } } return s0; @@ -4126,43 +3541,43 @@ function peg$parse(input, options) { peg$silentFails++; if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c161; + s0 = peg$c51; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c162); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c163) { - s0 = peg$c163; + if (input.substr(peg$currPos, 2) === peg$c52) { + s0 = peg$c52; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c164); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c165; + s0 = peg$c53; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c166); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8232) { - s0 = peg$c167; + s0 = peg$c54; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c168); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8233) { - s0 = peg$c169; + s0 = peg$c55; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c170); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } } } @@ -4171,7 +3586,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c160); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } return s0; @@ -4188,7 +3603,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c171); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } return s0; @@ -4202,16 +3617,16 @@ function peg$parse(input, options) { s2 = peg$currPos; s3 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c172) { - s4 = peg$c172; + if (input.substr(peg$currPos, 2) === peg$c56) { + s4 = peg$c56; peg$currPos += 2; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4234,16 +3649,16 @@ function peg$parse(input, options) { s2 = peg$currPos; s3 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c172) { - s4 = peg$c172; + if (input.substr(peg$currPos, 2) === peg$c56) { + s4 = peg$c56; peg$currPos += 2; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4262,10 +3677,8 @@ function peg$parse(input, options) { s2 = peg$FAILED; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c174(); - } + peg$savedPos = s0; + s1 = peg$f42(); s0 = s1; return s0; @@ -4275,31 +3688,25 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c175) { - s1 = peg$c175; + if (input.substr(peg$currPos, 2) === peg$c57) { + s1 = peg$c57; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } if (s1 !== peg$FAILED) { s2 = peg$parseMultiLineCommentBody(); - if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c172) { - s3 = peg$c172; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c177(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 2) === peg$c56) { + s3 = peg$c56; + peg$currPos += 2; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e67); } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f43(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4316,31 +3723,31 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c175) { - s1 = peg$c175; + if (input.substr(peg$currPos, 2) === peg$c57) { + s1 = peg$c57; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c172) { - s5 = peg$c172; + if (input.substr(peg$currPos, 2) === peg$c56) { + s5 = peg$c56; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s5 === peg$FAILED) { s5 = peg$parseLineTerminator(); } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = void 0; + s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4363,19 +3770,19 @@ function peg$parse(input, options) { s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c172) { - s5 = peg$c172; + if (input.substr(peg$currPos, 2) === peg$c56) { + s5 = peg$c56; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s5 === peg$FAILED) { s5 = peg$parseLineTerminator(); } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = void 0; + s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4394,21 +3801,16 @@ function peg$parse(input, options) { s3 = peg$FAILED; } } - if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c172) { - s3 = peg$c172; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } - } - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 2) === peg$c56) { + s3 = peg$c56; + peg$currPos += 2; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e67); } + } + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4432,7 +3834,7 @@ function peg$parse(input, options) { s4 = peg$parseLineTerminator(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4458,7 +3860,7 @@ function peg$parse(input, options) { s4 = peg$parseLineTerminator(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4477,10 +3879,8 @@ function peg$parse(input, options) { s2 = peg$FAILED; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c178(); - } + peg$savedPos = s0; + s1 = peg$f44(); s0 = s1; return s0; @@ -4490,23 +3890,17 @@ function peg$parse(input, options) { var s0, s1, s2; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c179) { - s1 = peg$c179; + if (input.substr(peg$currPos, 2) === peg$c58) { + s1 = peg$c58; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c180); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } if (s1 !== peg$FAILED) { s2 = peg$parseSingleLineCommentBody(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c177(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f43(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4523,28 +3917,17 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = null; } - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c179) { - s2 = peg$c179; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c180); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parseSingleLineCommentBody(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c177(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 2) === peg$c58) { + s2 = peg$c58; + peg$currPos += 2; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e69); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parseSingleLineCommentBody(); + peg$savedPos = s0; + s0 = peg$f43(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4556,12 +3939,12 @@ function peg$parse(input, options) { function peg$parseunique() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c83) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c26) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } return s0; @@ -4571,12 +3954,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c181) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c59) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c182); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); @@ -4584,141 +3967,99 @@ function peg$parse(input, options) { s3 = peg$parsename(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseunique(); - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parseclustered(); - if (s7 === peg$FAILED) { - s7 = null; - } - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parselparen(); - if (s9 !== peg$FAILED) { - s10 = peg$parsews(); - if (s10 !== peg$FAILED) { - s11 = peg$parsenames(); - if (s11 !== peg$FAILED) { - s12 = peg$parsews(); - if (s12 !== peg$FAILED) { - s13 = peg$parserparen(); - if (s13 !== peg$FAILED) { - s14 = peg$currPos; - s15 = peg$parsews1(); - if (s15 !== peg$FAILED) { - if (input.substr(peg$currPos, 5) === peg$c183) { - s16 = peg$c183; - peg$currPos += 5; - } else { - s16 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c184); } - } - if (s16 !== peg$FAILED) { - s17 = peg$currPos; - s18 = []; - s19 = peg$currPos; - s20 = peg$parsews1(); - if (s20 !== peg$FAILED) { - s21 = peg$parsename(); - if (s21 !== peg$FAILED) { - s20 = [s20, s21]; - s19 = s20; - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - if (s19 !== peg$FAILED) { - while (s19 !== peg$FAILED) { - s18.push(s19); - s19 = peg$currPos; - s20 = peg$parsews1(); - if (s20 !== peg$FAILED) { - s21 = peg$parsename(); - if (s21 !== peg$FAILED) { - s20 = [s20, s21]; - s19 = s20; - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - } - } else { - s18 = peg$FAILED; - } - if (s18 !== peg$FAILED) { - peg$savedPos = s17; - s18 = peg$c185(s3, s5, s7, s11); - } - s17 = s18; - if (s17 !== peg$FAILED) { - peg$savedPos = s14; - s15 = peg$c186(s3, s5, s7, s11, s17); - s14 = s15; - } else { - peg$currPos = s14; - s14 = peg$FAILED; - } - } else { - peg$currPos = s14; - s14 = peg$FAILED; - } - } else { - peg$currPos = s14; - s14 = peg$FAILED; - } - if (s14 === peg$FAILED) { - s14 = null; - } - if (s14 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c187(s3, s5, s7, s11, s14); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s5 = peg$parseunique(); + if (s5 === peg$FAILED) { + s5 = null; + } + s6 = peg$parsews(); + s7 = peg$parseclustered(); + if (s7 === peg$FAILED) { + s7 = null; + } + s8 = peg$parsews(); + s9 = peg$parselparen(); + if (s9 !== peg$FAILED) { + s10 = peg$parsews(); + s11 = peg$parsenames(); + if (s11 !== peg$FAILED) { + s12 = peg$parsews(); + s13 = peg$parserparen(); + if (s13 !== peg$FAILED) { + s14 = peg$currPos; + s15 = peg$parsews1(); + if (s15 !== peg$FAILED) { + if (input.substr(peg$currPos, 5) === peg$c60) { + s16 = peg$c60; + peg$currPos += 5; + } else { + s16 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e71); } + } + if (s16 !== peg$FAILED) { + s17 = peg$currPos; + s18 = []; + s19 = peg$currPos; + s20 = peg$parsews1(); + if (s20 !== peg$FAILED) { + s21 = peg$parsename(); + if (s21 !== peg$FAILED) { + s20 = [s20, s21]; + s19 = s20; + } else { + peg$currPos = s19; + s19 = peg$FAILED; + } + } else { + peg$currPos = s19; + s19 = peg$FAILED; + } + if (s19 !== peg$FAILED) { + while (s19 !== peg$FAILED) { + s18.push(s19); + s19 = peg$currPos; + s20 = peg$parsews1(); + if (s20 !== peg$FAILED) { + s21 = peg$parsename(); + if (s21 !== peg$FAILED) { + s20 = [s20, s21]; + s19 = s20; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s19; + s19 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s19; + s19 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + s18 = peg$FAILED; + } + if (s18 !== peg$FAILED) { + peg$savedPos = s17; + s18 = peg$f45(s3, s5, s7, s11); + } + s17 = s18; + if (s17 !== peg$FAILED) { + peg$savedPos = s14; + s14 = peg$f46(s3, s5, s7, s11, s17); + } else { + peg$currPos = s14; + s14 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s14; + s14 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s14; + s14 = peg$FAILED; } + if (s14 === peg$FAILED) { + s14 = null; + } + peg$savedPos = s0; + s0 = peg$f47(s3, s5, s7, s11, s14); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4763,7 +4104,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c188(s1); + s1 = peg$f48(s1); } s0 = s1; @@ -4777,7 +4118,7 @@ function peg$parse(input, options) { s1 = peg$parsews1(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c189(); + s1 = peg$f49(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4785,36 +4126,31 @@ function peg$parse(input, options) { s1 = peg$parsevalue(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(); + s1 = peg$f50(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s2 = peg$c92; + s2 = peg$c28; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s2 !== peg$FAILED) { s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s4 = peg$c94; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } - } - if (s4 !== peg$FAILED) { - s2 = [s2, s3, s4]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } + if (input.charCodeAt(peg$currPos) === 41) { + s4 = peg$c29; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e32); } + } + if (s4 !== peg$FAILED) { + s2 = [s2, s3, s4]; + s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; @@ -4825,7 +4161,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(); + s1 = peg$f50(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4833,7 +4169,7 @@ function peg$parse(input, options) { s1 = peg$parserelation(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c191(s1); + s1 = peg$f51(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4841,7 +4177,7 @@ function peg$parse(input, options) { s1 = peg$parsename_brackets(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(); + s1 = peg$f50(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4849,7 +4185,7 @@ function peg$parse(input, options) { s1 = peg$parsecase(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(); + s1 = peg$f50(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4857,7 +4193,7 @@ function peg$parse(input, options) { s1 = peg$parsestart(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c192(); + s1 = peg$f52(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4865,7 +4201,7 @@ function peg$parse(input, options) { s1 = peg$parseskip(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(); + s1 = peg$f50(); } s0 = s1; } @@ -4883,12 +4219,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c193) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c61) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c194); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4905,12 +4241,12 @@ function peg$parse(input, options) { s6 = peg$currPos; peg$silentFails++; s7 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c62) { s8 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s8 !== peg$FAILED) { s9 = peg$parseend(); @@ -4927,7 +4263,7 @@ function peg$parse(input, options) { } peg$silentFails--; if (s7 === peg$FAILED) { - s6 = void 0; + s6 = undefined; } else { peg$currPos = s6; s6 = peg$FAILED; @@ -4942,7 +4278,7 @@ function peg$parse(input, options) { s10 = peg$parsews1(); peg$silentFails--; if (s10 === peg$FAILED) { - s9 = void 0; + s9 = undefined; } else { peg$currPos = s9; s9 = peg$FAILED; @@ -4953,7 +4289,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s10 !== peg$FAILED) { s9 = [s9, s10]; @@ -4978,7 +4314,7 @@ function peg$parse(input, options) { s10 = peg$parsews1(); peg$silentFails--; if (s10 === peg$FAILED) { - s9 = void 0; + s9 = undefined; } else { peg$currPos = s9; s9 = peg$FAILED; @@ -4989,7 +4325,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s10 !== peg$FAILED) { s9 = [s9, s10]; @@ -5031,12 +4367,12 @@ function peg$parse(input, options) { s6 = peg$currPos; peg$silentFails++; s7 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c62) { s8 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s8 !== peg$FAILED) { s9 = peg$parseend(); @@ -5053,7 +4389,7 @@ function peg$parse(input, options) { } peg$silentFails--; if (s7 === peg$FAILED) { - s6 = void 0; + s6 = undefined; } else { peg$currPos = s6; s6 = peg$FAILED; @@ -5068,7 +4404,7 @@ function peg$parse(input, options) { s10 = peg$parsews1(); peg$silentFails--; if (s10 === peg$FAILED) { - s9 = void 0; + s9 = undefined; } else { peg$currPos = s9; s9 = peg$FAILED; @@ -5079,7 +4415,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s10 !== peg$FAILED) { s9 = [s9, s10]; @@ -5104,7 +4440,7 @@ function peg$parse(input, options) { s10 = peg$parsews1(); peg$silentFails--; if (s10 === peg$FAILED) { - s9 = void 0; + s9 = undefined; } else { peg$currPos = s9; s9 = peg$FAILED; @@ -5115,7 +4451,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s10 !== peg$FAILED) { s9 = [s9, s10]; @@ -5161,12 +4497,12 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { s4 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c62) { s5 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s5 !== peg$FAILED) { s6 = peg$parseend(); @@ -5208,36 +4544,36 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c197) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c63) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c198); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c75) { + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c24) { s1 = input.substr(peg$currPos, 10); peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c199) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c64) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c200); } + if (peg$silentFails === 0) { peg$fail(peg$e75); } } if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c201) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c65) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c202); } + if (peg$silentFails === 0) { peg$fail(peg$e76); } } } } @@ -5248,8 +4584,7 @@ function peg$parse(input, options) { s3 = peg$parsereference(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c203(s3); - s0 = s1; + s0 = peg$f53(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -5271,17 +4606,17 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$silentFails++; - if (peg$c204.test(input.charAt(peg$currPos))) { + if (peg$r7.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c205); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } peg$silentFails--; if (s1 !== peg$FAILED) { peg$currPos = s0; - s0 = void 0; + s0 = undefined; } else { s0 = peg$FAILED; } @@ -5293,20 +4628,20 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4; if (input.charCodeAt(peg$currPos) === 59) { - s0 = peg$c206; + s0 = peg$c66; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c207); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c208) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c67) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c209); } + if (peg$silentFails === 0) { peg$fail(peg$e79); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5323,12 +4658,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c210) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c68) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c211); } + if (peg$silentFails === 0) { peg$fail(peg$e80); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5345,12 +4680,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c212) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c69) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c213); } + if (peg$silentFails === 0) { peg$fail(peg$e81); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5367,12 +4702,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c214) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c70) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c215); } + if (peg$silentFails === 0) { peg$fail(peg$e82); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5389,12 +4724,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c216) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c71) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c217); } + if (peg$silentFails === 0) { peg$fail(peg$e83); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5411,22 +4746,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c218) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c72) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c219); } + if (peg$silentFails === 0) { peg$fail(peg$e84); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c197) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c63) { s3 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c198); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -5451,12 +4786,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c220) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c73) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c221); } + if (peg$silentFails === 0) { peg$fail(peg$e85); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5473,12 +4808,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c222) { + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c74) { s1 = input.substr(peg$currPos, 10); peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c223); } + if (peg$silentFails === 0) { peg$fail(peg$e86); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5495,22 +4830,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c224) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c75) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c225); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c226) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c76) { s3 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c227); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -5535,22 +4870,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c224) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c75) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c225); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c228) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c77) { s3 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c229); } + if (peg$silentFails === 0) { peg$fail(peg$e89); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -5575,12 +4910,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c224) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c75) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c225); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5597,22 +4932,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c62) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c226) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c76) { s3 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c227); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -5637,22 +4972,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c62) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c228) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c77) { s3 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c229); } + if (peg$silentFails === 0) { peg$fail(peg$e89); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -5677,12 +5012,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c62) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5699,23 +5034,23 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c230) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c78) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c231); } + if (peg$silentFails === 0) { peg$fail(peg$e90); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews1(); if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c232) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c79) { s4 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c233); } + if (peg$silentFails === 0) { peg$fail(peg$e91); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -5731,15 +5066,10 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s3 = peg$parseend(); - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseend(); + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -5750,12 +5080,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c232) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c79) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c233); } + if (peg$silentFails === 0) { peg$fail(peg$e91); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5772,12 +5102,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c234) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c80) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c235); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5794,12 +5124,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c236) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c81) { s1 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c237); } + if (peg$silentFails === 0) { peg$fail(peg$e93); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5816,12 +5146,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c238) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c82) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c239); } + if (peg$silentFails === 0) { peg$fail(peg$e94); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5838,12 +5168,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c240) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c83) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c241); } + if (peg$silentFails === 0) { peg$fail(peg$e95); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5860,23 +5190,23 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c242) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c84) { s1 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c243); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews1(); if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c244) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c85) { s4 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c245); } + if (peg$silentFails === 0) { peg$fail(peg$e97); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -5892,15 +5222,10 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s3 = peg$parseend(); - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseend(); + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -5911,23 +5236,23 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c246) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c86) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c247); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews1(); if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c244) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c85) { s4 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c245); } + if (peg$silentFails === 0) { peg$fail(peg$e97); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -5943,15 +5268,10 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s3 = peg$parseend(); - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseend(); + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -5962,12 +5282,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c248) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c87) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c249); } + if (peg$silentFails === 0) { peg$fail(peg$e99); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -5984,12 +5304,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6006,12 +5326,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c250) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c88) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c251); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6033,7 +5353,7 @@ function peg$parse(input, options) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c1); } + if (peg$silentFails === 0) { peg$fail(peg$e0); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6050,12 +5370,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c67) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c20) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$e22); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6072,12 +5392,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c69) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c21) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$e23); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6094,12 +5414,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c71) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c22) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6116,12 +5436,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c252) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c89) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c253); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6138,12 +5458,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c254) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c90) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c255); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6160,23 +5480,23 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c256) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c91) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c257); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews1(); if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c258) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c92) { s4 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c259); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -6192,15 +5512,10 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s3 = peg$parseend(); - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseend(); + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -6211,12 +5526,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c260) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c93) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c261); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6233,12 +5548,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c262) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c94) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c263); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6255,12 +5570,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c264) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c95) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c265); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6277,12 +5592,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c266) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c96) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c267); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6299,12 +5614,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c268) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c97) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c269); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6321,22 +5636,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c270) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c98) { s1 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c271); } + if (peg$silentFails === 0) { peg$fail(peg$e110); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c130) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c39) { s3 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c131); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -6361,22 +5676,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c130) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c39) { s3 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c131); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -6401,22 +5716,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c250) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c88) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c251); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c130) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c39) { s3 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c131); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -6441,22 +5756,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c272) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c99) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c273); } + if (peg$silentFails === 0) { peg$fail(peg$e111); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c274) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c100) { s3 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c275); } + if (peg$silentFails === 0) { peg$fail(peg$e112); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -6481,22 +5796,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c276) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c101) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c277); } + if (peg$silentFails === 0) { peg$fail(peg$e113); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c274) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c100) { s3 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c275); } + if (peg$silentFails === 0) { peg$fail(peg$e112); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -6521,22 +5836,22 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c278) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c102) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c279); } + if (peg$silentFails === 0) { peg$fail(peg$e114); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c71) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c22) { s3 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } if (s3 !== peg$FAILED) { s4 = peg$parseend(); @@ -6561,12 +5876,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c280) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c103) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c281); } + if (peg$silentFails === 0) { peg$fail(peg$e115); } } if (s1 !== peg$FAILED) { s2 = peg$parseend(); @@ -6582,20 +5897,20 @@ function peg$parse(input, options) { s0 = peg$FAILED; } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c282) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c104) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c283); } + if (peg$silentFails === 0) { peg$fail(peg$e116); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c284) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c105) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c285); } + if (peg$silentFails === 0) { peg$fail(peg$e117); } } } } @@ -6656,7 +5971,7 @@ function peg$parse(input, options) { s2 = peg$parsestart(); peg$silentFails--; if (s2 === peg$FAILED) { - s1 = void 0; + s1 = undefined; } else { peg$currPos = s1; s1 = peg$FAILED; @@ -6673,19 +5988,19 @@ function peg$parse(input, options) { s5 = peg$parsecase(); if (s5 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s5 = peg$c118; + s5 = peg$c34; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s5 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { - s5 = peg$c92; + s5 = peg$c28; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } } } @@ -6693,7 +6008,7 @@ function peg$parse(input, options) { } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = void 0; + s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -6704,7 +6019,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; @@ -6730,19 +6045,19 @@ function peg$parse(input, options) { s5 = peg$parsecase(); if (s5 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s5 = peg$c118; + s5 = peg$c34; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s5 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { - s5 = peg$c92; + s5 = peg$c28; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } } } @@ -6750,7 +6065,7 @@ function peg$parse(input, options) { } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = void 0; + s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -6761,7 +6076,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; @@ -6857,5 +6172,5 @@ function peg$parse(input, options) { module.exports = { SyntaxError: peg$SyntaxError, - parse: peg$parse + parse: peg$parse }; diff --git a/parsers/oracleSP.js b/parsers/oracleSP.js index 961d8c3..7a993ef 100644 --- a/parsers/oracleSP.js +++ b/parsers/oracleSP.js @@ -1,62 +1,95 @@ -/* - * Generated by PEG.js 0.10.0. - * - * http://pegjs.org/ - */ +// Generated by Peggy 1.2.0. +// +// https://peggyjs.org/ "use strict"; function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); + function C() { this.constructor = child; } + C.prototype = parent.prototype; + child.prototype = new C(); } 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); + var self = Error.call(this, message); + if (Object.setPrototypeOf) { + Object.setPrototypeOf(self, peg$SyntaxError.prototype); } + self.expected = expected; + self.found = found; + self.location = location; + self.name = "SyntaxError"; + return self; } peg$subclass(peg$SyntaxError, Error); +function peg$padEnd(str, targetLength, padString) { + padString = padString || " "; + if (str.length > targetLength) { return str; } + targetLength -= str.length; + padString += padString.repeat(targetLength); + return str + padString.slice(0, targetLength); +} + +peg$SyntaxError.prototype.format = function(sources) { + var str = "Error: " + this.message; + if (this.location) { + var src = null; + var k; + for (k = 0; k < sources.length; k++) { + if (sources[k].source === this.location.source) { + src = sources[k].text.split(/\r\n|\n|\r/g); + break; + } + } + var s = this.location.start; + var loc = this.location.source + ":" + s.line + ":" + s.column; + if (src) { + var e = this.location.end; + var filler = peg$padEnd("", s.line.toString().length); + var line = src[s.line - 1]; + var last = s.line === e.line ? e.column : line.length + 1; + str += "\n --> " + loc + "\n" + + filler + " |\n" + + s.line + " | " + line + "\n" + + filler + " | " + peg$padEnd("", s.column - 1) + + peg$padEnd("", last - s.column, "^"); + } else { + str += "\n at " + loc; + } + } + return str; +}; + peg$SyntaxError.buildMessage = function(expected, found) { var DESCRIBE_EXPECTATION_FNS = { - literal: function(expectation) { - return "\"" + literalEscape(expectation.text) + "\""; - }, - - "class": function(expectation) { - var escapedParts = "", - i; - - 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]); - } + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; - }, + class: function(expectation) { + var escapedParts = expectation.parts.map(function(part) { + return Array.isArray(part) + ? classEscape(part[0]) + "-" + classEscape(part[1]) + : classEscape(part); + }); - any: function(expectation) { - return "any character"; - }, + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, - end: function(expectation) { - return "end of input"; - }, + any: function() { + return "any character"; + }, - other: function(expectation) { - return expectation.description; - } - }; + end: function() { + return "end of input"; + }, + + other: function(expectation) { + return expectation.description; + } + }; function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); @@ -64,28 +97,28 @@ peg$SyntaxError.buildMessage = function(expected, found) { 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); }); + .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 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); }); + .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 describeExpectation(expectation) { @@ -93,12 +126,8 @@ peg$SyntaxError.buildMessage = function(expected, found) { } function describeExpected(expected) { - var descriptions = new Array(expected.length), - i, j; - - for (i = 0; i < expected.length; i++) { - descriptions[i] = describeExpectation(expected[i]); - } + var descriptions = expected.map(describeExpectation); + var i, j; descriptions.sort(); @@ -134,414 +163,418 @@ peg$SyntaxError.buildMessage = function(expected, found) { }; function peg$parse(input, options) { - options = options !== void 0 ? options : {}; - - var peg$FAILED = {}, - - peg$startRuleFunctions = { create: peg$parsecreate }, - peg$startRuleFunction = peg$parsecreate, - - peg$c0 = "alter", - peg$c1 = peg$literalExpectation("ALTER", true), - peg$c2 = "create", - peg$c3 = peg$literalExpectation("CREATE", true), - peg$c4 = "or", - peg$c5 = peg$literalExpectation("OR", true), - peg$c6 = "replace", - peg$c7 = peg$literalExpectation("REPLACE", true), - peg$c8 = function(table, doc, params) { + options = options !== undefined ? options : {}; + + var peg$FAILED = {}; + var peg$source = options.grammarSource; + + var peg$startRuleFunctions = { create: peg$parsecreate }; + var peg$startRuleFunction = peg$parsecreate; + + var peg$c0 = "alter"; + var peg$c1 = "create"; + var peg$c2 = "or"; + var peg$c3 = "replace"; + var peg$c4 = "%ROWTYPE"; + var peg$c5 = ";"; + var peg$c6 = "\""; + var peg$c7 = "."; + var peg$c8 = "in"; + var peg$c9 = "out"; + var peg$c10 = "default"; + var peg$c11 = ":="; + var peg$c12 = "CONSTRAINT"; + var peg$c13 = "primary key"; + var peg$c14 = "clustered"; + var peg$c15 = "nonclustered"; + var peg$c16 = "asc"; + var peg$c17 = "desc"; + var peg$c18 = "no action"; + var peg$c19 = "set default"; + var peg$c20 = "set null"; + var peg$c21 = "cascade"; + var peg$c22 = "restrict"; + var peg$c23 = "delete"; + var peg$c24 = "update"; + var peg$c25 = "insert"; + var peg$c26 = "foreign key"; + var peg$c27 = "references"; + var peg$c28 = "on"; + var peg$c29 = "unique"; + var peg$c30 = "check"; + var peg$c31 = "("; + var peg$c32 = ")"; + var peg$c33 = "null"; + var peg$c34 = "not null"; + var peg$c35 = "generated"; + var peg$c36 = "by"; + var peg$c37 = "as"; + var peg$c38 = "identity"; + var peg$c39 = "start"; + var peg$c40 = "with"; + var peg$c41 = "increment"; + var peg$c42 = "max"; + var peg$c43 = "'"; + var peg$c44 = "e"; + var peg$c45 = "type"; + var peg$c46 = "procedure"; + var peg$c47 = "is"; + var peg$c48 = "of"; + var peg$c49 = "table"; + var peg$c50 = "+"; + var peg$c51 = "-"; + var peg$c52 = ","; + var peg$c53 = "output"; + var peg$c54 = "\t"; + var peg$c55 = "\v"; + var peg$c56 = "\f"; + var peg$c57 = " "; + var peg$c58 = "\xA0"; + var peg$c59 = "\uFEFF"; + var peg$c60 = "\n"; + var peg$c61 = "\r\n"; + var peg$c62 = "\r"; + var peg$c63 = "\u2028"; + var peg$c64 = "\u2029"; + var peg$c65 = "*/"; + var peg$c66 = "/*"; + var peg$c67 = "--"; + var peg$c68 = "index"; + var peg$c69 = "WHERE"; + + var peg$r0 = /^[^"]/; + var peg$r1 = /^[A-Za-z0-9_$]/; + var peg$r2 = /^[^()]/; + var peg$r3 = /^[^'\r\n]/; + var peg$r4 = /^[0-9]/; + var peg$r5 = /^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; + var peg$r6 = /^[\n\r\u2028\u2029]/; + + var peg$e0 = peg$literalExpectation("ALTER", true); + var peg$e1 = peg$literalExpectation("CREATE", true); + var peg$e2 = peg$literalExpectation("OR", true); + var peg$e3 = peg$literalExpectation("REPLACE", true); + var peg$e4 = peg$literalExpectation("%ROWTYPE", false); + var peg$e5 = peg$literalExpectation(";", false); + var peg$e6 = peg$literalExpectation("\"", false); + var peg$e7 = peg$classExpectation(["\""], true, false); + var peg$e8 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "$"], false, false); + var peg$e9 = peg$literalExpectation(".", false); + var peg$e10 = peg$literalExpectation("IN", true); + var peg$e11 = peg$literalExpectation("OUT", true); + var peg$e12 = peg$literalExpectation("DEFAULT", true); + var peg$e13 = peg$literalExpectation(":=", false); + var peg$e14 = peg$literalExpectation("CONSTRAINT", false); + var peg$e15 = peg$literalExpectation("PRIMARY KEY", true); + var peg$e16 = peg$literalExpectation("CLUSTERED", true); + var peg$e17 = peg$literalExpectation("NONCLUSTERED", true); + var peg$e18 = peg$literalExpectation("ASC", true); + var peg$e19 = peg$literalExpectation("DESC", true); + var peg$e20 = peg$literalExpectation("NO ACTION", true); + var peg$e21 = peg$literalExpectation("SET DEFAULT", true); + var peg$e22 = peg$literalExpectation("SET NULL", true); + var peg$e23 = peg$literalExpectation("CASCADE", true); + var peg$e24 = peg$literalExpectation("RESTRICT", true); + var peg$e25 = peg$literalExpectation("DELETE", true); + var peg$e26 = peg$literalExpectation("UPDATE", true); + var peg$e27 = peg$literalExpectation("INSERT", true); + var peg$e28 = peg$literalExpectation("FOREIGN KEY", true); + var peg$e29 = peg$literalExpectation("REFERENCES", true); + var peg$e30 = peg$literalExpectation("ON", true); + var peg$e31 = peg$literalExpectation("UNIQUE", true); + var peg$e32 = peg$literalExpectation("CHECK", true); + var peg$e33 = peg$classExpectation(["(", ")"], true, false); + var peg$e34 = peg$literalExpectation("(", false); + var peg$e35 = peg$literalExpectation(")", false); + var peg$e36 = peg$literalExpectation("NULL", true); + var peg$e37 = peg$literalExpectation("NOT NULL", true); + var peg$e38 = peg$literalExpectation("GENERATED", true); + var peg$e39 = peg$literalExpectation("BY", true); + var peg$e40 = peg$literalExpectation("AS", true); + var peg$e41 = peg$literalExpectation("IDENTITY", true); + var peg$e42 = peg$literalExpectation("START", true); + var peg$e43 = peg$literalExpectation("WITH", true); + var peg$e44 = peg$literalExpectation("INCREMENT", true); + var peg$e45 = peg$literalExpectation("max", true); + var peg$e46 = peg$classExpectation(["'", "\r", "\n"], true, false); + var peg$e47 = peg$classExpectation([["0", "9"]], false, false); + var peg$e48 = peg$literalExpectation("'", false); + var peg$e49 = peg$literalExpectation("E", true); + var peg$e50 = peg$literalExpectation("TYPE", true); + var peg$e51 = peg$literalExpectation("PROCEDURE", true); + var peg$e52 = peg$literalExpectation("IS", true); + var peg$e53 = peg$literalExpectation("OF", true); + var peg$e54 = peg$literalExpectation("TABLE", true); + var peg$e55 = peg$anyExpectation(); + var peg$e56 = peg$literalExpectation("+", false); + var peg$e57 = peg$literalExpectation("-", false); + var peg$e58 = peg$literalExpectation(",", false); + var peg$e59 = peg$literalExpectation("output", true); + var peg$e60 = peg$literalExpectation("out", true); + var peg$e61 = peg$classExpectation([" ", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u202F", "\u205F", "\u3000"], false, false); + var peg$e62 = peg$otherExpectation("whitespace"); + var peg$e63 = peg$literalExpectation("\t", false); + var peg$e64 = peg$literalExpectation("\v", false); + var peg$e65 = peg$literalExpectation("\f", false); + var peg$e66 = peg$literalExpectation(" ", false); + var peg$e67 = peg$literalExpectation("\xA0", false); + var peg$e68 = peg$literalExpectation("\uFEFF", false); + var peg$e69 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false); + var peg$e70 = peg$otherExpectation("end of line"); + var peg$e71 = peg$literalExpectation("\n", false); + var peg$e72 = peg$literalExpectation("\r\n", false); + var peg$e73 = peg$literalExpectation("\r", false); + var peg$e74 = peg$literalExpectation("\u2028", false); + var peg$e75 = peg$literalExpectation("\u2029", false); + var peg$e76 = peg$otherExpectation("comment"); + var peg$e77 = peg$literalExpectation("*/", false); + var peg$e78 = peg$literalExpectation("/*", false); + var peg$e79 = peg$literalExpectation("--", false); + var peg$e80 = peg$literalExpectation("INDEX", true); + var peg$e81 = peg$literalExpectation("WHERE", false); + + var peg$f0 = function(table, doc, params) { + return { + type:'procedure', + name: table, + schema: table.split('.')[0], + table: table.split('.').slice(1).join('.'), + doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + params:params + } + }; + var peg$f1 = function(tableT, table, doc) { + return { + type:'table type', + name: table.split('.')[0] + '.' + tableT, + schema: table.split('.')[0], + table: table.split('.').slice(1).join('.'), + doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + fields:[] + } + }; + var peg$f2 = function(table, doc, fc, options) { + return { + type: 'table', + name: table, + schema: table.split('.')[0], + table: table.split('.').slice(1).join('.'), + doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, + options: options && parseJSON(options.multi || options.single || ''), + fields: fc.filter(function(x){return x.isField}), + indexes: fc.filter(function(x){return x.type === 'INDEX'}), + constraints: fc.filter(function(x){return x.isConstraint}) + } + }; + var peg$f3 = function(str) {return str}; + var peg$f4 = function(n, o, nn, oo) { return { - type:'procedure', - name: table, - schema: table.split('.')[0], - table: table.split('.').slice(1).join('.'), - doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - params:params + name: nn, + order: oo } - }, - peg$c9 = "%ROWTYPE", - peg$c10 = peg$literalExpectation("%ROWTYPE", false), - peg$c11 = ";", - peg$c12 = peg$literalExpectation(";", false), - peg$c13 = function(tableT, table, doc) { - return { - type:'table type', - name: table.split('.')[0] + '.' + tableT, - schema: table.split('.')[0], - table: table.split('.').slice(1).join('.'), - doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - fields:[] - } - }, - peg$c14 = function(table, doc, fc, options) { - return { - type: 'table', - name: table, - schema: table.split('.')[0], - table: table.split('.').slice(1).join('.'), - doc: doc && doc.single.replace(/^\s+/, '').replace(/\s+$/, '') || false, - options: options && parseJSON(options.multi || options.single || ''), - fields: fc.filter(function(x){return x.isField}), - indexes: fc.filter(function(x){return x.type === 'INDEX'}), - constraints: fc.filter(function(x){return x.isConstraint}) - } - }, - peg$c15 = "\"", - peg$c16 = peg$literalExpectation("\"", false), - peg$c17 = /^[^"]/, - peg$c18 = peg$classExpectation(["\""], true, false), - peg$c19 = function(str) {return str}, - peg$c20 = /^[A-Za-z0-9_$]/, - peg$c21 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "$"], false, false), - peg$c22 = function(n, o, nn, oo) { - return { - name: nn, - order: oo - } - }, - peg$c23 = function(n, o, m) { - m.unshift({ - name: n, - order: o - }); - return m - }, - peg$c24 = ".", - peg$c25 = peg$literalExpectation(".", false), - peg$c26 = function(name) {return name}, - peg$c27 = function(name) {return '['+name+'].'}, - peg$c28 = function(ns, n) {return (ns||'')+'['+n+']'}, - peg$c29 = function(f, ff, p, ws, r) { return [ws, r]}, - peg$c30 = function(f, ff, p, q, e, ee) { - - var x=[p]; - q.forEach(function(pp){ - x.push(pp[0]); - x.push(pp[1]); - }); - x.push(e) - var lastParam; - var lastComment=f[0] && f[f.length-1].multi; - var y = []; - x.forEach(function(pp, i){ - if (i % 2 === 0) { - lastParam = pp; - lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); - y.push(pp); - } else { - if (pp.length && pp[0]){ - pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); - lastComment = pp[pp.length-1].multi; - pp[0].multi && (lastComment = pp[0].multi); - } - } - }); - return y + }; + var peg$f5 = function(n, o, m) { + m.unshift({ + name: n, + order: o + }); + return m + }; + var peg$f6 = function(name) {return name}; + var peg$f7 = function(name) {return '['+name+'].'}; + var peg$f8 = function(ns, n) {return (ns||'')+'['+n+']'}; + var peg$f9 = function(f, ff, p, ws, r) { return [ws, r]}; + var peg$f10 = function(f, ff, p, q, e, ee) { + + var x=[p]; + q.forEach(function(pp){ + x.push(pp[0]); + x.push(pp[1]); + }); + x.push(e) + var lastParam; + var lastComment=f[0] && f[f.length-1].multi; + var y = []; + x.forEach(function(pp, i){ + if (i % 2 === 0) { + lastParam = pp; + lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); + y.push(pp); + } else { + if (pp.length && pp[0]){ + pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); + lastComment = pp[pp.length-1].multi; + pp[0].multi && (lastComment = pp[0].multi); + } + } + }); + return y + + }; + var peg$f11 = function(f, p, ws, r) { return [ws, r]}; + var peg$f12 = function(f, p, q, e) { + + var x=[p]; + q.forEach(function(pp){ + x.push(pp[0]); + x.push(pp[1]); + }); + x.push(e) + var lastParam; + var lastComment=f[0] && f[f.length-1].multi; + var y = []; + x.forEach(function(pp, i){ + if (i % 2 === 0) { + lastParam = pp; + lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); + y.push(pp); + } else { + if (pp.length && pp[0]){ + pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); + lastComment = pp[pp.length-1].multi; + pp[0].multi && (lastComment = pp[0].multi); + } + } + }); + return y + + + }; + var peg$f13 = function(f, p, ws, r) {return [ws, r]}; + var peg$f14 = function(f, p, q, e) { + var x=[p]; + q.forEach(function(pp){ + x.push(pp[0]); + x.push(pp[1]); + }); + x.push(e) + var lastParam; + var lastComment=f[0] && f[f.length-1].multi; + var y = []; + x.forEach(function(pp, i){ + if (i % 2 === 0) { + lastParam = pp; + lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); + y.push(pp); + } else { + if (pp.length && pp[0]){ + pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); + lastComment = pp[pp.length-1].multi; + pp[0].multi && (lastComment = pp[0].multi); + } + } + }); + return y - }, - peg$c31 = function(f, p, ws, r) { return [ws, r]}, - peg$c32 = function(f, p, q, e) { - - var x=[p]; - q.forEach(function(pp){ - x.push(pp[0]); - x.push(pp[1]); - }); - x.push(e) - var lastParam; - var lastComment=f[0] && f[f.length-1].multi; - var y = []; - x.forEach(function(pp, i){ - if (i % 2 === 0) { - lastParam = pp; - lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); - y.push(pp); - } else { - if (pp.length && pp[0]){ - pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); - lastComment = pp[pp.length-1].multi; - pp[0].multi && (lastComment = pp[0].multi); - } + }; + var peg$f15 = function() {return {dir: 'inout'}}; + var peg$f16 = function() {return {dir: 'in'}}; + var peg$f17 = function() {return {dir: 'out'}}; + var peg$f18 = function(n, mode, t, d) {return {name:n, def:{...t, ...mode}, default:!!d}}; + var peg$f19 = function(n) {return n}; + var peg$f20 = function(n, t, i, not_nullable, d) { + var identity = !!i; + var result = { + column:n, + type:t.type, + nullable:!not_nullable, + length:Array.isArray(t.size) ? t.size[0] : t.size, + scale:Array.isArray(t.size) ? t.size[1] : null, + identity: i || false, + isField:true, + default:d + } + return result + }; + var peg$f21 = function(v) {return v}; + var peg$f22 = function(n, c) { + c.isConstraint = true; + c.name = n; + return c + }; + var peg$f23 = function(c, n) { + return { + type: "PRIMARY KEY", + clustered: !!c && c.toLowerCase() === "clustered", + columns: n } - }); - return y - - - }, - peg$c33 = function(f, p, ws, r) {return [ws, r]}, - peg$c34 = function(f, p, q, e) { - var x=[p]; - q.forEach(function(pp){ - x.push(pp[0]); - x.push(pp[1]); - }); - x.push(e) - var lastParam; - var lastComment=f[0] && f[f.length-1].multi; - var y = []; - x.forEach(function(pp, i){ - if (i % 2 === 0) { - lastParam = pp; - lastComment && (pp.doc = lastComment.replace(/^\s+/, '').replace(/\s+$/, '')) && (lastComment=null); - y.push(pp); - } else { - if (pp.length && pp[0]){ - pp[0].single && !lastParam.doc && (lastParam.doc = pp[0].single.replace(/^\s+/, '').replace(/\s+$/, '')); - lastComment = pp[pp.length-1].multi; - pp[0].multi && (lastComment = pp[0].multi); - } + }; + var peg$f24 = function(n, t, c, a) { + return { + type: "FOREIGN KEY", + referenceTable: t, + referenceColumn: c, + actionClauses: a } - }); - return y - - }, - peg$c35 = "in", - peg$c36 = peg$literalExpectation("IN", true), - peg$c37 = "out", - peg$c38 = peg$literalExpectation("OUT", true), - peg$c39 = function() {return {dir: 'inout'}}, - peg$c40 = function() {return {dir: 'in'}}, - peg$c41 = function() {return {dir: 'out'}}, - peg$c42 = "default", - peg$c43 = peg$literalExpectation("DEFAULT", true), - peg$c44 = ":=", - peg$c45 = peg$literalExpectation(":=", false), - peg$c46 = function(n, mode, t, d) {return {name:n, def:{...t, ...mode}, default:!!d}}, - peg$c47 = function(n) {return n}, - peg$c48 = function(n, t, i, not_nullable, d) { - var identity = !!i; - var result = { - column:n, - type:t.type, - nullable:!not_nullable, - length:Array.isArray(t.size) ? t.size[0] : t.size, - scale:Array.isArray(t.size) ? t.size[1] : null, - identity: i || false, - isField:true, - default:d + }; + var peg$f25 = function(c, a) { + return { + type: "CLAUSE_ACTION", + clause: c, + action: a + } + }; + var peg$f26 = function(w, ac) {return [w, ac]}; + var peg$f27 = function(q) { + var y = []; + q.forEach(function(pp){ + y.push(pp[1]); + }); + return y; + }; + var peg$f28 = function(c, n) { + return { + type: "UNIQUE", + columns: n } - return result - }, - peg$c49 = function(v) {return v}, - peg$c50 = "CONSTRAINT", - peg$c51 = peg$literalExpectation("CONSTRAINT", false), - peg$c52 = function(n, c) { - c.isConstraint = true; - c.name = n; - return c - }, - peg$c53 = "primary key", - peg$c54 = peg$literalExpectation("PRIMARY KEY", true), - peg$c55 = function(c, n) { - return { - type: "PRIMARY KEY", - clustered: !!c && c.toLowerCase() === "clustered", - columns: n - } - }, - peg$c56 = "clustered", - peg$c57 = peg$literalExpectation("CLUSTERED", true), - peg$c58 = "nonclustered", - peg$c59 = peg$literalExpectation("NONCLUSTERED", true), - peg$c60 = "asc", - peg$c61 = peg$literalExpectation("ASC", true), - peg$c62 = "desc", - peg$c63 = peg$literalExpectation("DESC", true), - peg$c64 = "no action", - peg$c65 = peg$literalExpectation("NO ACTION", true), - peg$c66 = "set default", - peg$c67 = peg$literalExpectation("SET DEFAULT", true), - peg$c68 = "set null", - peg$c69 = peg$literalExpectation("SET NULL", true), - peg$c70 = "cascade", - peg$c71 = peg$literalExpectation("CASCADE", true), - peg$c72 = "restrict", - peg$c73 = peg$literalExpectation("RESTRICT", true), - peg$c74 = "delete", - peg$c75 = peg$literalExpectation("DELETE", true), - peg$c76 = "update", - peg$c77 = peg$literalExpectation("UPDATE", true), - peg$c78 = "insert", - peg$c79 = peg$literalExpectation("INSERT", true), - peg$c80 = "foreign key", - peg$c81 = peg$literalExpectation("FOREIGN KEY", true), - peg$c82 = "references", - peg$c83 = peg$literalExpectation("REFERENCES", true), - peg$c84 = function(n, t, c, a) { - return { - type: "FOREIGN KEY", - referenceTable: t, - referenceColumn: c, - actionClauses: a - } - }, - peg$c85 = "on", - peg$c86 = peg$literalExpectation("ON", true), - peg$c87 = function(c, a) { - return { - type: "CLAUSE_ACTION", - clause: c, - action: a - } - }, - peg$c88 = function(w, ac) {return [w, ac]}, - peg$c89 = function(q) { - var y = []; - q.forEach(function(pp){ - y.push(pp[1]); - }); - return y; - }, - peg$c90 = "unique", - peg$c91 = peg$literalExpectation("UNIQUE", true), - peg$c92 = function(c, n) { - return { - type: "UNIQUE", - columns: n - } - }, - peg$c93 = "check", - peg$c94 = peg$literalExpectation("CHECK", true), - peg$c95 = function(e) { - return { - type: "CHECK", - expression: e - } - }, - peg$c96 = function() {return text()}, - peg$c97 = /^[^()]/, - peg$c98 = peg$classExpectation(["(", ")"], true, false), - peg$c99 = "(", - peg$c100 = peg$literalExpectation("(", false), - peg$c101 = ")", - peg$c102 = peg$literalExpectation(")", false), - peg$c103 = "null", - peg$c104 = peg$literalExpectation("NULL", true), - peg$c105 = "not null", - peg$c106 = peg$literalExpectation("NOT NULL", true), - peg$c107 = function(x) {return x.toLowerCase() === "not null"}, - peg$c108 = "generated", - peg$c109 = peg$literalExpectation("GENERATED", true), - peg$c110 = "by", - peg$c111 = peg$literalExpectation("BY", true), - peg$c112 = "as", - peg$c113 = peg$literalExpectation("AS", true), - peg$c114 = "identity", - peg$c115 = peg$literalExpectation("IDENTITY", true), - peg$c116 = function(a) {return a || {}}, - peg$c117 = function(s, i) {return {seed: s, increment: i}}, - peg$c118 = "start", - peg$c119 = peg$literalExpectation("START", true), - peg$c120 = "with", - peg$c121 = peg$literalExpectation("WITH", true), - peg$c122 = function(s) {return s}, - peg$c123 = "increment", - peg$c124 = peg$literalExpectation("INCREMENT", true), - peg$c125 = function(i) {return i}, - peg$c126 = function(n1, n2) {return {type:'nested', typeName:n1+'.'+n2}}, - peg$c127 = "max", - peg$c128 = peg$literalExpectation("max", true), - peg$c129 = function(n, s) {return s}, - peg$c130 = function(n, s1, s2) {return [s1,s2]}, - peg$c131 = function(n, size) { - return {type:n.toLowerCase(), size:defaultSize(n.toLowerCase(), size)} - }, - peg$c132 = function() {var result = Number.parseFloat(text()); return Number.isNaN(result)?text():result;}, - peg$c133 = /^[^'\r\n]/, - peg$c134 = peg$classExpectation(["'", "\r", "\n"], true, false), - peg$c135 = function(s) {return s.join('')}, - peg$c136 = function() {return '\''}, - peg$c137 = /^[0-9]/, - peg$c138 = peg$classExpectation([["0", "9"]], false, false), - peg$c139 = "'", - peg$c140 = peg$literalExpectation("'", false), - peg$c141 = "e", - peg$c142 = peg$literalExpectation("E", true), - peg$c143 = function() {return }, - peg$c144 = function(ws) {return ws.filter(function(x){return x})}, - peg$c145 = "type", - peg$c146 = peg$literalExpectation("TYPE", true), - peg$c147 = "procedure", - peg$c148 = peg$literalExpectation("PROCEDURE", true), - peg$c149 = "is", - peg$c150 = peg$literalExpectation("IS", true), - peg$c151 = "of", - peg$c152 = peg$literalExpectation("OF", true), - peg$c153 = "table", - peg$c154 = peg$literalExpectation("TABLE", true), - peg$c155 = peg$anyExpectation(), - peg$c156 = "+", - peg$c157 = peg$literalExpectation("+", false), - peg$c158 = "-", - peg$c159 = peg$literalExpectation("-", false), - peg$c160 = ",", - peg$c161 = peg$literalExpectation(",", false), - peg$c162 = "output", - peg$c163 = peg$literalExpectation("output", true), - peg$c164 = peg$literalExpectation("out", true), - peg$c165 = /^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, - peg$c166 = peg$classExpectation([" ", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u202F", "\u205F", "\u3000"], false, false), - peg$c167 = peg$otherExpectation("whitespace"), - peg$c168 = "\t", - peg$c169 = peg$literalExpectation("\t", false), - peg$c170 = "\x0B", - peg$c171 = peg$literalExpectation("\x0B", false), - peg$c172 = "\f", - peg$c173 = peg$literalExpectation("\f", false), - peg$c174 = " ", - peg$c175 = peg$literalExpectation(" ", false), - peg$c176 = "\xA0", - peg$c177 = peg$literalExpectation("\xA0", false), - peg$c178 = "\uFEFF", - peg$c179 = peg$literalExpectation("\uFEFF", false), - peg$c180 = /^[\n\r\u2028\u2029]/, - peg$c181 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false), - peg$c182 = peg$otherExpectation("end of line"), - peg$c183 = "\n", - peg$c184 = peg$literalExpectation("\n", false), - peg$c185 = "\r\n", - peg$c186 = peg$literalExpectation("\r\n", false), - peg$c187 = "\r", - peg$c188 = peg$literalExpectation("\r", false), - peg$c189 = "\u2028", - peg$c190 = peg$literalExpectation("\u2028", false), - peg$c191 = "\u2029", - peg$c192 = peg$literalExpectation("\u2029", false), - peg$c193 = peg$otherExpectation("comment"), - peg$c194 = "*/", - peg$c195 = peg$literalExpectation("*/", false), - peg$c196 = function() {return {multi:text()}}, - peg$c197 = "/*", - peg$c198 = peg$literalExpectation("/*", false), - peg$c199 = function(x) {return x}, - peg$c200 = function() {return {single:text()}}, - peg$c201 = "--", - peg$c202 = peg$literalExpectation("--", false), - peg$c203 = "index", - peg$c204 = peg$literalExpectation("INDEX", true), - peg$c205 = "WHERE", - peg$c206 = peg$literalExpectation("WHERE", false), - peg$c207 = function(n, u, c, col) {return text().trim()}, - peg$c208 = function(n, u, c, col, filter) {return filter}, - peg$c209 = function(n, u, c, col, filter) { - return { - type: "INDEX", - name: n, - clustered: !!c && c.toLowerCase() === "clustered", - unique: !!u && u.toLowerCase() === "unique", - columns: col, - filter - } - }, + }; + var peg$f29 = function(e) { + return { + type: "CHECK", + expression: e + } + }; + var peg$f30 = function() {return text()}; + var peg$f31 = function(x) {return x.toLowerCase() === "not null"}; + var peg$f32 = function(a) {return a || {}}; + var peg$f33 = function(s, i) {return {seed: s, increment: i}}; + var peg$f34 = function(s) {return s}; + var peg$f35 = function(i) {return i}; + var peg$f36 = function(n1, n2) {return {type:'nested', typeName:n1+'.'+n2}}; + var peg$f37 = function(n, s) {return s}; + var peg$f38 = function(n, s1, s2) {return [s1,s2]}; + var peg$f39 = function(n, size) { + return {type:n.toLowerCase(), size:defaultSize(n.toLowerCase(), size)} + }; + var peg$f40 = function() {var result = Number.parseFloat(text()); return Number.isNaN(result)?text():result;}; + var peg$f41 = function(s) {return s.join('')}; + var peg$f42 = function() {return '\''}; + var peg$f43 = function() {return }; + var peg$f44 = function(ws) {return ws.filter(function(x){return x})}; + var peg$f45 = function() {return {multi:text()}}; + var peg$f46 = function(x) {return x}; + var peg$f47 = function() {return {single:text()}}; + var peg$f48 = function(n, u, c, col) {return text().trim()}; + var peg$f49 = function(n, u, c, col, filter) {return filter}; + var peg$f50 = function(n, u, c, col, filter) { + return { + type: "INDEX", + name: n, + clustered: !!c && c.toLowerCase() === "clustered", + unique: !!u && u.toLowerCase() === "unique", + columns: col, + filter + } + }; - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1 }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, + var peg$currPos = 0; + var peg$savedPos = 0; + var peg$posDetailsCache = [{ line: 1, column: 1 }]; + var peg$maxFailPos = 0; + var peg$maxFailExpected = []; + var peg$silentFails = 0; - peg$result; + var peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { @@ -555,12 +588,26 @@ function peg$parse(input, options) { return input.substring(peg$savedPos, peg$currPos); } + function offset() { + return peg$savedPos; + } + + function range() { + return { + source: peg$source, + start: peg$savedPos, + end: peg$currPos + }; + } + function location() { return peg$computeLocation(peg$savedPos, peg$currPos); } function expected(description, location) { - location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) + location = location !== undefined + ? location + : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildStructuredError( [peg$otherExpectation(description)], @@ -570,7 +617,9 @@ function peg$parse(input, options) { } function error(message, location) { - location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) + location = location !== undefined + ? location + : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildSimpleError(message, location); } @@ -596,7 +645,8 @@ function peg$parse(input, options) { } function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], p; + var details = peg$posDetailsCache[pos]; + var p; if (details) { return details; @@ -608,7 +658,7 @@ function peg$parse(input, options) { details = peg$posDetailsCache[p]; details = { - line: details.line, + line: details.line, column: details.column }; @@ -624,23 +674,25 @@ function peg$parse(input, options) { } peg$posDetailsCache[pos] = details; + return details; } } function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); + var startPosDetails = peg$computePosDetails(startPos); + var endPosDetails = peg$computePosDetails(endPos); return { + source: peg$source, start: { offset: startPos, - line: startPosDetails.line, + line: startPosDetails.line, column: startPosDetails.column }, end: { offset: endPos, - line: endPosDetails.line, + line: endPosDetails.line, column: endPosDetails.column } }; @@ -692,36 +744,36 @@ function peg$parse(input, options) { peg$currPos += 5; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c1); } + if (peg$silentFails === 0) { peg$fail(peg$e0); } } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c4) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c2) { s3 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } + if (peg$silentFails === 0) { peg$fail(peg$e2); } } if (s3 !== peg$FAILED) { s4 = peg$parsews1(); if (s4 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c6) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c3) { s5 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } + if (peg$silentFails === 0) { peg$fail(peg$e3); } } if (s5 !== peg$FAILED) { s1 = [s1, s2, s3, s4, s5]; @@ -747,12 +799,12 @@ function peg$parse(input, options) { s0 = peg$FAILED; } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } } } @@ -765,52 +817,31 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsecreateoralter(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parsePROCEDURE(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parsename(); - if (s6 !== peg$FAILED) { - s7 = peg$parseWhitespaceSingleLineComment(); - if (s7 === peg$FAILED) { - s7 = null; - } - if (s7 !== peg$FAILED) { - s8 = peg$parseparams(); - if (s8 === peg$FAILED) { - s8 = null; - } - if (s8 !== peg$FAILED) { - s9 = peg$parseAS(); - if (s9 !== peg$FAILED) { - s10 = peg$parsews1(); - if (s10 !== peg$FAILED) { - s11 = peg$parsebody(); - if (s11 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c8(s6, s7, s8); - 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; - } + s2 = peg$parsecreateoralter(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parsePROCEDURE(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parsename(); + if (s6 !== peg$FAILED) { + s7 = peg$parseWhitespaceSingleLineComment(); + if (s7 === peg$FAILED) { + s7 = null; + } + s8 = peg$parseparams(); + if (s8 === peg$FAILED) { + s8 = null; + } + s9 = peg$parseAS(); + if (s9 !== peg$FAILED) { + s10 = peg$parsews1(); + if (s10 !== peg$FAILED) { + s11 = peg$parsebody(); + peg$savedPos = s0; + s0 = peg$f0(s6, s7, s8); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -848,71 +879,50 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parseTYPE(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parsename(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parseIS(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews1(); - if (s7 !== peg$FAILED) { - s8 = peg$parseTABLE(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parseOF(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews1(); - if (s11 !== peg$FAILED) { - s12 = peg$parsename(); - if (s12 !== peg$FAILED) { - if (input.substr(peg$currPos, 8) === peg$c9) { - s13 = peg$c9; - peg$currPos += 8; - } else { - s13 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c10); } - } - if (s13 !== peg$FAILED) { - s14 = peg$parseWhitespaceSingleLineComment(); - if (s14 === peg$FAILED) { - s14 = null; - } - if (s14 !== peg$FAILED) { - s15 = peg$parsews(); - if (s15 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s16 = peg$c11; - peg$currPos++; - } else { - s16 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s16 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c13(s4, s12, s14); - 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; - } + s2 = peg$parseTYPE(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parsename(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parseIS(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews1(); + if (s7 !== peg$FAILED) { + s8 = peg$parseTABLE(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parseOF(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews1(); + if (s11 !== peg$FAILED) { + s12 = peg$parsename(); + if (s12 !== peg$FAILED) { + if (input.substr(peg$currPos, 8) === peg$c4) { + s13 = peg$c4; + peg$currPos += 8; + } else { + s13 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e4); } + } + if (s13 !== peg$FAILED) { + s14 = peg$parseWhitespaceSingleLineComment(); + if (s14 === peg$FAILED) { + s14 = null; + } + s15 = peg$parsews(); + if (input.charCodeAt(peg$currPos) === 59) { + s16 = peg$c5; + peg$currPos++; + } else { + s16 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e5); } + } + if (s16 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f1(s4, s12, s14); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -970,75 +980,36 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsecreateoralter(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - s4 = peg$parseTABLE(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parsename(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parselparen(); - if (s8 !== peg$FAILED) { - s9 = peg$parseWhitespaceSingleLineComment(); - if (s9 === peg$FAILED) { - s9 = null; - } - if (s9 !== peg$FAILED) { - s10 = peg$parsefields_and_constraints(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parserparen(); - if (s12 !== peg$FAILED) { - s13 = peg$parsewsnocomment(); - if (s13 === peg$FAILED) { - s13 = null; - } - if (s13 !== peg$FAILED) { - s14 = peg$parseComment(); - if (s14 === peg$FAILED) { - s14 = null; - } - if (s14 !== peg$FAILED) { - s15 = peg$parsews(); - if (s15 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c14(s6, s9, s10, s14); - 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; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; + s2 = peg$parsecreateoralter(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + s4 = peg$parseTABLE(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parsename(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parselparen(); + if (s8 !== peg$FAILED) { + s9 = peg$parseWhitespaceSingleLineComment(); + if (s9 === peg$FAILED) { + s9 = null; + } + s10 = peg$parsefields_and_constraints(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parserparen(); + if (s12 !== peg$FAILED) { + s13 = peg$parsewsnocomment(); + s14 = peg$parseComment(); + if (s14 === peg$FAILED) { + s14 = null; } + s15 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f2(s6, s9, s10, s14); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1080,31 +1051,31 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c15; + s1 = peg$c6; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } + if (peg$silentFails === 0) { peg$fail(peg$e6); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = []; - if (peg$c17.test(input.charAt(peg$currPos))) { + if (peg$r0.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } + if (peg$silentFails === 0) { peg$fail(peg$e7); } } if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c17.test(input.charAt(peg$currPos))) { + if (peg$r0.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } + if (peg$silentFails === 0) { peg$fail(peg$e7); } } } } else { @@ -1117,16 +1088,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c15; + s3 = peg$c6; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } + if (peg$silentFails === 0) { peg$fail(peg$e6); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c19(s2); - s0 = s1; + s0 = peg$f3(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1142,22 +1112,22 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; - if (peg$c20.test(input.charAt(peg$currPos))) { + if (peg$r1.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$e8); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); - if (peg$c20.test(input.charAt(peg$currPos))) { + if (peg$r1.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } + if (peg$silentFails === 0) { peg$fail(peg$e8); } } } } else { @@ -1178,126 +1148,63 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsename(); - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parseorder(); - if (s4 === peg$FAILED) { - s4 = null; + s2 = peg$parsename(); + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s4 = peg$parseorder(); + if (s4 === peg$FAILED) { + s4 = null; + } + s5 = []; + s6 = peg$currPos; + s7 = peg$parsews(); + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsename(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parseorder(); + if (s12 === peg$FAILED) { + s12 = null; } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$currPos; - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsename(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parseorder(); - if (s12 === peg$FAILED) { - s12 = null; - } - if (s12 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c22(s2, s4, s10, s12); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$currPos; - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsename(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parseorder(); - if (s12 === peg$FAILED) { - s12 = null; - } - if (s12 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c22(s2, s4, s10, s12); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c23(s2, s4, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$savedPos = s6; + s6 = peg$f4(s2, s4, s10, s12); + } else { + peg$currPos = s6; + s6 = peg$FAILED; + } + } else { + peg$currPos = s6; + s6 = peg$FAILED; + } + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$currPos; + s7 = peg$parsews(); + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsename(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parseorder(); + if (s12 === peg$FAILED) { + s12 = null; } + peg$savedPos = s6; + s6 = peg$f4(s2, s4, s10, s12); } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } + peg$savedPos = s0; + s0 = peg$f5(s2, s4, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1313,16 +1220,15 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c24; + s2 = peg$c7; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } + if (peg$silentFails === 0) { peg$fail(peg$e9); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c26(s1); - s0 = s1; + s0 = peg$f6(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1342,16 +1248,15 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c24; + s2 = peg$c7; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } + if (peg$silentFails === 0) { peg$fail(peg$e9); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c27(s1); - s0 = s1; + s0 = peg$f7(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1372,23 +1277,12 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = null; } - if (s1 !== peg$FAILED) { - s2 = peg$parsename(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c28(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; + s2 = peg$parsename(); + if (s2 === peg$FAILED) { + s2 = null; } + peg$savedPos = s0; + s0 = peg$f8(s1, s2); return s0; } @@ -1408,24 +1302,13 @@ function peg$parse(input, options) { s5 = []; s6 = peg$currPos; s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parseparam(); - if (s10 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c29(s1, s3, s4, s9, s10); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parseparam(); + if (s10 !== peg$FAILED) { + peg$savedPos = s6; + s6 = peg$f9(s1, s3, s4, s9, s10); } else { peg$currPos = s6; s6 = peg$FAILED; @@ -1438,24 +1321,13 @@ function peg$parse(input, options) { s5.push(s6); s6 = peg$currPos; s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parseparam(); - if (s10 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c29(s1, s3, s4, s9, s10); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parseparam(); + if (s10 !== peg$FAILED) { + peg$savedPos = s6; + s6 = peg$f9(s1, s3, s4, s9, s10); } else { peg$currPos = s6; s6 = peg$FAILED; @@ -1465,20 +1337,14 @@ function peg$parse(input, options) { s6 = peg$FAILED; } } - if (s5 !== peg$FAILED) { - s6 = peg$parsews1(); - if (s6 !== peg$FAILED) { - s7 = peg$parserparen(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews1(); - if (s8 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c30(s1, s3, s4, s5, s6, s8); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s6 = peg$parsews1(); + if (s6 !== peg$FAILED) { + s7 = peg$parserparen(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews1(); + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f10(s1, s3, s4, s5, s6, s8); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1519,83 +1385,50 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsefield_or_constraint(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield_or_constraint(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c31(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + s2 = peg$parsefield_or_constraint(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield_or_constraint(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f11(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield_or_constraint(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c31(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield_or_constraint(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f11(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews1(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c32(s1, s2, s3, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s4; + s4 = peg$FAILED; } + } + s4 = peg$parsews1(); + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f12(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1627,87 +1460,49 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parsefield(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c33(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + s2 = peg$parsefield(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f13(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$currPos; - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsecomma(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsefield(); - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s5 = peg$c33(s1, s2, s7, s8); - s4 = s5; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parsews(); + s6 = peg$parsecomma(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsefield(); + if (s8 !== peg$FAILED) { + peg$savedPos = s4; + s4 = peg$f13(s1, s2, s7, s8); } else { peg$currPos = s4; s4 = peg$FAILED; } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c34(s1, s2, s3, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s4; + s4 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } + s4 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f14(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1720,27 +1515,26 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c35) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c8) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } + if (peg$silentFails === 0) { peg$fail(peg$e10); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c37) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c9) { s3 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c38); } + if (peg$silentFails === 0) { peg$fail(peg$e11); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c39(); - s0 = s1; + s0 = peg$f15(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1755,30 +1549,30 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c35) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c8) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } + if (peg$silentFails === 0) { peg$fail(peg$e10); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c40(); + s1 = peg$f16(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c37) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c9) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c38); } + if (peg$silentFails === 0) { peg$fail(peg$e11); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c41(); + s1 = peg$f17(); } s0 = s1; } @@ -1799,72 +1593,46 @@ function peg$parse(input, options) { if (s3 === peg$FAILED) { s3 = null; } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseparam_type(); - if (s5 !== peg$FAILED) { - s6 = peg$currPos; - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c42) { - s8 = input.substr(peg$currPos, 7); - peg$currPos += 7; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } - if (s8 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c44) { - s8 = peg$c44; - peg$currPos += 2; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c45); } - } - } - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsevalue(); - if (s10 !== peg$FAILED) { - s7 = [s7, s8, s9, s10]; - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c46(s1, s3, s5, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s4 = peg$parsews(); + s5 = peg$parseparam_type(); + if (s5 !== peg$FAILED) { + s6 = peg$currPos; + s7 = peg$parsews(); + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c10) { + s8 = input.substr(peg$currPos, 7); + peg$currPos += 7; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e12); } + } + if (s8 === peg$FAILED) { + if (input.substr(peg$currPos, 2) === peg$c11) { + s8 = peg$c11; + peg$currPos += 2; } else { - peg$currPos = s0; - s0 = peg$FAILED; + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e13); } + } + } + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsevalue(); + if (s10 !== peg$FAILED) { + s7 = [s7, s8, s9, s10]; + s6 = s7; + } else { + peg$currPos = s6; + s6 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } + if (s6 === peg$FAILED) { + s6 = null; + } + peg$savedPos = s0; + s0 = peg$f18(s1, s3, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1888,7 +1656,7 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c47(s1); + s1 = peg$f19(s1); } s0 = s1; @@ -1909,32 +1677,16 @@ function peg$parse(input, options) { if (s4 === peg$FAILED) { s4 = null; } - if (s4 !== peg$FAILED) { - s5 = peg$parsenot_nullable(); - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsedefault(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c48(s1, s3, s4, s5, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; + s5 = peg$parsenot_nullable(); + if (s5 === peg$FAILED) { + s5 = null; } + s6 = peg$parsedefault(); + if (s6 === peg$FAILED) { + s6 = null; + } + peg$savedPos = s0; + s0 = peg$f20(s1, s3, s4, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1956,46 +1708,25 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c42) { - s2 = input.substr(peg$currPos, 7); - peg$currPos += 7; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parselparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsedefault_value(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parserparen(); - if (s8 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c49(s6); - 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 (input.substr(peg$currPos, 7).toLowerCase() === peg$c10) { + s2 = input.substr(peg$currPos, 7); + peg$currPos += 7; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e12); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s4 = peg$parselparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsedefault_value(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parserparen(); + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f21(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2031,12 +1762,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 10) === peg$c50) { - s1 = peg$c50; + if (input.substr(peg$currPos, 10) === peg$c12) { + s1 = peg$c12; peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$e14); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); @@ -2057,8 +1788,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c52(s3, s5); - s0 = s1; + s0 = peg$f22(s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2087,56 +1817,30 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c53) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c13) { s1 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c54); } + if (peg$silentFails === 0) { peg$fail(peg$e15); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseclustered(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parselparen(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parsenames(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parserparen(); - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c55(s3, s7); - 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; - } + s3 = peg$parseclustered(); + if (s3 === peg$FAILED) { + s3 = null; + } + s4 = peg$parsews(); + s5 = peg$parselparen(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parsenames(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + s9 = peg$parserparen(); + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f23(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2160,20 +1864,20 @@ function peg$parse(input, options) { function peg$parseclustered() { var s0; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c56) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c14) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } + if (peg$silentFails === 0) { peg$fail(peg$e16); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 12).toLowerCase() === peg$c58) { + if (input.substr(peg$currPos, 12).toLowerCase() === peg$c15) { s0 = input.substr(peg$currPos, 12); peg$currPos += 12; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } + if (peg$silentFails === 0) { peg$fail(peg$e17); } } } @@ -2183,20 +1887,20 @@ function peg$parse(input, options) { function peg$parseorder() { var s0; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c60) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c16) { s0 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$e18); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c62) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c17) { s0 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } + if (peg$silentFails === 0) { peg$fail(peg$e19); } } } @@ -2206,44 +1910,44 @@ function peg$parse(input, options) { function peg$parseaction() { var s0; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c64) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c18) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } + if (peg$silentFails === 0) { peg$fail(peg$e20); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c66) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c19) { s0 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c67); } + if (peg$silentFails === 0) { peg$fail(peg$e21); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c68) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c20) { s0 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } + if (peg$silentFails === 0) { peg$fail(peg$e22); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c70) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c21) { s0 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c71); } + if (peg$silentFails === 0) { peg$fail(peg$e23); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c72) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c22) { s0 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } } } @@ -2256,28 +1960,28 @@ function peg$parse(input, options) { function peg$parseclause() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c74) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c23) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c75); } + if (peg$silentFails === 0) { peg$fail(peg$e25); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c76) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c24) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c77); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c78) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c25) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } } } @@ -2289,97 +1993,46 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18; s0 = peg$currPos; - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c80) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c26) { s1 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c81); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parselparen(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parsename(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parserparen(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c82) { - s9 = input.substr(peg$currPos, 10); - peg$currPos += 10; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c83); } - } - if (s9 !== peg$FAILED) { - s10 = peg$parsews(); - if (s10 !== peg$FAILED) { - s11 = peg$parsefullname(); - if (s11 !== peg$FAILED) { - s12 = peg$parsews(); - if (s12 !== peg$FAILED) { - s13 = peg$parselparen(); - if (s13 !== peg$FAILED) { - s14 = peg$parsews(); - if (s14 !== peg$FAILED) { - s15 = peg$parsename(); - if (s15 !== peg$FAILED) { - s16 = peg$parsews(); - if (s16 !== peg$FAILED) { - s17 = peg$parserparen(); - if (s17 !== peg$FAILED) { - s18 = peg$parsefk_clause_actions(); - if (s18 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c84(s5, s11, s15, s18); - 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; - } - } 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; - } + s3 = peg$parselparen(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parsename(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parserparen(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c27) { + s9 = input.substr(peg$currPos, 10); + peg$currPos += 10; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e29); } + } + if (s9 !== peg$FAILED) { + s10 = peg$parsews(); + s11 = peg$parsefullname(); + s12 = peg$parsews(); + s13 = peg$parselparen(); + if (s13 !== peg$FAILED) { + s14 = peg$parsews(); + s15 = peg$parsename(); + if (s15 !== peg$FAILED) { + s16 = peg$parsews(); + s17 = peg$parserparen(); + if (s17 !== peg$FAILED) { + s18 = peg$parsefk_clause_actions(); + peg$savedPos = s0; + s0 = peg$f24(s5, s11, s15, s18); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2420,33 +2073,22 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c85) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c28) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseclause(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseaction(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c87(s3, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parseclause(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parseaction(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f25(s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2467,19 +2109,13 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4; s0 = peg$currPos; - s1 = []; - s2 = peg$currPos; - s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parsefk_clause_action(); - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c88(s3, s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s1 = []; + s2 = peg$currPos; + s3 = peg$parsews(); + s4 = peg$parsefk_clause_action(); + if (s4 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f26(s3, s4); } else { peg$currPos = s2; s2 = peg$FAILED; @@ -2488,25 +2124,17 @@ function peg$parse(input, options) { s1.push(s2); s2 = peg$currPos; s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parsefk_clause_action(); - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c88(s3, s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s4 = peg$parsefk_clause_action(); + if (s4 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f26(s3, s4); } else { peg$currPos = s2; s2 = peg$FAILED; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c89(s1); - } + peg$savedPos = s0; + s1 = peg$f27(s1); s0 = s1; return s0; @@ -2516,56 +2144,30 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c90) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c29) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parseclustered(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parselparen(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parsenames(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parserparen(); - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c92(s3, s7); - 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; - } + s3 = peg$parseclustered(); + if (s3 === peg$FAILED) { + s3 = null; + } + s4 = peg$parsews(); + s5 = peg$parselparen(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parsenames(); + if (s7 !== peg$FAILED) { + s8 = peg$parsews(); + s9 = peg$parserparen(); + if (s9 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f28(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2590,41 +2192,25 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c93) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c30) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); - if (s2 !== peg$FAILED) { - s3 = peg$parselparen(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseexpression(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parserparen(); - if (s7 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c95(s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parselparen(); + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parseexpression(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s7 = peg$parserparen(); + if (s7 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f29(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2654,21 +2240,11 @@ function peg$parse(input, options) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseterm(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s4 = [s4, s5, s6]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + s5 = peg$parseterm(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s4 = [s4, s5, s6]; + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -2677,34 +2253,18 @@ function peg$parse(input, options) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseterm(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s4 = [s4, s5, s6]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } + s5 = peg$parseterm(); + if (s5 !== peg$FAILED) { + s6 = peg$parsews(); + s4 = [s4, s5, s6]; + s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c96(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f30(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2717,22 +2277,22 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = []; - if (peg$c97.test(input.charAt(peg$currPos))) { + if (peg$r2.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c97.test(input.charAt(peg$currPos))) { + if (peg$r2.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } } } else { @@ -2741,32 +2301,27 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c99; + s1 = peg$c31; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c100); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s1 !== peg$FAILED) { s2 = peg$parseexpression(); if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s3 = peg$c101; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } - } - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.charCodeAt(peg$currPos) === 41) { + s3 = peg$c32; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e35); } + } + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2796,31 +2351,25 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c103) { - s2 = input.substr(peg$currPos, 4); - peg$currPos += 4; + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c33) { + s2 = input.substr(peg$currPos, 4); + peg$currPos += 4; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e36); } + } + if (s2 === peg$FAILED) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c34) { + s2 = input.substr(peg$currPos, 8); + peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } - } - if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c105) { - s2 = input.substr(peg$currPos, 8); - peg$currPos += 8; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c106); } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c107(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e37); } } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f31(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2835,66 +2384,60 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews1(); if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c108) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c35) { s2 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c109); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } if (s2 !== peg$FAILED) { s3 = peg$parsews1(); if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c110) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c36) { s4 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s4 !== peg$FAILED) { s5 = peg$parsews1(); if (s5 !== peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c42) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c10) { s6 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$e12); } } if (s6 !== peg$FAILED) { s7 = peg$parsews1(); if (s7 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c112) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c37) { s8 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s8 !== peg$FAILED) { s9 = peg$parsews1(); if (s9 !== peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c114) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c38) { s10 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s10 !== peg$FAILED) { s11 = peg$parseidentity_arguments(); if (s11 === peg$FAILED) { s11 = null; } - if (s11 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c116(s11); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f32(s11); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2944,35 +2487,19 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s2 = peg$parselparen(); - if (s2 !== peg$FAILED) { - s3 = peg$parseidentity_start(); - if (s3 !== peg$FAILED) { - s4 = peg$parseidentity_increment(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parserparen(); - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c117(s3, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s2 = peg$parselparen(); + if (s2 !== peg$FAILED) { + s3 = peg$parseidentity_start(); + if (s3 !== peg$FAILED) { + s4 = peg$parseidentity_increment(); + if (s4 === peg$FAILED) { + s4 = null; + } + s5 = peg$parsews(); + s6 = peg$parserparen(); + if (s6 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f33(s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2994,36 +2521,30 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c118) { - s2 = input.substr(peg$currPos, 5); - peg$currPos += 5; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c120) { - s4 = input.substr(peg$currPos, 4); - peg$currPos += 4; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parsesigned_number(); - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c122(s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c39) { + s2 = input.substr(peg$currPos, 5); + peg$currPos += 5; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e42); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c40) { + s4 = input.substr(peg$currPos, 4); + peg$currPos += 4; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e43); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parsesigned_number(); + if (s6 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f34(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3047,42 +2568,36 @@ function peg$parse(input, options) { return s0; } - - function peg$parseidentity_increment() { - var s0, s1, s2, s3, s4, s5, s6; - - s0 = peg$currPos; - s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c123) { - s2 = input.substr(peg$currPos, 9); - peg$currPos += 9; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c124); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews1(); - if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c110) { - s4 = input.substr(peg$currPos, 2); - peg$currPos += 2; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parsews1(); - if (s5 !== peg$FAILED) { - s6 = peg$parsesigned_number(); - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c125(s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + + function peg$parseidentity_increment() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsews(); + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c41) { + s2 = input.substr(peg$currPos, 9); + peg$currPos += 9; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e44); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsews1(); + if (s3 !== peg$FAILED) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c36) { + s4 = input.substr(peg$currPos, 2); + peg$currPos += 2; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e39); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parsews1(); + if (s5 !== peg$FAILED) { + s6 = peg$parsesigned_number(); + if (s6 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f35(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3114,18 +2629,17 @@ function peg$parse(input, options) { s1 = peg$parsename(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c24; + s2 = peg$c7; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } + if (peg$silentFails === 0) { peg$fail(peg$e9); } } if (s2 !== peg$FAILED) { s3 = peg$parsename(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); - s0 = s1; + s0 = peg$f36(s1, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3150,41 +2664,25 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parselparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsesigned_number(); - if (s6 === peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c127) { - s6 = input.substr(peg$currPos, 3); - peg$currPos += 3; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - } - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parserparen(); - if (s8 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c129(s1, s6); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s4 = peg$parselparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsesigned_number(); + if (s6 === peg$FAILED) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c42) { + s6 = input.substr(peg$currPos, 3); + peg$currPos += 3; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e45); } + } + } + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parserparen(); + if (s8 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f37(s1, s6); } else { peg$currPos = s2; s2 = peg$FAILED; @@ -3200,48 +2698,22 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews(); - if (s3 !== peg$FAILED) { - s4 = peg$parselparen(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (s5 !== peg$FAILED) { - s6 = peg$parsesigned_number(); - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - if (s7 !== peg$FAILED) { - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsews(); - if (s9 !== peg$FAILED) { - s10 = peg$parsesigned_number(); - if (s10 !== peg$FAILED) { - s11 = peg$parsews(); - if (s11 !== peg$FAILED) { - s12 = peg$parserparen(); - if (s12 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c130(s1, s6, s10); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s4 = peg$parselparen(); + if (s4 !== peg$FAILED) { + s5 = peg$parsews(); + s6 = peg$parsesigned_number(); + if (s6 !== peg$FAILED) { + s7 = peg$parsews(); + s8 = peg$parsecomma(); + if (s8 !== peg$FAILED) { + s9 = peg$parsews(); + s10 = peg$parsesigned_number(); + if (s10 !== peg$FAILED) { + s11 = peg$parsews(); + s12 = peg$parserparen(); + if (s12 !== peg$FAILED) { + peg$savedPos = s2; + s2 = peg$f38(s1, s6, s10); } else { peg$currPos = s2; s2 = peg$FAILED; @@ -3266,14 +2738,8 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c131(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f39(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3294,22 +2760,17 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s3 = peg$parsenumeric_literal(); - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } + s3 = peg$parsenumeric_literal(); + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c132(); + s1 = peg$f40(); } s0 = s1; @@ -3323,12 +2784,12 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$parsestring_literal(); if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c103) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c33) { s0 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } } } @@ -3343,39 +2804,33 @@ function peg$parse(input, options) { s1 = peg$parsequote(); if (s1 !== peg$FAILED) { s2 = []; - if (peg$c133.test(input.charAt(peg$currPos))) { + if (peg$r3.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } if (s3 === peg$FAILED) { s3 = peg$parseqq(); } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c133.test(input.charAt(peg$currPos))) { + if (peg$r3.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } if (s3 === peg$FAILED) { s3 = peg$parseqq(); } } - if (s2 !== peg$FAILED) { - s3 = peg$parsequote(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c135(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s3 = peg$parsequote(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f41(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3397,8 +2852,7 @@ function peg$parse(input, options) { s2 = peg$parsequote(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c136(); - s0 = s1; + s0 = peg$f42(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3454,13 +2908,8 @@ function peg$parse(input, options) { if (s3 === peg$FAILED) { s3 = null; } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } + s2 = [s2, s3]; + s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; @@ -3502,24 +2951,19 @@ function peg$parse(input, options) { if (s4 === peg$FAILED) { s4 = null; } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$parsedigit(); - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$parsedigit(); - } - } else { - s5 = peg$FAILED; - } - if (s5 !== peg$FAILED) { - s3 = [s3, s4, s5]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; + s5 = []; + s6 = peg$parsedigit(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsedigit(); } + } else { + s5 = peg$FAILED; + } + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; @@ -3531,13 +2975,8 @@ function peg$parse(input, options) { if (s2 === peg$FAILED) { s2 = null; } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s1 = [s1, s2]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3549,12 +2988,12 @@ function peg$parse(input, options) { function peg$parsedigit() { var s0; - if (peg$c137.test(input.charAt(peg$currPos))) { + if (peg$r4.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c138); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } return s0; @@ -3564,11 +3003,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 39) { - s0 = peg$c139; + s0 = peg$c43; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c140); } + if (peg$silentFails === 0) { peg$fail(peg$e48); } } return s0; @@ -3578,11 +3017,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c24; + s0 = peg$c7; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } + if (peg$silentFails === 0) { peg$fail(peg$e9); } } return s0; @@ -3591,12 +3030,12 @@ function peg$parse(input, options) { function peg$parseE() { var s0; - if (input.substr(peg$currPos, 1).toLowerCase() === peg$c141) { + if (input.substr(peg$currPos, 1).toLowerCase() === peg$c44) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c142); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } return s0; @@ -3611,7 +3050,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3619,7 +3058,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3632,7 +3071,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3640,7 +3079,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3648,10 +3087,8 @@ function peg$parse(input, options) { } } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c144(s1); - } + peg$savedPos = s0; + s1 = peg$f44(s1); s0 = s1; return s0; @@ -3666,7 +3103,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3674,7 +3111,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3688,7 +3125,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3696,7 +3133,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3709,7 +3146,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c144(s1); + s1 = peg$f44(s1); } s0 = s1; @@ -3725,7 +3162,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3733,7 +3170,7 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; } @@ -3743,7 +3180,7 @@ function peg$parse(input, options) { s3 = peg$parseWhiteSpace(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; if (s2 === peg$FAILED) { @@ -3751,15 +3188,13 @@ function peg$parse(input, options) { s3 = peg$parseLineTerminatorSequence(); if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$c143(); + s3 = peg$f43(); } s2 = s3; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c144(s1); - } + peg$savedPos = s0; + s1 = peg$f44(s1); s0 = s1; return s0; @@ -3768,12 +3203,12 @@ function peg$parse(input, options) { function peg$parseCREATE() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c2) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c1) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } + if (peg$silentFails === 0) { peg$fail(peg$e1); } } return s0; @@ -3782,12 +3217,12 @@ function peg$parse(input, options) { function peg$parseTYPE() { var s0; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c145) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c45) { s0 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c146); } + if (peg$silentFails === 0) { peg$fail(peg$e50); } } return s0; @@ -3796,12 +3231,12 @@ function peg$parse(input, options) { function peg$parsePROCEDURE() { var s0; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c147) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c46) { s0 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c148); } + if (peg$silentFails === 0) { peg$fail(peg$e51); } } return s0; @@ -3810,12 +3245,12 @@ function peg$parse(input, options) { function peg$parseAS() { var s0; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c112) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c37) { s0 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } return s0; @@ -3824,12 +3259,12 @@ function peg$parse(input, options) { function peg$parseIS() { var s0; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c149) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c47) { s0 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c150); } + if (peg$silentFails === 0) { peg$fail(peg$e52); } } return s0; @@ -3838,12 +3273,12 @@ function peg$parse(input, options) { function peg$parseOF() { var s0; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c151) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c48) { s0 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c152); } + if (peg$silentFails === 0) { peg$fail(peg$e53); } } return s0; @@ -3852,12 +3287,12 @@ function peg$parse(input, options) { function peg$parseTABLE() { var s0; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c153) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c49) { s0 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c154); } + if (peg$silentFails === 0) { peg$fail(peg$e54); } } return s0; @@ -3872,7 +3307,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -3881,7 +3316,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } } @@ -3892,11 +3327,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 40) { - s0 = peg$c99; + s0 = peg$c31; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c100); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } return s0; @@ -3906,11 +3341,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 41) { - s0 = peg$c101; + s0 = peg$c32; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } return s0; @@ -3920,11 +3355,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c156; + s0 = peg$c50; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } return s0; @@ -3934,11 +3369,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c158; + s0 = peg$c51; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c159); } + if (peg$silentFails === 0) { peg$fail(peg$e57); } } return s0; @@ -3948,11 +3383,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 44) { - s0 = peg$c160; + s0 = peg$c52; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c161); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } return s0; @@ -3961,20 +3396,20 @@ function peg$parse(input, options) { function peg$parseout() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c162) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c53) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c163); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c37) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c9) { s0 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c164); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } } @@ -3984,12 +3419,12 @@ function peg$parse(input, options) { function peg$parseZs() { var s0; - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$r5.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c166); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } return s0; @@ -4003,7 +3438,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } return s0; @@ -4014,51 +3449,51 @@ function peg$parse(input, options) { peg$silentFails++; if (input.charCodeAt(peg$currPos) === 9) { - s0 = peg$c168; + s0 = peg$c54; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c169); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 11) { - s0 = peg$c170; + s0 = peg$c55; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c171); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 12) { - s0 = peg$c172; + s0 = peg$c56; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c173); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { - s0 = peg$c174; + s0 = peg$c57; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c175); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 160) { - s0 = peg$c176; + s0 = peg$c58; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c177); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 65279) { - s0 = peg$c178; + s0 = peg$c59; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c179); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } if (s0 === peg$FAILED) { s0 = peg$parseZs(); @@ -4071,7 +3506,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c167); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } return s0; @@ -4080,12 +3515,12 @@ function peg$parse(input, options) { function peg$parseLineTerminator() { var s0; - if (peg$c180.test(input.charAt(peg$currPos))) { + if (peg$r6.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c181); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } return s0; @@ -4096,43 +3531,43 @@ function peg$parse(input, options) { peg$silentFails++; if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c183; + s0 = peg$c60; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c184); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c185) { - s0 = peg$c185; + if (input.substr(peg$currPos, 2) === peg$c61) { + s0 = peg$c61; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c186); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c187; + s0 = peg$c62; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c188); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8232) { - s0 = peg$c189; + s0 = peg$c63; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c190); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8233) { - s0 = peg$c191; + s0 = peg$c64; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c192); } + if (peg$silentFails === 0) { peg$fail(peg$e75); } } } } @@ -4141,7 +3576,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c182); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } return s0; @@ -4158,7 +3593,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c193); } + if (peg$silentFails === 0) { peg$fail(peg$e76); } } return s0; @@ -4172,16 +3607,16 @@ function peg$parse(input, options) { s2 = peg$currPos; s3 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c194) { - s4 = peg$c194; + if (input.substr(peg$currPos, 2) === peg$c65) { + s4 = peg$c65; peg$currPos += 2; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c195); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4204,16 +3639,16 @@ function peg$parse(input, options) { s2 = peg$currPos; s3 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c194) { - s4 = peg$c194; + if (input.substr(peg$currPos, 2) === peg$c65) { + s4 = peg$c65; peg$currPos += 2; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c195); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4232,10 +3667,8 @@ function peg$parse(input, options) { s2 = peg$FAILED; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c196(); - } + peg$savedPos = s0; + s1 = peg$f45(); s0 = s1; return s0; @@ -4245,31 +3678,25 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c197) { - s1 = peg$c197; + if (input.substr(peg$currPos, 2) === peg$c66) { + s1 = peg$c66; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c198); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s1 !== peg$FAILED) { s2 = peg$parseMultiLineCommentBody(); - if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c194) { - s3 = peg$c194; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c195); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c199(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 2) === peg$c65) { + s3 = peg$c65; + peg$currPos += 2; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e77); } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f46(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4286,31 +3713,31 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c197) { - s1 = peg$c197; + if (input.substr(peg$currPos, 2) === peg$c66) { + s1 = peg$c66; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c198); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c194) { - s5 = peg$c194; + if (input.substr(peg$currPos, 2) === peg$c65) { + s5 = peg$c65; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c195); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } if (s5 === peg$FAILED) { s5 = peg$parseLineTerminator(); } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = void 0; + s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4333,19 +3760,19 @@ function peg$parse(input, options) { s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c194) { - s5 = peg$c194; + if (input.substr(peg$currPos, 2) === peg$c65) { + s5 = peg$c65; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c195); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } if (s5 === peg$FAILED) { s5 = peg$parseLineTerminator(); } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = void 0; + s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4364,21 +3791,16 @@ function peg$parse(input, options) { s3 = peg$FAILED; } } - if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c194) { - s3 = peg$c194; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c195); } - } - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 2) === peg$c65) { + s3 = peg$c65; + peg$currPos += 2; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e77); } + } + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4402,7 +3824,7 @@ function peg$parse(input, options) { s4 = peg$parseLineTerminator(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4428,7 +3850,7 @@ function peg$parse(input, options) { s4 = peg$parseLineTerminator(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = void 0; + s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; @@ -4447,10 +3869,8 @@ function peg$parse(input, options) { s2 = peg$FAILED; } } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c200(); - } + peg$savedPos = s0; + s1 = peg$f47(); s0 = s1; return s0; @@ -4460,23 +3880,17 @@ function peg$parse(input, options) { var s0, s1, s2; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c201) { - s1 = peg$c201; + if (input.substr(peg$currPos, 2) === peg$c67) { + s1 = peg$c67; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c202); } + if (peg$silentFails === 0) { peg$fail(peg$e79); } } if (s1 !== peg$FAILED) { s2 = peg$parseSingleLineCommentBody(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c199(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + peg$savedPos = s0; + s0 = peg$f46(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4493,28 +3907,17 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = null; } - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c201) { - s2 = peg$c201; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c202); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parseSingleLineCommentBody(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c199(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (input.substr(peg$currPos, 2) === peg$c67) { + s2 = peg$c67; + peg$currPos += 2; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e79); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parseSingleLineCommentBody(); + peg$savedPos = s0; + s0 = peg$f46(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4526,12 +3929,12 @@ function peg$parse(input, options) { function peg$parseunique() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c90) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c29) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } return s0; @@ -4541,12 +3944,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c203) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c68) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c204); } + if (peg$silentFails === 0) { peg$fail(peg$e80); } } if (s1 !== peg$FAILED) { s2 = peg$parsews1(); @@ -4554,141 +3957,99 @@ function peg$parse(input, options) { s3 = peg$parsename(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); - if (s4 !== peg$FAILED) { - s5 = peg$parseunique(); - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - if (s6 !== peg$FAILED) { - s7 = peg$parseclustered(); - if (s7 === peg$FAILED) { - s7 = null; - } - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - if (s8 !== peg$FAILED) { - s9 = peg$parselparen(); - if (s9 !== peg$FAILED) { - s10 = peg$parsews(); - if (s10 !== peg$FAILED) { - s11 = peg$parsenames(); - if (s11 !== peg$FAILED) { - s12 = peg$parsews(); - if (s12 !== peg$FAILED) { - s13 = peg$parserparen(); - if (s13 !== peg$FAILED) { - s14 = peg$currPos; - s15 = peg$parsews1(); - if (s15 !== peg$FAILED) { - if (input.substr(peg$currPos, 5) === peg$c205) { - s16 = peg$c205; - peg$currPos += 5; - } else { - s16 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c206); } - } - if (s16 !== peg$FAILED) { - s17 = peg$currPos; - s18 = []; - s19 = peg$currPos; - s20 = peg$parsews1(); - if (s20 !== peg$FAILED) { - s21 = peg$parsename(); - if (s21 !== peg$FAILED) { - s20 = [s20, s21]; - s19 = s20; - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - if (s19 !== peg$FAILED) { - while (s19 !== peg$FAILED) { - s18.push(s19); - s19 = peg$currPos; - s20 = peg$parsews1(); - if (s20 !== peg$FAILED) { - s21 = peg$parsename(); - if (s21 !== peg$FAILED) { - s20 = [s20, s21]; - s19 = s20; - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - } else { - peg$currPos = s19; - s19 = peg$FAILED; - } - } - } else { - s18 = peg$FAILED; - } - if (s18 !== peg$FAILED) { - peg$savedPos = s17; - s18 = peg$c207(s3, s5, s7, s11); - } - s17 = s18; - if (s17 !== peg$FAILED) { - peg$savedPos = s14; - s15 = peg$c208(s3, s5, s7, s11, s17); - s14 = s15; - } else { - peg$currPos = s14; - s14 = peg$FAILED; - } - } else { - peg$currPos = s14; - s14 = peg$FAILED; - } - } else { - peg$currPos = s14; - s14 = peg$FAILED; - } - if (s14 === peg$FAILED) { - s14 = null; - } - if (s14 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c209(s3, s5, s7, s11, s14); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s5 = peg$parseunique(); + if (s5 === peg$FAILED) { + s5 = null; + } + s6 = peg$parsews(); + s7 = peg$parseclustered(); + if (s7 === peg$FAILED) { + s7 = null; + } + s8 = peg$parsews(); + s9 = peg$parselparen(); + if (s9 !== peg$FAILED) { + s10 = peg$parsews(); + s11 = peg$parsenames(); + if (s11 !== peg$FAILED) { + s12 = peg$parsews(); + s13 = peg$parserparen(); + if (s13 !== peg$FAILED) { + s14 = peg$currPos; + s15 = peg$parsews1(); + if (s15 !== peg$FAILED) { + if (input.substr(peg$currPos, 5) === peg$c69) { + s16 = peg$c69; + peg$currPos += 5; + } else { + s16 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e81); } + } + if (s16 !== peg$FAILED) { + s17 = peg$currPos; + s18 = []; + s19 = peg$currPos; + s20 = peg$parsews1(); + if (s20 !== peg$FAILED) { + s21 = peg$parsename(); + if (s21 !== peg$FAILED) { + s20 = [s20, s21]; + s19 = s20; + } else { + peg$currPos = s19; + s19 = peg$FAILED; + } + } else { + peg$currPos = s19; + s19 = peg$FAILED; + } + if (s19 !== peg$FAILED) { + while (s19 !== peg$FAILED) { + s18.push(s19); + s19 = peg$currPos; + s20 = peg$parsews1(); + if (s20 !== peg$FAILED) { + s21 = peg$parsename(); + if (s21 !== peg$FAILED) { + s20 = [s20, s21]; + s19 = s20; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s19; + s19 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s19; + s19 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + s18 = peg$FAILED; + } + if (s18 !== peg$FAILED) { + peg$savedPos = s17; + s18 = peg$f48(s3, s5, s7, s11); + } + s17 = s18; + if (s17 !== peg$FAILED) { + peg$savedPos = s14; + s14 = peg$f49(s3, s5, s7, s11, s17); + } else { + peg$currPos = s14; + s14 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s14; + s14 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s14; + s14 = peg$FAILED; } + if (s14 === peg$FAILED) { + s14 = null; + } + peg$savedPos = s0; + s0 = peg$f50(s3, s5, s7, s11, s14); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4762,5 +4123,5 @@ function peg$parse(input, options) { module.exports = { SyntaxError: peg$SyntaxError, - parse: peg$parse + parse: peg$parse };