From e4ad7a705ee89d87464499e0b201a055e13d6ffc Mon Sep 17 00:00:00 2001 From: joe-re Date: Mon, 18 May 2020 02:42:38 +0800 Subject: [PATCH] deal with update join syntax fix: https://github.com/joe-re/sql-language-server/issues/11 --- packages/sql-parser/base/fromClauseParser.js | 1388 ++++++++++-------- packages/sql-parser/base/parser.js | 1388 ++++++++++-------- packages/sql-parser/package.json | 2 + packages/sql-parser/parser.pegjs | 15 + packages/sql-parser/test/update.test.js | 24 + 5 files changed, 1519 insertions(+), 1298 deletions(-) create mode 100644 packages/sql-parser/test/update.test.js diff --git a/packages/sql-parser/base/fromClauseParser.js b/packages/sql-parser/base/fromClauseParser.js index bd82dc69..c3834a52 100644 --- a/packages/sql-parser/base/fromClauseParser.js +++ b/packages/sql-parser/base/fromClauseParser.js @@ -341,22 +341,32 @@ function peg$parse(input, options) { where : w } }, - peg$c42 = "=", - peg$c43 = peg$literalExpectation("=", false), - peg$c44 = function(c, v) { + peg$c42 = function(t, j, l, w) { + return { + type : 'update', + db : '', + table : t, + join : j, + set : l, + where : w + } + }, + peg$c43 = "=", + peg$c44 = peg$literalExpectation("=", false), + peg$c45 = function(c, v) { return { column: c, value : v } }, - peg$c45 = function(t, c, v) { + peg$c46 = function(t, c, v) { return { table: t, column: c, value : v } }, - peg$c46 = function(ri, db, t, c, v) { + peg$c47 = function(ri, db, t, c, v) { return { type : ri, db : db, @@ -365,7 +375,7 @@ function peg$parse(input, options) { values : v } }, - peg$c47 = function(ri, db, t, l, u) { + peg$c48 = function(ri, db, t, l, u) { var v = { type : ri, db : db, @@ -379,7 +389,7 @@ function peg$parse(input, options) { return v; }, - peg$c48 = function(ri, t, c, v) { + peg$c49 = function(ri, t, c, v) { return { type : ri, db : '', @@ -388,7 +398,7 @@ function peg$parse(input, options) { values : v } }, - peg$c49 = function(ri, t, l, u) { + peg$c50 = function(ri, t, l, u) { var v = { type : ri, db : '', @@ -402,19 +412,19 @@ function peg$parse(input, options) { return v; }, - peg$c50 = function(c) {error('EXPECTED COLUMN NAME')}, - peg$c51 = function(c) { + peg$c51 = function(c) {error('EXPECTED COLUMN NAME')}, + peg$c52 = function(c) { return c }, - peg$c52 = function() { return 'insert'; }, - peg$c53 = function() { return 'replace' }, - peg$c54 = function(l) { + peg$c53 = function() { return 'insert'; }, + peg$c54 = function() { return 'replace' }, + peg$c55 = function(l) { return l; }, - peg$c55 = function(l) { + peg$c56 = function(l) { return l; }, - peg$c56 = function(head, tail) { + peg$c57 = function(head, tail) { var el = { type : 'expr_list' } @@ -423,22 +433,22 @@ function peg$parse(input, options) { el.value = l; return el; }, - peg$c57 = "", - peg$c58 = function() { + peg$c58 = "", + peg$c59 = function() { return { type : 'expr_list', value : [] } }, - peg$c59 = function(head, tail) { + peg$c60 = function(head, tail) { return createBinaryExprChain(head, tail); }, - peg$c60 = "!", - peg$c61 = peg$literalExpectation("!", false), - peg$c62 = function(expr) { + peg$c61 = "!", + peg$c62 = peg$literalExpectation("!", false), + peg$c63 = function(expr) { return createUnaryExpr('NOT', expr); }, - peg$c63 = function(left, rh) { + peg$c64 = function(left, rh) { if (rh === null) { return left; } else { @@ -451,31 +461,31 @@ function peg$parse(input, options) { return res; } }, - peg$c64 = function(l) { + peg$c65 = function(l) { return { type : 'arithmetic', tail : l } }, - peg$c65 = ">=", - peg$c66 = peg$literalExpectation(">=", false), - peg$c67 = ">", - peg$c68 = peg$literalExpectation(">", false), - peg$c69 = "<=", - peg$c70 = peg$literalExpectation("<=", false), - peg$c71 = "<>", - peg$c72 = peg$literalExpectation("<>", false), - peg$c73 = "<", - peg$c74 = peg$literalExpectation("<", false), - peg$c75 = "!=", - peg$c76 = peg$literalExpectation("!=", false), - peg$c77 = function(op, right) { + peg$c66 = ">=", + peg$c67 = peg$literalExpectation(">=", false), + peg$c68 = ">", + peg$c69 = peg$literalExpectation(">", false), + peg$c70 = "<=", + peg$c71 = peg$literalExpectation("<=", false), + peg$c72 = "<>", + peg$c73 = peg$literalExpectation("<>", false), + peg$c74 = "<", + peg$c75 = peg$literalExpectation("<", false), + peg$c76 = "!=", + peg$c77 = peg$literalExpectation("!=", false), + peg$c78 = function(op, right) { return { op : op, right : right } }, - peg$c78 = function(op, begin, end) { + peg$c79 = function(op, begin, end) { return { op : op, right : { @@ -484,55 +494,55 @@ function peg$parse(input, options) { } } }, - peg$c79 = function(nk) { return nk[0] + ' ' + nk[2]; }, - peg$c80 = function(op, right) { + peg$c80 = function(nk) { return nk[0] + ' ' + nk[2]; }, + peg$c81 = function(op, right) { return { op : op, right : right } }, - peg$c81 = function(op, l) { + peg$c82 = function(op, l) { return { op : op, right : l } }, - peg$c82 = function(op, l) { + peg$c83 = function(op, l) { return { op : op, right : l } }, - peg$c83 = function(op, e) { + peg$c84 = function(op, e) { return { op : op, right : e } }, - peg$c84 = function(op, l) { + peg$c85 = function(op, l) { return { op : op, right : l } }, - peg$c85 = "+", - peg$c86 = peg$literalExpectation("+", false), - peg$c87 = "-", - peg$c88 = peg$literalExpectation("-", false), - peg$c89 = function(head, tail) { + peg$c86 = "+", + peg$c87 = peg$literalExpectation("+", false), + peg$c88 = "-", + peg$c89 = peg$literalExpectation("-", false), + peg$c90 = function(head, tail) { return createBinaryExprChain(head, tail) }, - peg$c90 = "*", - peg$c91 = peg$literalExpectation("*", false), - peg$c92 = "/", - peg$c93 = peg$literalExpectation("/", false), - peg$c94 = "%", - peg$c95 = peg$literalExpectation("%", false), - peg$c96 = function(e) { + peg$c91 = "*", + peg$c92 = peg$literalExpectation("*", false), + peg$c93 = "/", + peg$c94 = peg$literalExpectation("/", false), + peg$c95 = "%", + peg$c96 = peg$literalExpectation("%", false), + peg$c97 = function(e) { e.paren = true; return e; }, - peg$c97 = function(tbl, col) { + peg$c98 = function(tbl, col) { return { type : 'column_ref', table : tbl, @@ -540,7 +550,7 @@ function peg$parse(input, options) { location: location() }; }, - peg$c98 = function(col) { + peg$c99 = function(col) { return { type : 'column_ref', table : '', @@ -548,27 +558,27 @@ function peg$parse(input, options) { location: location() }; }, - peg$c99 = function(name) { return reservedMap[name.toUpperCase()] === true; }, - peg$c100 = function(name) { + peg$c100 = function(name) { return reservedMap[name.toUpperCase()] === true; }, + peg$c101 = function(name) { return name; }, - peg$c101 = "`", - peg$c102 = peg$literalExpectation("`", false), - peg$c103 = /^[^`]/, - peg$c104 = peg$classExpectation(["`"], true, false), - peg$c105 = function(chars) { + peg$c102 = "`", + peg$c103 = peg$literalExpectation("`", false), + peg$c104 = /^[^`]/, + peg$c105 = peg$classExpectation(["`"], true, false), + peg$c106 = function(chars) { return chars.join(''); }, - peg$c106 = function(start, parts) { return start + parts.join(''); }, - peg$c107 = /^[A-Za-z_]/, - peg$c108 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false), - peg$c109 = /^[A-Za-z0-9_]/, - peg$c110 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false), - peg$c111 = /^[A-Za-z0-9_:]/, - peg$c112 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", ":"], false, false), - peg$c113 = ":", - peg$c114 = peg$literalExpectation(":", false), - peg$c115 = function(l) { + peg$c107 = function(start, parts) { return start + parts.join(''); }, + peg$c108 = /^[A-Za-z_]/, + peg$c109 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false), + peg$c110 = /^[A-Za-z0-9_]/, + peg$c111 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false), + peg$c112 = /^[A-Za-z0-9_:]/, + peg$c113 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", ":"], false, false), + peg$c114 = ":", + peg$c115 = peg$literalExpectation(":", false), + peg$c116 = function(l) { var p = { type : 'param', value: l[1] @@ -579,7 +589,7 @@ function peg$parse(input, options) { params.push(p); return p; }, - peg$c116 = function(name, e) { + peg$c117 = function(name, e) { return { type : 'aggr_func', name : name, @@ -588,286 +598,286 @@ function peg$parse(input, options) { } } }, - peg$c117 = function(name, arg) { + peg$c118 = function(name, arg) { return { type : 'aggr_func', name : name, args : arg } }, - peg$c118 = function(e) { + peg$c119 = function(e) { return { expr : e } }, - peg$c119 = function(d, c) { + peg$c120 = function(d, c) { return { distinct : d, expr : c } }, - peg$c120 = function() { + peg$c121 = function() { return { type : 'star', value : '*' } }, - peg$c121 = function(name, l) { + peg$c122 = function(name, l) { return { type : 'function', name : name, args : l } }, - peg$c122 = function(head, tail) { + peg$c123 = function(head, tail) { return createList(head, tail); }, - peg$c123 = function() { + peg$c124 = function() { return { type : 'null', value : null, location : location() }; }, - peg$c124 = function() { + peg$c125 = function() { return { type : 'bool', value : true, location : location() }; }, - peg$c125 = function() { + peg$c126 = function() { return { type : 'bool', value : false, location : location() }; }, - peg$c126 = "\"", - peg$c127 = peg$literalExpectation("\"", false), - peg$c128 = "'", - peg$c129 = peg$literalExpectation("'", false), - peg$c130 = function(ca) { + peg$c127 = "\"", + peg$c128 = peg$literalExpectation("\"", false), + peg$c129 = "'", + peg$c130 = peg$literalExpectation("'", false), + peg$c131 = function(ca) { return { type : 'string', value : ca[1].join(''), location : location() } }, - peg$c131 = /^[^'\\\0-\x1F\x7F]/, - peg$c132 = peg$classExpectation(["'", "\\", ["\0", "\x1F"], "\x7F"], true, false), - peg$c133 = /^[^"\\\0-\x1F\x7F]/, - peg$c134 = peg$classExpectation(["\"", "\\", ["\0", "\x1F"], "\x7F"], true, false), - peg$c135 = "\\'", - peg$c136 = peg$literalExpectation("\\'", false), - peg$c137 = function() { return "'"; }, - peg$c138 = "\\\"", - peg$c139 = peg$literalExpectation("\\\"", false), - peg$c140 = function() { return '"'; }, - peg$c141 = "\\\\", - peg$c142 = peg$literalExpectation("\\\\", false), - peg$c143 = function() { return "\\"; }, - peg$c144 = "\\/", - peg$c145 = peg$literalExpectation("\\/", false), - peg$c146 = function() { return "/"; }, - peg$c147 = "\\b", - peg$c148 = peg$literalExpectation("\\b", false), - peg$c149 = function() { return "\b"; }, - peg$c150 = "\\f", - peg$c151 = peg$literalExpectation("\\f", false), - peg$c152 = function() { return "\f"; }, - peg$c153 = "\\n", - peg$c154 = peg$literalExpectation("\\n", false), - peg$c155 = function() { return "\n"; }, - peg$c156 = "\\r", - peg$c157 = peg$literalExpectation("\\r", false), - peg$c158 = function() { return "\r"; }, - peg$c159 = "\\t", - peg$c160 = peg$literalExpectation("\\t", false), - peg$c161 = function() { return "\t"; }, - peg$c162 = "\\u", - peg$c163 = peg$literalExpectation("\\u", false), - peg$c164 = function(h1, h2, h3, h4) { + peg$c132 = /^[^'\\\0-\x1F\x7F]/, + peg$c133 = peg$classExpectation(["'", "\\", ["\0", "\x1F"], "\x7F"], true, false), + peg$c134 = /^[^"\\\0-\x1F\x7F]/, + peg$c135 = peg$classExpectation(["\"", "\\", ["\0", "\x1F"], "\x7F"], true, false), + peg$c136 = "\\'", + peg$c137 = peg$literalExpectation("\\'", false), + peg$c138 = function() { return "'"; }, + peg$c139 = "\\\"", + peg$c140 = peg$literalExpectation("\\\"", false), + peg$c141 = function() { return '"'; }, + peg$c142 = "\\\\", + peg$c143 = peg$literalExpectation("\\\\", false), + peg$c144 = function() { return "\\"; }, + peg$c145 = "\\/", + peg$c146 = peg$literalExpectation("\\/", false), + peg$c147 = function() { return "/"; }, + peg$c148 = "\\b", + peg$c149 = peg$literalExpectation("\\b", false), + peg$c150 = function() { return "\b"; }, + peg$c151 = "\\f", + peg$c152 = peg$literalExpectation("\\f", false), + peg$c153 = function() { return "\f"; }, + peg$c154 = "\\n", + peg$c155 = peg$literalExpectation("\\n", false), + peg$c156 = function() { return "\n"; }, + peg$c157 = "\\r", + peg$c158 = peg$literalExpectation("\\r", false), + peg$c159 = function() { return "\r"; }, + peg$c160 = "\\t", + peg$c161 = peg$literalExpectation("\\t", false), + peg$c162 = function() { return "\t"; }, + peg$c163 = "\\u", + peg$c164 = peg$literalExpectation("\\u", false), + peg$c165 = function(h1, h2, h3, h4) { return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4)); }, - peg$c165 = /^[\n\r]/, - peg$c166 = peg$classExpectation(["\n", "\r"], false, false), - peg$c167 = function(n) { + peg$c166 = /^[\n\r]/, + peg$c167 = peg$classExpectation(["\n", "\r"], false, false), + peg$c168 = function(n) { return { type : 'number', value : n, location: location() } }, - peg$c168 = function(int_, frac, exp) { return parseFloat(int_ + frac + exp); }, - peg$c169 = function(int_, frac) { return parseFloat(int_ + frac); }, - peg$c170 = function(int_, exp) { return parseFloat(int_ + exp); }, - peg$c171 = function(int_) { return parseFloat(int_); }, - peg$c172 = function(digit19, digits) { return digit19 + digits; }, - peg$c173 = function(op, digit19, digits) { return "-" + digit19 + digits; }, - peg$c174 = function(op, digit) { return "-" + digit; }, - peg$c175 = ".", - peg$c176 = peg$literalExpectation(".", false), - peg$c177 = function(digits) { return "." + digits; }, - peg$c178 = function(e, digits) { return e + digits; }, - peg$c179 = function(digits) { return digits.join(""); }, - peg$c180 = /^[0-9]/, - peg$c181 = peg$classExpectation([["0", "9"]], false, false), - peg$c182 = /^[1-9]/, - peg$c183 = peg$classExpectation([["1", "9"]], false, false), - peg$c184 = /^[0-9a-fA-F]/, - peg$c185 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false), - peg$c186 = /^[eE]/, - peg$c187 = peg$classExpectation(["e", "E"], false, false), - peg$c188 = /^[+\-]/, - peg$c189 = peg$classExpectation(["+", "-"], false, false), - peg$c190 = function(e, sign) { return e + (sign || ''); }, - peg$c191 = "null", - peg$c192 = peg$literalExpectation("NULL", true), - peg$c193 = "true", - peg$c194 = peg$literalExpectation("TRUE", true), - peg$c195 = "false", - peg$c196 = peg$literalExpectation("FALSE", true), - peg$c197 = "show", - peg$c198 = peg$literalExpectation("SHOW", true), - peg$c199 = "drop", - peg$c200 = peg$literalExpectation("DROP", true), - peg$c201 = "select", - peg$c202 = peg$literalExpectation("SELECT", true), - peg$c203 = "update", - peg$c204 = peg$literalExpectation("UPDATE", true), - peg$c205 = "create", - peg$c206 = peg$literalExpectation("CREATE", true), - peg$c207 = "delete", - peg$c208 = peg$literalExpectation("DELETE", true), - peg$c209 = "insert", - peg$c210 = peg$literalExpectation("INSERT", true), - peg$c211 = "replace", - peg$c212 = peg$literalExpectation("REPLACE", true), - peg$c213 = "explain", - peg$c214 = peg$literalExpectation("EXPLAIN", true), - peg$c215 = "into", - peg$c216 = peg$literalExpectation("INTO", true), - peg$c217 = "from", - peg$c218 = peg$literalExpectation("FROM", true), - peg$c219 = "set", - peg$c220 = peg$literalExpectation("SET", true), - peg$c221 = "as", - peg$c222 = peg$literalExpectation("AS", true), - peg$c223 = "table", - peg$c224 = peg$literalExpectation("TABLE", true), - peg$c225 = "on", - peg$c226 = peg$literalExpectation("ON", true), - peg$c227 = "left", - peg$c228 = peg$literalExpectation("LEFT", true), - peg$c229 = "inner", - peg$c230 = peg$literalExpectation("INNER", true), - peg$c231 = "join", - peg$c232 = peg$literalExpectation("JOIN", true), - peg$c233 = "union", - peg$c234 = peg$literalExpectation("UNION", true), - peg$c235 = "values", - peg$c236 = peg$literalExpectation("VALUES", true), - peg$c237 = "exists", - peg$c238 = peg$literalExpectation("EXISTS", true), - peg$c239 = "where", - peg$c240 = peg$literalExpectation("WHERE", true), - peg$c241 = "group", - peg$c242 = peg$literalExpectation("GROUP", true), - peg$c243 = "by", - peg$c244 = peg$literalExpectation("BY", true), - peg$c245 = "order", - peg$c246 = peg$literalExpectation("ORDER", true), - peg$c247 = "having", - peg$c248 = peg$literalExpectation("HAVING", true), - peg$c249 = "limit", - peg$c250 = peg$literalExpectation("LIMIT", true), - peg$c251 = "asc", - peg$c252 = peg$literalExpectation("ASC", true), - peg$c253 = function() { return 'ASC'; }, - peg$c254 = "desc", - peg$c255 = peg$literalExpectation("DESC", true), - peg$c256 = function() { return 'DESC'; }, - peg$c257 = "all", - peg$c258 = peg$literalExpectation("ALL", true), - peg$c259 = function() { return 'ALL'; }, - peg$c260 = "distinct", - peg$c261 = peg$literalExpectation("DISTINCT", true), - peg$c262 = function() { return 'DISTINCT'; }, - peg$c263 = "duplicate", - peg$c264 = peg$literalExpectation("DUPLICATE", true), - peg$c265 = function() { return 'DUPLICATE';}, - peg$c266 = "between", - peg$c267 = peg$literalExpectation("BETWEEN", true), - peg$c268 = function() { return 'BETWEEN'; }, - peg$c269 = "in", - peg$c270 = peg$literalExpectation("IN", true), - peg$c271 = function() { return 'IN'; }, - peg$c272 = "is", - peg$c273 = peg$literalExpectation("IS", true), - peg$c274 = function() { return 'IS'; }, - peg$c275 = "like", - peg$c276 = peg$literalExpectation("LIKE", true), - peg$c277 = function() { return 'LIKE'; }, - peg$c278 = "contains", - peg$c279 = peg$literalExpectation("CONTAINS", true), - peg$c280 = function() { return 'CONTAINS'; }, - peg$c281 = "key", - peg$c282 = peg$literalExpectation("KEY", true), - peg$c283 = function() { return 'KEY'; }, - peg$c284 = "not", - peg$c285 = peg$literalExpectation("NOT", true), - peg$c286 = function() { return 'NOT'; }, - peg$c287 = "and", - peg$c288 = peg$literalExpectation("AND", true), - peg$c289 = function() { return 'AND'; }, - peg$c290 = "or", - peg$c291 = peg$literalExpectation("OR", true), - peg$c292 = function() { return 'OR'; }, - peg$c293 = "count", - peg$c294 = peg$literalExpectation("COUNT", true), - peg$c295 = function() { return 'COUNT'; }, - peg$c296 = "max", - peg$c297 = peg$literalExpectation("MAX", true), - peg$c298 = function() { return 'MAX'; }, - peg$c299 = "min", - peg$c300 = peg$literalExpectation("MIN", true), - peg$c301 = function() { return 'MIN'; }, - peg$c302 = "sum", - peg$c303 = peg$literalExpectation("SUM", true), - peg$c304 = function() { return 'SUM'; }, - peg$c305 = "avg", - peg$c306 = peg$literalExpectation("AVG", true), - peg$c307 = function() { return 'AVG'; }, - peg$c308 = ",", - peg$c309 = peg$literalExpectation(",", false), - peg$c310 = "[", - peg$c311 = peg$literalExpectation("[", false), - peg$c312 = "]", - peg$c313 = peg$literalExpectation("]", false), - peg$c314 = /^[ \t\n\r]/, - peg$c315 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false), - peg$c316 = function() { varList = []; return true; }, - peg$c317 = function(s) { + peg$c169 = function(int_, frac, exp) { return parseFloat(int_ + frac + exp); }, + peg$c170 = function(int_, frac) { return parseFloat(int_ + frac); }, + peg$c171 = function(int_, exp) { return parseFloat(int_ + exp); }, + peg$c172 = function(int_) { return parseFloat(int_); }, + peg$c173 = function(digit19, digits) { return digit19 + digits; }, + peg$c174 = function(op, digit19, digits) { return "-" + digit19 + digits; }, + peg$c175 = function(op, digit) { return "-" + digit; }, + peg$c176 = ".", + peg$c177 = peg$literalExpectation(".", false), + peg$c178 = function(digits) { return "." + digits; }, + peg$c179 = function(e, digits) { return e + digits; }, + peg$c180 = function(digits) { return digits.join(""); }, + peg$c181 = /^[0-9]/, + peg$c182 = peg$classExpectation([["0", "9"]], false, false), + peg$c183 = /^[1-9]/, + peg$c184 = peg$classExpectation([["1", "9"]], false, false), + peg$c185 = /^[0-9a-fA-F]/, + peg$c186 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false), + peg$c187 = /^[eE]/, + peg$c188 = peg$classExpectation(["e", "E"], false, false), + peg$c189 = /^[+\-]/, + peg$c190 = peg$classExpectation(["+", "-"], false, false), + peg$c191 = function(e, sign) { return e + (sign || ''); }, + peg$c192 = "null", + peg$c193 = peg$literalExpectation("NULL", true), + peg$c194 = "true", + peg$c195 = peg$literalExpectation("TRUE", true), + peg$c196 = "false", + peg$c197 = peg$literalExpectation("FALSE", true), + peg$c198 = "show", + peg$c199 = peg$literalExpectation("SHOW", true), + peg$c200 = "drop", + peg$c201 = peg$literalExpectation("DROP", true), + peg$c202 = "select", + peg$c203 = peg$literalExpectation("SELECT", true), + peg$c204 = "update", + peg$c205 = peg$literalExpectation("UPDATE", true), + peg$c206 = "create", + peg$c207 = peg$literalExpectation("CREATE", true), + peg$c208 = "delete", + peg$c209 = peg$literalExpectation("DELETE", true), + peg$c210 = "insert", + peg$c211 = peg$literalExpectation("INSERT", true), + peg$c212 = "replace", + peg$c213 = peg$literalExpectation("REPLACE", true), + peg$c214 = "explain", + peg$c215 = peg$literalExpectation("EXPLAIN", true), + peg$c216 = "into", + peg$c217 = peg$literalExpectation("INTO", true), + peg$c218 = "from", + peg$c219 = peg$literalExpectation("FROM", true), + peg$c220 = "set", + peg$c221 = peg$literalExpectation("SET", true), + peg$c222 = "as", + peg$c223 = peg$literalExpectation("AS", true), + peg$c224 = "table", + peg$c225 = peg$literalExpectation("TABLE", true), + peg$c226 = "on", + peg$c227 = peg$literalExpectation("ON", true), + peg$c228 = "left", + peg$c229 = peg$literalExpectation("LEFT", true), + peg$c230 = "inner", + peg$c231 = peg$literalExpectation("INNER", true), + peg$c232 = "join", + peg$c233 = peg$literalExpectation("JOIN", true), + peg$c234 = "union", + peg$c235 = peg$literalExpectation("UNION", true), + peg$c236 = "values", + peg$c237 = peg$literalExpectation("VALUES", true), + peg$c238 = "exists", + peg$c239 = peg$literalExpectation("EXISTS", true), + peg$c240 = "where", + peg$c241 = peg$literalExpectation("WHERE", true), + peg$c242 = "group", + peg$c243 = peg$literalExpectation("GROUP", true), + peg$c244 = "by", + peg$c245 = peg$literalExpectation("BY", true), + peg$c246 = "order", + peg$c247 = peg$literalExpectation("ORDER", true), + peg$c248 = "having", + peg$c249 = peg$literalExpectation("HAVING", true), + peg$c250 = "limit", + peg$c251 = peg$literalExpectation("LIMIT", true), + peg$c252 = "asc", + peg$c253 = peg$literalExpectation("ASC", true), + peg$c254 = function() { return 'ASC'; }, + peg$c255 = "desc", + peg$c256 = peg$literalExpectation("DESC", true), + peg$c257 = function() { return 'DESC'; }, + peg$c258 = "all", + peg$c259 = peg$literalExpectation("ALL", true), + peg$c260 = function() { return 'ALL'; }, + peg$c261 = "distinct", + peg$c262 = peg$literalExpectation("DISTINCT", true), + peg$c263 = function() { return 'DISTINCT'; }, + peg$c264 = "duplicate", + peg$c265 = peg$literalExpectation("DUPLICATE", true), + peg$c266 = function() { return 'DUPLICATE';}, + peg$c267 = "between", + peg$c268 = peg$literalExpectation("BETWEEN", true), + peg$c269 = function() { return 'BETWEEN'; }, + peg$c270 = "in", + peg$c271 = peg$literalExpectation("IN", true), + peg$c272 = function() { return 'IN'; }, + peg$c273 = "is", + peg$c274 = peg$literalExpectation("IS", true), + peg$c275 = function() { return 'IS'; }, + peg$c276 = "like", + peg$c277 = peg$literalExpectation("LIKE", true), + peg$c278 = function() { return 'LIKE'; }, + peg$c279 = "contains", + peg$c280 = peg$literalExpectation("CONTAINS", true), + peg$c281 = function() { return 'CONTAINS'; }, + peg$c282 = "key", + peg$c283 = peg$literalExpectation("KEY", true), + peg$c284 = function() { return 'KEY'; }, + peg$c285 = "not", + peg$c286 = peg$literalExpectation("NOT", true), + peg$c287 = function() { return 'NOT'; }, + peg$c288 = "and", + peg$c289 = peg$literalExpectation("AND", true), + peg$c290 = function() { return 'AND'; }, + peg$c291 = "or", + peg$c292 = peg$literalExpectation("OR", true), + peg$c293 = function() { return 'OR'; }, + peg$c294 = "count", + peg$c295 = peg$literalExpectation("COUNT", true), + peg$c296 = function() { return 'COUNT'; }, + peg$c297 = "max", + peg$c298 = peg$literalExpectation("MAX", true), + peg$c299 = function() { return 'MAX'; }, + peg$c300 = "min", + peg$c301 = peg$literalExpectation("MIN", true), + peg$c302 = function() { return 'MIN'; }, + peg$c303 = "sum", + peg$c304 = peg$literalExpectation("SUM", true), + peg$c305 = function() { return 'SUM'; }, + peg$c306 = "avg", + peg$c307 = peg$literalExpectation("AVG", true), + peg$c308 = function() { return 'AVG'; }, + peg$c309 = ",", + peg$c310 = peg$literalExpectation(",", false), + peg$c311 = "[", + peg$c312 = peg$literalExpectation("[", false), + peg$c313 = "]", + peg$c314 = peg$literalExpectation("]", false), + peg$c315 = /^[ \t\n\r]/, + peg$c316 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false), + peg$c317 = function() { varList = []; return true; }, + peg$c318 = function(s) { return { stmt : s, vars: varList } }, - peg$c318 = function(va, e) { + peg$c319 = function(va, e) { return { type : 'assign', left : va, right: e } }, - peg$c319 = function(e) { + peg$c320 = function(e) { return { type : 'return', expr: e } }, - peg$c320 = function(lt, op, rt, expr) { + peg$c321 = function(lt, op, rt, expr) { return { type : 'join', ltable : lt, @@ -876,7 +886,7 @@ function peg$parse(input, options) { on : expr } }, - peg$c321 = function(name, l) { + peg$c322 = function(name, l) { //compatible with original func_call return { type : 'function', @@ -887,13 +897,13 @@ function peg$parse(input, options) { } } }, - peg$c322 = function(l) { + peg$c323 = function(l) { return { type : 'array', value : l } }, - peg$c323 = function(name, m) { + peg$c324 = function(name, m) { //push for analysis varList.push(name); return { @@ -902,19 +912,19 @@ function peg$parse(input, options) { members : m } }, - peg$c324 = function(l) { + peg$c325 = function(l) { var s = []; for (var i = 0; i < l.length; i++) { s.push(l[i][1]); } return s; }, - peg$c325 = "$", - peg$c326 = peg$literalExpectation("$", false), - peg$c327 = "return", - peg$c328 = peg$literalExpectation("return", true), - peg$c329 = ":=", - peg$c330 = peg$literalExpectation(":=", false), + peg$c326 = "$", + peg$c327 = peg$literalExpectation("$", false), + peg$c328 = "return", + peg$c329 = peg$literalExpectation("return", true), + peg$c330 = ":=", + peg$c331 = peg$literalExpectation(":=", false), peg$currPos = 0, peg$savedPos = 0, @@ -2913,6 +2923,86 @@ function peg$parse(input, options) { peg$currPos = s0; s0 = peg$FAILED; } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseKW_UPDATE(); + if (s1 !== peg$FAILED) { + s2 = peg$parse__(); + if (s2 !== peg$FAILED) { + s3 = peg$parsetable_name(); + if (s3 !== peg$FAILED) { + s4 = peg$parse__(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parsetable_ref(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsetable_ref(); + } + if (s5 !== peg$FAILED) { + s6 = peg$parse__(); + if (s6 !== peg$FAILED) { + s7 = peg$parseKW_SET(); + if (s7 !== peg$FAILED) { + s8 = peg$parse__(); + if (s8 !== peg$FAILED) { + s9 = peg$parseset_list(); + if (s9 !== peg$FAILED) { + s10 = peg$parse__(); + if (s10 !== peg$FAILED) { + s11 = peg$parsewhere_clause(); + if (s11 === peg$FAILED) { + s11 = null; + } + if (s11 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c42(s3, s5, s9, s11); + 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; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } } return s0; @@ -3007,11 +3097,11 @@ function peg$parse(input, options) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c42; + s3 = peg$c43; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s3 !== peg$FAILED) { s4 = peg$parse__(); @@ -3019,7 +3109,7 @@ function peg$parse(input, options) { s5 = peg$parseadditive_expr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c44(s1, s5); + s1 = peg$c45(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -3056,11 +3146,11 @@ function peg$parse(input, options) { s6 = peg$parse__(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s7 = peg$c42; + s7 = peg$c43; peg$currPos++; } else { s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s7 !== peg$FAILED) { s8 = peg$parse__(); @@ -3068,7 +3158,7 @@ function peg$parse(input, options) { s9 = peg$parseadditive_expr(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c45(s1, s5, s9); + s1 = peg$c46(s1, s5, s9); s0 = s1; } else { peg$currPos = s0; @@ -3142,7 +3232,7 @@ function peg$parse(input, options) { s13 = peg$parsevalue_clause(); if (s13 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c46(s1, s5, s9, s11, s13); + s1 = peg$c47(s1, s5, s9, s11, s13); s0 = s1; } else { peg$currPos = s0; @@ -3232,7 +3322,7 @@ function peg$parse(input, options) { } if (s15 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c47(s1, s5, s9, s13, s15); + s1 = peg$c48(s1, s5, s9, s13, s15); s0 = s1; } else { peg$currPos = s0; @@ -3315,7 +3405,7 @@ function peg$parse(input, options) { s9 = peg$parsevalue_clause(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c48(s1, s5, s7, s9); + s1 = peg$c49(s1, s5, s7, s9); s0 = s1; } else { peg$currPos = s0; @@ -3381,7 +3471,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c49(s1, s5, s9, s11); + s1 = peg$c50(s1, s5, s9, s11); s0 = s1; } else { peg$currPos = s0; @@ -3450,7 +3540,7 @@ function peg$parse(input, options) { s6 = peg$parseRPAREN(); if (s6 === peg$FAILED) { peg$savedPos = peg$currPos; - s6 = peg$c50(s4); + s6 = peg$c51(s4); if (s6) { s6 = peg$FAILED; } else { @@ -3459,7 +3549,7 @@ function peg$parse(input, options) { } if (s6 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$c51(s4); + s4 = peg$c52(s4); s3 = s4; } else { peg$currPos = s3; @@ -3499,7 +3589,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_INSERT(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c52(); + s1 = peg$c53(); } s0 = s1; if (s0 === peg$FAILED) { @@ -3507,7 +3597,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_REPLACE(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c53(); + s1 = peg$c54(); } s0 = s1; } @@ -3567,7 +3657,7 @@ function peg$parse(input, options) { s9 = peg$parseset_list(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c54(s9); + s1 = peg$c55(s9); s0 = s1; } else { peg$currPos = s0; @@ -3704,7 +3794,7 @@ function peg$parse(input, options) { s5 = peg$parseRPAREN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c55(s3); + s1 = peg$c56(s3); s0 = s1; } else { peg$currPos = s0; @@ -3796,7 +3886,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c56(s1, s2); + s1 = peg$c57(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -3816,10 +3906,10 @@ function peg$parse(input, options) { s0 = peg$parseexpr_list(); if (s0 === peg$FAILED) { s0 = peg$currPos; - s1 = peg$c57; + s1 = peg$c58; if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c58(); + s1 = peg$c59(); } s0 = s1; } @@ -3893,7 +3983,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -3973,7 +4063,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -3995,21 +4085,21 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { - s2 = peg$c60; + s2 = peg$c61; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c62); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 61) { - s4 = peg$c42; + s4 = peg$c43; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } peg$silentFails--; if (s4 === peg$FAILED) { @@ -4036,7 +4126,7 @@ function peg$parse(input, options) { s3 = peg$parsenot_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c62(s3); + s1 = peg$c63(s3); s0 = s1; } else { peg$currPos = s0; @@ -4071,7 +4161,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c63(s1, s3); + s1 = peg$c64(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4180,7 +4270,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c64(s1); + s1 = peg$c65(s1); } s0 = s1; @@ -4190,60 +4280,60 @@ function peg$parse(input, options) { function peg$parsearithmetic_comparison_operator() { var s0; - if (input.substr(peg$currPos, 2) === peg$c65) { - s0 = peg$c65; + if (input.substr(peg$currPos, 2) === peg$c66) { + s0 = peg$c66; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { - s0 = peg$c67; + s0 = peg$c68; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c69) { - s0 = peg$c69; + if (input.substr(peg$currPos, 2) === peg$c70) { + s0 = peg$c70; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$c71); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c71) { - s0 = peg$c71; + if (input.substr(peg$currPos, 2) === peg$c72) { + s0 = peg$c72; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { - s0 = peg$c73; + s0 = peg$c74; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } + if (peg$silentFails === 0) { peg$fail(peg$c75); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s0 = peg$c42; + s0 = peg$c43; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c75) { - s0 = peg$c75; + if (input.substr(peg$currPos, 2) === peg$c76) { + s0 = peg$c76; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c77); } } } } @@ -4266,7 +4356,7 @@ function peg$parse(input, options) { s3 = peg$parseadditive_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c77(s1, s3); + s1 = peg$c78(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4303,7 +4393,7 @@ function peg$parse(input, options) { s7 = peg$parseadditive_expr(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c78(s1, s3, s7); + s1 = peg$c79(s1, s3, s7); s0 = s1; } else { peg$currPos = s0; @@ -4364,7 +4454,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(s1); + s1 = peg$c80(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4401,7 +4491,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(s1); + s1 = peg$c80(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4438,7 +4528,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(s1); + s1 = peg$c80(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4459,7 +4549,7 @@ function peg$parse(input, options) { s3 = peg$parsecomparison_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c80(s1, s3); + s1 = peg$c81(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4496,7 +4586,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c81(s1, s5); + s1 = peg$c82(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -4535,7 +4625,7 @@ function peg$parse(input, options) { s3 = peg$parseselect_stmt(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c82(s1, s3); + s1 = peg$c83(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4558,7 +4648,7 @@ function peg$parse(input, options) { s3 = peg$parsevar_decl(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c83(s1, s3); + s1 = peg$c84(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4597,7 +4687,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c84(s1, s5); + s1 = peg$c85(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -4636,7 +4726,7 @@ function peg$parse(input, options) { s3 = peg$parsevar_decl(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c83(s1, s3); + s1 = peg$c84(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4721,7 +4811,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -4739,19 +4829,19 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c85; + s0 = peg$c86; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c87; + s0 = peg$c88; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } } @@ -4824,7 +4914,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c89(s1, s2); + s1 = peg$c90(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -4842,27 +4932,27 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 42) { - s0 = peg$c90; + s0 = peg$c91; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s0 = peg$c92; + s0 = peg$c93; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { - s0 = peg$c94; + s0 = peg$c95; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } } } @@ -4895,7 +4985,7 @@ function peg$parse(input, options) { s5 = peg$parseRPAREN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c96(s3); + s1 = peg$c97(s3); s0 = s1; } else { peg$currPos = s0; @@ -4944,7 +5034,7 @@ function peg$parse(input, options) { s5 = peg$parsecolumn(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c97(s1, s5); + s1 = peg$c98(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -4971,7 +5061,7 @@ function peg$parse(input, options) { s1 = peg$parsecolumn(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c98(s1); + s1 = peg$c99(s1); } s0 = s1; } @@ -5066,7 +5156,7 @@ function peg$parse(input, options) { s1 = peg$parseident_name(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; - s2 = peg$c99(s1); + s2 = peg$c100(s1); if (s2) { s2 = peg$FAILED; } else { @@ -5074,7 +5164,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c100(s1); + s1 = peg$c101(s1); s0 = s1; } else { peg$currPos = s0; @@ -5087,30 +5177,30 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 96) { - s1 = peg$c101; + s1 = peg$c102; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } } } else { @@ -5118,15 +5208,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 96) { - s3 = peg$c101; + s3 = peg$c102; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c105(s2); + s1 = peg$c106(s2); s0 = s1; } else { peg$currPos = s0; @@ -5152,7 +5242,7 @@ function peg$parse(input, options) { s1 = peg$parsecolumn_name(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; - s2 = peg$c99(s1); + s2 = peg$c100(s1); if (s2) { s2 = peg$FAILED; } else { @@ -5160,7 +5250,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c100(s1); + s1 = peg$c101(s1); s0 = s1; } else { peg$currPos = s0; @@ -5173,30 +5263,30 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 96) { - s1 = peg$c101; + s1 = peg$c102; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } } } else { @@ -5204,15 +5294,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 96) { - s3 = peg$c101; + s3 = peg$c102; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c105(s2); + s1 = peg$c106(s2); s0 = s1; } else { peg$currPos = s0; @@ -5245,7 +5335,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c106(s1, s2); + s1 = peg$c107(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5273,7 +5363,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c106(s1, s2); + s1 = peg$c107(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5290,12 +5380,12 @@ function peg$parse(input, options) { function peg$parseident_start() { var s0; - if (peg$c107.test(input.charAt(peg$currPos))) { + if (peg$c108.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } return s0; @@ -5304,12 +5394,12 @@ function peg$parse(input, options) { function peg$parseident_part() { var s0; - if (peg$c109.test(input.charAt(peg$currPos))) { + if (peg$c110.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c110); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } return s0; @@ -5318,12 +5408,12 @@ function peg$parse(input, options) { function peg$parsecolumn_part() { var s0; - if (peg$c111.test(input.charAt(peg$currPos))) { + if (peg$c112.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c112); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } return s0; @@ -5335,11 +5425,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c113; + s2 = peg$c114; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c114); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } if (s2 !== peg$FAILED) { s3 = peg$parseident_name(); @@ -5356,7 +5446,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c115(s1); + s1 = peg$c116(s1); } s0 = s1; @@ -5393,7 +5483,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c116(s1, s5); + s1 = peg$c117(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -5463,7 +5553,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c117(s1, s5); + s1 = peg$c118(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -5504,7 +5594,7 @@ function peg$parse(input, options) { s1 = peg$parsestar_expr(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c118(s1); + s1 = peg$c119(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -5519,7 +5609,7 @@ function peg$parse(input, options) { s3 = peg$parsecolumn_ref(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c119(s1, s3); + s1 = peg$c120(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -5543,15 +5633,15 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { - s1 = peg$c90; + s1 = peg$c91; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c120(); + s1 = peg$c121(); } s0 = s1; @@ -5577,7 +5667,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c121(s1, s5); + s1 = peg$c122(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -5694,7 +5784,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c122(s1, s2); + s1 = peg$c123(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5715,7 +5805,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_NULL(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c123(); + s1 = peg$c124(); } s0 = s1; @@ -5729,7 +5819,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_TRUE(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c125(); } s0 = s1; if (s0 === peg$FAILED) { @@ -5737,7 +5827,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_FALSE(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c125(); + s1 = peg$c126(); } s0 = s1; } @@ -5751,11 +5841,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c126; + s2 = peg$c127; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s2 !== peg$FAILED) { s3 = []; @@ -5766,11 +5856,11 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s4 = peg$c126; + s4 = peg$c127; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s4 !== peg$FAILED) { s2 = [s2, s3, s4]; @@ -5790,11 +5880,11 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { - s2 = peg$c128; + s2 = peg$c129; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c129); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s2 !== peg$FAILED) { s3 = []; @@ -5805,11 +5895,11 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s4 = peg$c128; + s4 = peg$c129; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c129); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s4 !== peg$FAILED) { s2 = [s2, s3, s4]; @@ -5829,7 +5919,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c130(s1); + s1 = peg$c131(s1); } s0 = s1; @@ -5839,12 +5929,12 @@ function peg$parse(input, options) { function peg$parsesingle_char() { var s0; - if (peg$c131.test(input.charAt(peg$currPos))) { + if (peg$c132.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$c133); } } if (s0 === peg$FAILED) { s0 = peg$parseescape_char(); @@ -5856,12 +5946,12 @@ function peg$parse(input, options) { function peg$parsedouble_char() { var s0; - if (peg$c133.test(input.charAt(peg$currPos))) { + if (peg$c134.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$c135); } } if (s0 === peg$FAILED) { s0 = peg$parseescape_char(); @@ -5874,138 +5964,138 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c135) { - s1 = peg$c135; + if (input.substr(peg$currPos, 2) === peg$c136) { + s1 = peg$c136; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c136); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c137(); + s1 = peg$c138(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c138) { - s1 = peg$c138; + if (input.substr(peg$currPos, 2) === peg$c139) { + s1 = peg$c139; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c139); } + if (peg$silentFails === 0) { peg$fail(peg$c140); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c140(); + s1 = peg$c141(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c141) { - s1 = peg$c141; + if (input.substr(peg$currPos, 2) === peg$c142) { + s1 = peg$c142; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c142); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c143(); + s1 = peg$c144(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c144) { - s1 = peg$c144; + if (input.substr(peg$currPos, 2) === peg$c145) { + s1 = peg$c145; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c146); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c146(); + s1 = peg$c147(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c147) { - s1 = peg$c147; + if (input.substr(peg$currPos, 2) === peg$c148) { + s1 = peg$c148; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c148); } + if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c149(); + s1 = peg$c150(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c150) { - s1 = peg$c150; + if (input.substr(peg$currPos, 2) === peg$c151) { + s1 = peg$c151; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c151); } + if (peg$silentFails === 0) { peg$fail(peg$c152); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c152(); + s1 = peg$c153(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c153) { - s1 = peg$c153; + if (input.substr(peg$currPos, 2) === peg$c154) { + s1 = peg$c154; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c154); } + if (peg$silentFails === 0) { peg$fail(peg$c155); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c155(); + s1 = peg$c156(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c156) { - s1 = peg$c156; + if (input.substr(peg$currPos, 2) === peg$c157) { + s1 = peg$c157; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$c158); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c158(); + s1 = peg$c159(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c159) { - s1 = peg$c159; + if (input.substr(peg$currPos, 2) === peg$c160) { + s1 = peg$c160; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c160); } + if (peg$silentFails === 0) { peg$fail(peg$c161); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c161(); + s1 = peg$c162(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c162) { - s1 = peg$c162; + if (input.substr(peg$currPos, 2) === peg$c163) { + s1 = peg$c163; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c163); } + if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { s2 = peg$parsehexDigit(); @@ -6017,7 +6107,7 @@ function peg$parse(input, options) { s5 = peg$parsehexDigit(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c164(s2, s3, s4, s5); + s1 = peg$c165(s2, s3, s4, s5); s0 = s1; } else { peg$currPos = s0; @@ -6055,12 +6145,12 @@ function peg$parse(input, options) { function peg$parseline_terminator() { var s0; - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$c166.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$c167); } } return s0; @@ -6073,7 +6163,7 @@ function peg$parse(input, options) { s1 = peg$parsenumber(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c167(s1); + s1 = peg$c168(s1); } s0 = s1; @@ -6093,7 +6183,7 @@ function peg$parse(input, options) { s4 = peg$parse__(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c168(s1, s2, s3); + s1 = peg$c169(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -6120,7 +6210,7 @@ function peg$parse(input, options) { s3 = peg$parse__(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c169(s1, s2); + s1 = peg$c170(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6143,7 +6233,7 @@ function peg$parse(input, options) { s3 = peg$parse__(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c170(s1, s2); + s1 = peg$c171(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6164,7 +6254,7 @@ function peg$parse(input, options) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c171(s1); + s1 = peg$c172(s1); s0 = s1; } else { peg$currPos = s0; @@ -6190,7 +6280,7 @@ function peg$parse(input, options) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c172(s1, s2); + s1 = peg$c173(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6205,19 +6295,19 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { - s1 = peg$c87; + s1 = peg$c88; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s1 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { - s1 = peg$c85; + s1 = peg$c86; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } } if (s1 !== peg$FAILED) { @@ -6226,7 +6316,7 @@ function peg$parse(input, options) { s3 = peg$parsedigits(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c173(s1, s2, s3); + s1 = peg$c174(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -6243,26 +6333,26 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { - s1 = peg$c87; + s1 = peg$c88; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s1 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { - s1 = peg$c85; + s1 = peg$c86; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } } if (s1 !== peg$FAILED) { s2 = peg$parsedigit(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c174(s1, s2); + s1 = peg$c175(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6284,17 +6374,17 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s1 = peg$c175; + s1 = peg$c176; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c177(s2); + s1 = peg$c178(s2); s0 = s1; } else { peg$currPos = s0; @@ -6317,7 +6407,7 @@ function peg$parse(input, options) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c178(s1, s2); + s1 = peg$c179(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6347,7 +6437,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c179(s1); + s1 = peg$c180(s1); } s0 = s1; @@ -6357,12 +6447,12 @@ function peg$parse(input, options) { function peg$parsedigit() { var s0; - if (peg$c180.test(input.charAt(peg$currPos))) { + if (peg$c181.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$c182); } } return s0; @@ -6371,12 +6461,12 @@ function peg$parse(input, options) { function peg$parsedigit19() { var s0; - if (peg$c182.test(input.charAt(peg$currPos))) { + if (peg$c183.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c183); } + if (peg$silentFails === 0) { peg$fail(peg$c184); } } return s0; @@ -6385,12 +6475,12 @@ function peg$parse(input, options) { function peg$parsehexDigit() { var s0; - if (peg$c184.test(input.charAt(peg$currPos))) { + if (peg$c185.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c185); } + if (peg$silentFails === 0) { peg$fail(peg$c186); } } return s0; @@ -6400,27 +6490,27 @@ function peg$parse(input, options) { var s0, s1, s2; s0 = peg$currPos; - if (peg$c186.test(input.charAt(peg$currPos))) { + if (peg$c187.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c187); } + if (peg$silentFails === 0) { peg$fail(peg$c188); } } if (s1 !== peg$FAILED) { - if (peg$c188.test(input.charAt(peg$currPos))) { + if (peg$c189.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c189); } + if (peg$silentFails === 0) { peg$fail(peg$c190); } } if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(s1, s2); + s1 = peg$c191(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6438,12 +6528,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c191) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c192) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c192); } + if (peg$silentFails === 0) { peg$fail(peg$c193); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6475,12 +6565,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c193) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c194) { 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$c195); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6512,12 +6602,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c196) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$c197); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6549,12 +6639,12 @@ 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$c198) { 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$c199); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6586,12 +6676,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c199) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c200) { 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$c201); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6623,12 +6713,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c201) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c202) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c202); } + if (peg$silentFails === 0) { peg$fail(peg$c203); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6660,12 +6750,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c203) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c204) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c204); } + if (peg$silentFails === 0) { peg$fail(peg$c205); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6697,12 +6787,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c205) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c206) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c206); } + if (peg$silentFails === 0) { peg$fail(peg$c207); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6734,12 +6824,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c207) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c208) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c208); } + if (peg$silentFails === 0) { peg$fail(peg$c209); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6771,12 +6861,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c209) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c210) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c210); } + if (peg$silentFails === 0) { peg$fail(peg$c211); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6808,12 +6898,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c211) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c212) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c212); } + if (peg$silentFails === 0) { peg$fail(peg$c213); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6845,12 +6935,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c213) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c214) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c214); } + if (peg$silentFails === 0) { peg$fail(peg$c215); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6882,12 +6972,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c215) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c216) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c216); } + if (peg$silentFails === 0) { peg$fail(peg$c217); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6919,12 +7009,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c217) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c218) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c218); } + if (peg$silentFails === 0) { peg$fail(peg$c219); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6956,12 +7046,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c219) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c220) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c220); } + if (peg$silentFails === 0) { peg$fail(peg$c221); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6993,12 +7083,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c221) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c222) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c222); } + if (peg$silentFails === 0) { peg$fail(peg$c223); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7030,12 +7120,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c223) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c224) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c224); } + if (peg$silentFails === 0) { peg$fail(peg$c225); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7067,12 +7157,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c225) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c226) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c226); } + if (peg$silentFails === 0) { peg$fail(peg$c227); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7104,12 +7194,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c227) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c228) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c228); } + if (peg$silentFails === 0) { peg$fail(peg$c229); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7141,12 +7231,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c229) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c230) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c230); } + if (peg$silentFails === 0) { peg$fail(peg$c231); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7178,12 +7268,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c231) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c232) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c232); } + if (peg$silentFails === 0) { peg$fail(peg$c233); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7215,12 +7305,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c233) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c234) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c234); } + if (peg$silentFails === 0) { peg$fail(peg$c235); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7252,12 +7342,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c235) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c236) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c236); } + if (peg$silentFails === 0) { peg$fail(peg$c237); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7289,12 +7379,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c237) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c238) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c238); } + if (peg$silentFails === 0) { peg$fail(peg$c239); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7326,12 +7416,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c239) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c240) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c240); } + if (peg$silentFails === 0) { peg$fail(peg$c241); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7363,12 +7453,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c241) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c242) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c242); } + if (peg$silentFails === 0) { peg$fail(peg$c243); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7400,12 +7490,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c243) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c244) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c244); } + if (peg$silentFails === 0) { peg$fail(peg$c245); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7437,12 +7527,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c245) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c246) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c246); } + if (peg$silentFails === 0) { peg$fail(peg$c247); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7474,12 +7564,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c247) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c248) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c248); } + if (peg$silentFails === 0) { peg$fail(peg$c249); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7511,12 +7601,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c249) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c250) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c250); } + if (peg$silentFails === 0) { peg$fail(peg$c251); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7548,12 +7638,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c251) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c252) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c252); } + if (peg$silentFails === 0) { peg$fail(peg$c253); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7568,7 +7658,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c253(); + s1 = peg$c254(); s0 = s1; } else { peg$currPos = s0; @@ -7586,12 +7676,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c254) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c255) { 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$c256); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7606,7 +7696,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c256(); + s1 = peg$c257(); s0 = s1; } else { peg$currPos = s0; @@ -7624,12 +7714,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c257) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c258) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c258); } + if (peg$silentFails === 0) { peg$fail(peg$c259); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7644,7 +7734,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c259(); + s1 = peg$c260(); s0 = s1; } else { peg$currPos = s0; @@ -7662,12 +7752,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c260) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c261) { s1 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c261); } + if (peg$silentFails === 0) { peg$fail(peg$c262); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7682,7 +7772,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c262(); + s1 = peg$c263(); s0 = s1; } else { peg$currPos = s0; @@ -7700,12 +7790,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c263) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c264) { s1 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c264); } + if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7720,7 +7810,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c265(); + s1 = peg$c266(); s0 = s1; } else { peg$currPos = s0; @@ -7738,12 +7828,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c266) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c267) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c267); } + if (peg$silentFails === 0) { peg$fail(peg$c268); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7758,7 +7848,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c268(); + s1 = peg$c269(); s0 = s1; } else { peg$currPos = s0; @@ -7776,12 +7866,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c269) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c270) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c270); } + if (peg$silentFails === 0) { peg$fail(peg$c271); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7796,7 +7886,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c271(); + s1 = peg$c272(); s0 = s1; } else { peg$currPos = s0; @@ -7814,12 +7904,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c272) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c273) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c273); } + if (peg$silentFails === 0) { peg$fail(peg$c274); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7834,7 +7924,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c274(); + s1 = peg$c275(); s0 = s1; } else { peg$currPos = s0; @@ -7852,12 +7942,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c275) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c276) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c276); } + if (peg$silentFails === 0) { peg$fail(peg$c277); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7872,7 +7962,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c277(); + s1 = peg$c278(); s0 = s1; } else { peg$currPos = s0; @@ -7890,12 +7980,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c278) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c279) { s1 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c279); } + if (peg$silentFails === 0) { peg$fail(peg$c280); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7910,7 +8000,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c280(); + s1 = peg$c281(); s0 = s1; } else { peg$currPos = s0; @@ -7928,12 +8018,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c281) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c282) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c282); } + if (peg$silentFails === 0) { peg$fail(peg$c283); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7948,7 +8038,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c283(); + s1 = peg$c284(); s0 = s1; } else { peg$currPos = s0; @@ -7966,12 +8056,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c284) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c285) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c285); } + if (peg$silentFails === 0) { peg$fail(peg$c286); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7986,7 +8076,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c286(); + s1 = peg$c287(); s0 = s1; } else { peg$currPos = s0; @@ -8004,12 +8094,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c287) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c288) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c288); } + if (peg$silentFails === 0) { peg$fail(peg$c289); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8024,7 +8114,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c289(); + s1 = peg$c290(); s0 = s1; } else { peg$currPos = s0; @@ -8042,12 +8132,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c290) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c291) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c291); } + if (peg$silentFails === 0) { peg$fail(peg$c292); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8062,7 +8152,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c292(); + s1 = peg$c293(); s0 = s1; } else { peg$currPos = s0; @@ -8080,12 +8170,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c293) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c294) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c294); } + if (peg$silentFails === 0) { peg$fail(peg$c295); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8100,7 +8190,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c295(); + s1 = peg$c296(); s0 = s1; } else { peg$currPos = s0; @@ -8118,12 +8208,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c296) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c297) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c297); } + if (peg$silentFails === 0) { peg$fail(peg$c298); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8138,7 +8228,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c298(); + s1 = peg$c299(); s0 = s1; } else { peg$currPos = s0; @@ -8156,12 +8246,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c299) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c300) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c300); } + if (peg$silentFails === 0) { peg$fail(peg$c301); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8176,7 +8266,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c301(); + s1 = peg$c302(); s0 = s1; } else { peg$currPos = s0; @@ -8194,12 +8284,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c302) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c303) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c303); } + if (peg$silentFails === 0) { peg$fail(peg$c304); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8214,7 +8304,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c304(); + s1 = peg$c305(); s0 = s1; } else { peg$currPos = s0; @@ -8232,12 +8322,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c305) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c306) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c306); } + if (peg$silentFails === 0) { peg$fail(peg$c307); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8252,7 +8342,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c307(); + s1 = peg$c308(); s0 = s1; } else { peg$currPos = s0; @@ -8270,11 +8360,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c175; + s0 = peg$c176; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } return s0; @@ -8284,11 +8374,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 44) { - s0 = peg$c308; + s0 = peg$c309; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c309); } + if (peg$silentFails === 0) { peg$fail(peg$c310); } } return s0; @@ -8298,11 +8388,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 42) { - s0 = peg$c90; + s0 = peg$c91; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } return s0; @@ -8340,11 +8430,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 91) { - s0 = peg$c310; + s0 = peg$c311; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c311); } + if (peg$silentFails === 0) { peg$fail(peg$c312); } } return s0; @@ -8354,11 +8444,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 93) { - s0 = peg$c312; + s0 = peg$c313; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c313); } + if (peg$silentFails === 0) { peg$fail(peg$c314); } } return s0; @@ -8394,12 +8484,12 @@ function peg$parse(input, options) { function peg$parsewhitespace() { var s0; - if (peg$c314.test(input.charAt(peg$currPos))) { + if (peg$c315.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c315); } + if (peg$silentFails === 0) { peg$fail(peg$c316); } } return s0; @@ -8411,22 +8501,22 @@ function peg$parse(input, options) { s0 = peg$parseEOF(); if (s0 === peg$FAILED) { s0 = []; - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$c166.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c166); } + if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$c166.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c166); } + if (peg$silentFails === 0) { peg$fail(peg$c167); } } } } else { @@ -8478,7 +8568,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$c316(); + s1 = peg$c317(); if (s1) { s1 = void 0; } else { @@ -8493,7 +8583,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c317(s3); + s1 = peg$c318(s3); s0 = s1; } else { peg$currPos = s0; @@ -8526,7 +8616,7 @@ function peg$parse(input, options) { s5 = peg$parseproc_expr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c318(s1, s5); + s1 = peg$c319(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -8563,7 +8653,7 @@ function peg$parse(input, options) { s3 = peg$parseproc_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c319(s3); + s1 = peg$c320(s3); s0 = s1; } else { peg$currPos = s0; @@ -8664,7 +8754,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -8744,7 +8834,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -8777,7 +8867,7 @@ function peg$parse(input, options) { s7 = peg$parseon_clause(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c320(s1, s3, s5, s7); + s1 = peg$c321(s1, s3, s5, s7); s0 = s1; } else { peg$currPos = s0; @@ -8834,7 +8924,7 @@ function peg$parse(input, options) { s5 = peg$parseRPAREN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c96(s3); + s1 = peg$c97(s3); s0 = s1; } else { peg$currPos = s0; @@ -8883,7 +8973,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c321(s1, s5); + s1 = peg$c322(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -9012,7 +9102,7 @@ function peg$parse(input, options) { s5 = peg$parseRBRAKE(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c322(s3); + s1 = peg$c323(s3); s0 = s1; } else { peg$currPos = s0; @@ -9049,7 +9139,7 @@ function peg$parse(input, options) { s3 = peg$parsemem_chain(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c323(s2, s3); + s1 = peg$c324(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -9074,11 +9164,11 @@ function peg$parse(input, options) { s1 = []; s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c175; + s3 = peg$c176; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } if (s3 !== peg$FAILED) { s4 = peg$parseident_name(); @@ -9097,11 +9187,11 @@ function peg$parse(input, options) { s1.push(s2); s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c175; + s3 = peg$c176; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } if (s3 !== peg$FAILED) { s4 = peg$parseident_name(); @@ -9119,7 +9209,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c324(s1); + s1 = peg$c325(s1); } s0 = s1; @@ -9130,11 +9220,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 36) { - s0 = peg$c325; + s0 = peg$c326; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c326); } + if (peg$silentFails === 0) { peg$fail(peg$c327); } } return s0; @@ -9143,12 +9233,12 @@ function peg$parse(input, options) { function peg$parseKW_RETURN() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c327) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c328) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c328); } + if (peg$silentFails === 0) { peg$fail(peg$c329); } } return s0; @@ -9157,12 +9247,12 @@ function peg$parse(input, options) { function peg$parseKW_ASSIGN() { var s0; - if (input.substr(peg$currPos, 2) === peg$c329) { - s0 = peg$c329; + if (input.substr(peg$currPos, 2) === peg$c330) { + s0 = peg$c330; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c330); } + if (peg$silentFails === 0) { peg$fail(peg$c331); } } return s0; diff --git a/packages/sql-parser/base/parser.js b/packages/sql-parser/base/parser.js index 7f4bc2de..1082ef3b 100644 --- a/packages/sql-parser/base/parser.js +++ b/packages/sql-parser/base/parser.js @@ -341,22 +341,32 @@ function peg$parse(input, options) { where : w } }, - peg$c42 = "=", - peg$c43 = peg$literalExpectation("=", false), - peg$c44 = function(c, v) { + peg$c42 = function(t, j, l, w) { + return { + type : 'update', + db : '', + table : t, + join : j, + set : l, + where : w + } + }, + peg$c43 = "=", + peg$c44 = peg$literalExpectation("=", false), + peg$c45 = function(c, v) { return { column: c, value : v } }, - peg$c45 = function(t, c, v) { + peg$c46 = function(t, c, v) { return { table: t, column: c, value : v } }, - peg$c46 = function(ri, db, t, c, v) { + peg$c47 = function(ri, db, t, c, v) { return { type : ri, db : db, @@ -365,7 +375,7 @@ function peg$parse(input, options) { values : v } }, - peg$c47 = function(ri, db, t, l, u) { + peg$c48 = function(ri, db, t, l, u) { var v = { type : ri, db : db, @@ -379,7 +389,7 @@ function peg$parse(input, options) { return v; }, - peg$c48 = function(ri, t, c, v) { + peg$c49 = function(ri, t, c, v) { return { type : ri, db : '', @@ -388,7 +398,7 @@ function peg$parse(input, options) { values : v } }, - peg$c49 = function(ri, t, l, u) { + peg$c50 = function(ri, t, l, u) { var v = { type : ri, db : '', @@ -402,19 +412,19 @@ function peg$parse(input, options) { return v; }, - peg$c50 = function(c) {error('EXPECTED COLUMN NAME')}, - peg$c51 = function(c) { + peg$c51 = function(c) {error('EXPECTED COLUMN NAME')}, + peg$c52 = function(c) { return c }, - peg$c52 = function() { return 'insert'; }, - peg$c53 = function() { return 'replace' }, - peg$c54 = function(l) { + peg$c53 = function() { return 'insert'; }, + peg$c54 = function() { return 'replace' }, + peg$c55 = function(l) { return l; }, - peg$c55 = function(l) { + peg$c56 = function(l) { return l; }, - peg$c56 = function(head, tail) { + peg$c57 = function(head, tail) { var el = { type : 'expr_list' } @@ -423,22 +433,22 @@ function peg$parse(input, options) { el.value = l; return el; }, - peg$c57 = "", - peg$c58 = function() { + peg$c58 = "", + peg$c59 = function() { return { type : 'expr_list', value : [] } }, - peg$c59 = function(head, tail) { + peg$c60 = function(head, tail) { return createBinaryExprChain(head, tail); }, - peg$c60 = "!", - peg$c61 = peg$literalExpectation("!", false), - peg$c62 = function(expr) { + peg$c61 = "!", + peg$c62 = peg$literalExpectation("!", false), + peg$c63 = function(expr) { return createUnaryExpr('NOT', expr); }, - peg$c63 = function(left, rh) { + peg$c64 = function(left, rh) { if (rh === null) { return left; } else { @@ -451,31 +461,31 @@ function peg$parse(input, options) { return res; } }, - peg$c64 = function(l) { + peg$c65 = function(l) { return { type : 'arithmetic', tail : l } }, - peg$c65 = ">=", - peg$c66 = peg$literalExpectation(">=", false), - peg$c67 = ">", - peg$c68 = peg$literalExpectation(">", false), - peg$c69 = "<=", - peg$c70 = peg$literalExpectation("<=", false), - peg$c71 = "<>", - peg$c72 = peg$literalExpectation("<>", false), - peg$c73 = "<", - peg$c74 = peg$literalExpectation("<", false), - peg$c75 = "!=", - peg$c76 = peg$literalExpectation("!=", false), - peg$c77 = function(op, right) { + peg$c66 = ">=", + peg$c67 = peg$literalExpectation(">=", false), + peg$c68 = ">", + peg$c69 = peg$literalExpectation(">", false), + peg$c70 = "<=", + peg$c71 = peg$literalExpectation("<=", false), + peg$c72 = "<>", + peg$c73 = peg$literalExpectation("<>", false), + peg$c74 = "<", + peg$c75 = peg$literalExpectation("<", false), + peg$c76 = "!=", + peg$c77 = peg$literalExpectation("!=", false), + peg$c78 = function(op, right) { return { op : op, right : right } }, - peg$c78 = function(op, begin, end) { + peg$c79 = function(op, begin, end) { return { op : op, right : { @@ -484,55 +494,55 @@ function peg$parse(input, options) { } } }, - peg$c79 = function(nk) { return nk[0] + ' ' + nk[2]; }, - peg$c80 = function(op, right) { + peg$c80 = function(nk) { return nk[0] + ' ' + nk[2]; }, + peg$c81 = function(op, right) { return { op : op, right : right } }, - peg$c81 = function(op, l) { + peg$c82 = function(op, l) { return { op : op, right : l } }, - peg$c82 = function(op, l) { + peg$c83 = function(op, l) { return { op : op, right : l } }, - peg$c83 = function(op, e) { + peg$c84 = function(op, e) { return { op : op, right : e } }, - peg$c84 = function(op, l) { + peg$c85 = function(op, l) { return { op : op, right : l } }, - peg$c85 = "+", - peg$c86 = peg$literalExpectation("+", false), - peg$c87 = "-", - peg$c88 = peg$literalExpectation("-", false), - peg$c89 = function(head, tail) { + peg$c86 = "+", + peg$c87 = peg$literalExpectation("+", false), + peg$c88 = "-", + peg$c89 = peg$literalExpectation("-", false), + peg$c90 = function(head, tail) { return createBinaryExprChain(head, tail) }, - peg$c90 = "*", - peg$c91 = peg$literalExpectation("*", false), - peg$c92 = "/", - peg$c93 = peg$literalExpectation("/", false), - peg$c94 = "%", - peg$c95 = peg$literalExpectation("%", false), - peg$c96 = function(e) { + peg$c91 = "*", + peg$c92 = peg$literalExpectation("*", false), + peg$c93 = "/", + peg$c94 = peg$literalExpectation("/", false), + peg$c95 = "%", + peg$c96 = peg$literalExpectation("%", false), + peg$c97 = function(e) { e.paren = true; return e; }, - peg$c97 = function(tbl, col) { + peg$c98 = function(tbl, col) { return { type : 'column_ref', table : tbl, @@ -540,7 +550,7 @@ function peg$parse(input, options) { location: location() }; }, - peg$c98 = function(col) { + peg$c99 = function(col) { return { type : 'column_ref', table : '', @@ -548,27 +558,27 @@ function peg$parse(input, options) { location: location() }; }, - peg$c99 = function(name) { return reservedMap[name.toUpperCase()] === true; }, - peg$c100 = function(name) { + peg$c100 = function(name) { return reservedMap[name.toUpperCase()] === true; }, + peg$c101 = function(name) { return name; }, - peg$c101 = "`", - peg$c102 = peg$literalExpectation("`", false), - peg$c103 = /^[^`]/, - peg$c104 = peg$classExpectation(["`"], true, false), - peg$c105 = function(chars) { + peg$c102 = "`", + peg$c103 = peg$literalExpectation("`", false), + peg$c104 = /^[^`]/, + peg$c105 = peg$classExpectation(["`"], true, false), + peg$c106 = function(chars) { return chars.join(''); }, - peg$c106 = function(start, parts) { return start + parts.join(''); }, - peg$c107 = /^[A-Za-z_]/, - peg$c108 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false), - peg$c109 = /^[A-Za-z0-9_]/, - peg$c110 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false), - peg$c111 = /^[A-Za-z0-9_:]/, - peg$c112 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", ":"], false, false), - peg$c113 = ":", - peg$c114 = peg$literalExpectation(":", false), - peg$c115 = function(l) { + peg$c107 = function(start, parts) { return start + parts.join(''); }, + peg$c108 = /^[A-Za-z_]/, + peg$c109 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false), + peg$c110 = /^[A-Za-z0-9_]/, + peg$c111 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false), + peg$c112 = /^[A-Za-z0-9_:]/, + peg$c113 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", ":"], false, false), + peg$c114 = ":", + peg$c115 = peg$literalExpectation(":", false), + peg$c116 = function(l) { var p = { type : 'param', value: l[1] @@ -579,7 +589,7 @@ function peg$parse(input, options) { params.push(p); return p; }, - peg$c116 = function(name, e) { + peg$c117 = function(name, e) { return { type : 'aggr_func', name : name, @@ -588,286 +598,286 @@ function peg$parse(input, options) { } } }, - peg$c117 = function(name, arg) { + peg$c118 = function(name, arg) { return { type : 'aggr_func', name : name, args : arg } }, - peg$c118 = function(e) { + peg$c119 = function(e) { return { expr : e } }, - peg$c119 = function(d, c) { + peg$c120 = function(d, c) { return { distinct : d, expr : c } }, - peg$c120 = function() { + peg$c121 = function() { return { type : 'star', value : '*' } }, - peg$c121 = function(name, l) { + peg$c122 = function(name, l) { return { type : 'function', name : name, args : l } }, - peg$c122 = function(head, tail) { + peg$c123 = function(head, tail) { return createList(head, tail); }, - peg$c123 = function() { + peg$c124 = function() { return { type : 'null', value : null, location : location() }; }, - peg$c124 = function() { + peg$c125 = function() { return { type : 'bool', value : true, location : location() }; }, - peg$c125 = function() { + peg$c126 = function() { return { type : 'bool', value : false, location : location() }; }, - peg$c126 = "\"", - peg$c127 = peg$literalExpectation("\"", false), - peg$c128 = "'", - peg$c129 = peg$literalExpectation("'", false), - peg$c130 = function(ca) { + peg$c127 = "\"", + peg$c128 = peg$literalExpectation("\"", false), + peg$c129 = "'", + peg$c130 = peg$literalExpectation("'", false), + peg$c131 = function(ca) { return { type : 'string', value : ca[1].join(''), location : location() } }, - peg$c131 = /^[^'\\\0-\x1F\x7F]/, - peg$c132 = peg$classExpectation(["'", "\\", ["\0", "\x1F"], "\x7F"], true, false), - peg$c133 = /^[^"\\\0-\x1F\x7F]/, - peg$c134 = peg$classExpectation(["\"", "\\", ["\0", "\x1F"], "\x7F"], true, false), - peg$c135 = "\\'", - peg$c136 = peg$literalExpectation("\\'", false), - peg$c137 = function() { return "'"; }, - peg$c138 = "\\\"", - peg$c139 = peg$literalExpectation("\\\"", false), - peg$c140 = function() { return '"'; }, - peg$c141 = "\\\\", - peg$c142 = peg$literalExpectation("\\\\", false), - peg$c143 = function() { return "\\"; }, - peg$c144 = "\\/", - peg$c145 = peg$literalExpectation("\\/", false), - peg$c146 = function() { return "/"; }, - peg$c147 = "\\b", - peg$c148 = peg$literalExpectation("\\b", false), - peg$c149 = function() { return "\b"; }, - peg$c150 = "\\f", - peg$c151 = peg$literalExpectation("\\f", false), - peg$c152 = function() { return "\f"; }, - peg$c153 = "\\n", - peg$c154 = peg$literalExpectation("\\n", false), - peg$c155 = function() { return "\n"; }, - peg$c156 = "\\r", - peg$c157 = peg$literalExpectation("\\r", false), - peg$c158 = function() { return "\r"; }, - peg$c159 = "\\t", - peg$c160 = peg$literalExpectation("\\t", false), - peg$c161 = function() { return "\t"; }, - peg$c162 = "\\u", - peg$c163 = peg$literalExpectation("\\u", false), - peg$c164 = function(h1, h2, h3, h4) { + peg$c132 = /^[^'\\\0-\x1F\x7F]/, + peg$c133 = peg$classExpectation(["'", "\\", ["\0", "\x1F"], "\x7F"], true, false), + peg$c134 = /^[^"\\\0-\x1F\x7F]/, + peg$c135 = peg$classExpectation(["\"", "\\", ["\0", "\x1F"], "\x7F"], true, false), + peg$c136 = "\\'", + peg$c137 = peg$literalExpectation("\\'", false), + peg$c138 = function() { return "'"; }, + peg$c139 = "\\\"", + peg$c140 = peg$literalExpectation("\\\"", false), + peg$c141 = function() { return '"'; }, + peg$c142 = "\\\\", + peg$c143 = peg$literalExpectation("\\\\", false), + peg$c144 = function() { return "\\"; }, + peg$c145 = "\\/", + peg$c146 = peg$literalExpectation("\\/", false), + peg$c147 = function() { return "/"; }, + peg$c148 = "\\b", + peg$c149 = peg$literalExpectation("\\b", false), + peg$c150 = function() { return "\b"; }, + peg$c151 = "\\f", + peg$c152 = peg$literalExpectation("\\f", false), + peg$c153 = function() { return "\f"; }, + peg$c154 = "\\n", + peg$c155 = peg$literalExpectation("\\n", false), + peg$c156 = function() { return "\n"; }, + peg$c157 = "\\r", + peg$c158 = peg$literalExpectation("\\r", false), + peg$c159 = function() { return "\r"; }, + peg$c160 = "\\t", + peg$c161 = peg$literalExpectation("\\t", false), + peg$c162 = function() { return "\t"; }, + peg$c163 = "\\u", + peg$c164 = peg$literalExpectation("\\u", false), + peg$c165 = function(h1, h2, h3, h4) { return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4)); }, - peg$c165 = /^[\n\r]/, - peg$c166 = peg$classExpectation(["\n", "\r"], false, false), - peg$c167 = function(n) { + peg$c166 = /^[\n\r]/, + peg$c167 = peg$classExpectation(["\n", "\r"], false, false), + peg$c168 = function(n) { return { type : 'number', value : n, location: location() } }, - peg$c168 = function(int_, frac, exp) { return parseFloat(int_ + frac + exp); }, - peg$c169 = function(int_, frac) { return parseFloat(int_ + frac); }, - peg$c170 = function(int_, exp) { return parseFloat(int_ + exp); }, - peg$c171 = function(int_) { return parseFloat(int_); }, - peg$c172 = function(digit19, digits) { return digit19 + digits; }, - peg$c173 = function(op, digit19, digits) { return "-" + digit19 + digits; }, - peg$c174 = function(op, digit) { return "-" + digit; }, - peg$c175 = ".", - peg$c176 = peg$literalExpectation(".", false), - peg$c177 = function(digits) { return "." + digits; }, - peg$c178 = function(e, digits) { return e + digits; }, - peg$c179 = function(digits) { return digits.join(""); }, - peg$c180 = /^[0-9]/, - peg$c181 = peg$classExpectation([["0", "9"]], false, false), - peg$c182 = /^[1-9]/, - peg$c183 = peg$classExpectation([["1", "9"]], false, false), - peg$c184 = /^[0-9a-fA-F]/, - peg$c185 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false), - peg$c186 = /^[eE]/, - peg$c187 = peg$classExpectation(["e", "E"], false, false), - peg$c188 = /^[+\-]/, - peg$c189 = peg$classExpectation(["+", "-"], false, false), - peg$c190 = function(e, sign) { return e + (sign || ''); }, - peg$c191 = "null", - peg$c192 = peg$literalExpectation("NULL", true), - peg$c193 = "true", - peg$c194 = peg$literalExpectation("TRUE", true), - peg$c195 = "false", - peg$c196 = peg$literalExpectation("FALSE", true), - peg$c197 = "show", - peg$c198 = peg$literalExpectation("SHOW", true), - peg$c199 = "drop", - peg$c200 = peg$literalExpectation("DROP", true), - peg$c201 = "select", - peg$c202 = peg$literalExpectation("SELECT", true), - peg$c203 = "update", - peg$c204 = peg$literalExpectation("UPDATE", true), - peg$c205 = "create", - peg$c206 = peg$literalExpectation("CREATE", true), - peg$c207 = "delete", - peg$c208 = peg$literalExpectation("DELETE", true), - peg$c209 = "insert", - peg$c210 = peg$literalExpectation("INSERT", true), - peg$c211 = "replace", - peg$c212 = peg$literalExpectation("REPLACE", true), - peg$c213 = "explain", - peg$c214 = peg$literalExpectation("EXPLAIN", true), - peg$c215 = "into", - peg$c216 = peg$literalExpectation("INTO", true), - peg$c217 = "from", - peg$c218 = peg$literalExpectation("FROM", true), - peg$c219 = "set", - peg$c220 = peg$literalExpectation("SET", true), - peg$c221 = "as", - peg$c222 = peg$literalExpectation("AS", true), - peg$c223 = "table", - peg$c224 = peg$literalExpectation("TABLE", true), - peg$c225 = "on", - peg$c226 = peg$literalExpectation("ON", true), - peg$c227 = "left", - peg$c228 = peg$literalExpectation("LEFT", true), - peg$c229 = "inner", - peg$c230 = peg$literalExpectation("INNER", true), - peg$c231 = "join", - peg$c232 = peg$literalExpectation("JOIN", true), - peg$c233 = "union", - peg$c234 = peg$literalExpectation("UNION", true), - peg$c235 = "values", - peg$c236 = peg$literalExpectation("VALUES", true), - peg$c237 = "exists", - peg$c238 = peg$literalExpectation("EXISTS", true), - peg$c239 = "where", - peg$c240 = peg$literalExpectation("WHERE", true), - peg$c241 = "group", - peg$c242 = peg$literalExpectation("GROUP", true), - peg$c243 = "by", - peg$c244 = peg$literalExpectation("BY", true), - peg$c245 = "order", - peg$c246 = peg$literalExpectation("ORDER", true), - peg$c247 = "having", - peg$c248 = peg$literalExpectation("HAVING", true), - peg$c249 = "limit", - peg$c250 = peg$literalExpectation("LIMIT", true), - peg$c251 = "asc", - peg$c252 = peg$literalExpectation("ASC", true), - peg$c253 = function() { return 'ASC'; }, - peg$c254 = "desc", - peg$c255 = peg$literalExpectation("DESC", true), - peg$c256 = function() { return 'DESC'; }, - peg$c257 = "all", - peg$c258 = peg$literalExpectation("ALL", true), - peg$c259 = function() { return 'ALL'; }, - peg$c260 = "distinct", - peg$c261 = peg$literalExpectation("DISTINCT", true), - peg$c262 = function() { return 'DISTINCT'; }, - peg$c263 = "duplicate", - peg$c264 = peg$literalExpectation("DUPLICATE", true), - peg$c265 = function() { return 'DUPLICATE';}, - peg$c266 = "between", - peg$c267 = peg$literalExpectation("BETWEEN", true), - peg$c268 = function() { return 'BETWEEN'; }, - peg$c269 = "in", - peg$c270 = peg$literalExpectation("IN", true), - peg$c271 = function() { return 'IN'; }, - peg$c272 = "is", - peg$c273 = peg$literalExpectation("IS", true), - peg$c274 = function() { return 'IS'; }, - peg$c275 = "like", - peg$c276 = peg$literalExpectation("LIKE", true), - peg$c277 = function() { return 'LIKE'; }, - peg$c278 = "contains", - peg$c279 = peg$literalExpectation("CONTAINS", true), - peg$c280 = function() { return 'CONTAINS'; }, - peg$c281 = "key", - peg$c282 = peg$literalExpectation("KEY", true), - peg$c283 = function() { return 'KEY'; }, - peg$c284 = "not", - peg$c285 = peg$literalExpectation("NOT", true), - peg$c286 = function() { return 'NOT'; }, - peg$c287 = "and", - peg$c288 = peg$literalExpectation("AND", true), - peg$c289 = function() { return 'AND'; }, - peg$c290 = "or", - peg$c291 = peg$literalExpectation("OR", true), - peg$c292 = function() { return 'OR'; }, - peg$c293 = "count", - peg$c294 = peg$literalExpectation("COUNT", true), - peg$c295 = function() { return 'COUNT'; }, - peg$c296 = "max", - peg$c297 = peg$literalExpectation("MAX", true), - peg$c298 = function() { return 'MAX'; }, - peg$c299 = "min", - peg$c300 = peg$literalExpectation("MIN", true), - peg$c301 = function() { return 'MIN'; }, - peg$c302 = "sum", - peg$c303 = peg$literalExpectation("SUM", true), - peg$c304 = function() { return 'SUM'; }, - peg$c305 = "avg", - peg$c306 = peg$literalExpectation("AVG", true), - peg$c307 = function() { return 'AVG'; }, - peg$c308 = ",", - peg$c309 = peg$literalExpectation(",", false), - peg$c310 = "[", - peg$c311 = peg$literalExpectation("[", false), - peg$c312 = "]", - peg$c313 = peg$literalExpectation("]", false), - peg$c314 = /^[ \t\n\r]/, - peg$c315 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false), - peg$c316 = function() { varList = []; return true; }, - peg$c317 = function(s) { + peg$c169 = function(int_, frac, exp) { return parseFloat(int_ + frac + exp); }, + peg$c170 = function(int_, frac) { return parseFloat(int_ + frac); }, + peg$c171 = function(int_, exp) { return parseFloat(int_ + exp); }, + peg$c172 = function(int_) { return parseFloat(int_); }, + peg$c173 = function(digit19, digits) { return digit19 + digits; }, + peg$c174 = function(op, digit19, digits) { return "-" + digit19 + digits; }, + peg$c175 = function(op, digit) { return "-" + digit; }, + peg$c176 = ".", + peg$c177 = peg$literalExpectation(".", false), + peg$c178 = function(digits) { return "." + digits; }, + peg$c179 = function(e, digits) { return e + digits; }, + peg$c180 = function(digits) { return digits.join(""); }, + peg$c181 = /^[0-9]/, + peg$c182 = peg$classExpectation([["0", "9"]], false, false), + peg$c183 = /^[1-9]/, + peg$c184 = peg$classExpectation([["1", "9"]], false, false), + peg$c185 = /^[0-9a-fA-F]/, + peg$c186 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false), + peg$c187 = /^[eE]/, + peg$c188 = peg$classExpectation(["e", "E"], false, false), + peg$c189 = /^[+\-]/, + peg$c190 = peg$classExpectation(["+", "-"], false, false), + peg$c191 = function(e, sign) { return e + (sign || ''); }, + peg$c192 = "null", + peg$c193 = peg$literalExpectation("NULL", true), + peg$c194 = "true", + peg$c195 = peg$literalExpectation("TRUE", true), + peg$c196 = "false", + peg$c197 = peg$literalExpectation("FALSE", true), + peg$c198 = "show", + peg$c199 = peg$literalExpectation("SHOW", true), + peg$c200 = "drop", + peg$c201 = peg$literalExpectation("DROP", true), + peg$c202 = "select", + peg$c203 = peg$literalExpectation("SELECT", true), + peg$c204 = "update", + peg$c205 = peg$literalExpectation("UPDATE", true), + peg$c206 = "create", + peg$c207 = peg$literalExpectation("CREATE", true), + peg$c208 = "delete", + peg$c209 = peg$literalExpectation("DELETE", true), + peg$c210 = "insert", + peg$c211 = peg$literalExpectation("INSERT", true), + peg$c212 = "replace", + peg$c213 = peg$literalExpectation("REPLACE", true), + peg$c214 = "explain", + peg$c215 = peg$literalExpectation("EXPLAIN", true), + peg$c216 = "into", + peg$c217 = peg$literalExpectation("INTO", true), + peg$c218 = "from", + peg$c219 = peg$literalExpectation("FROM", true), + peg$c220 = "set", + peg$c221 = peg$literalExpectation("SET", true), + peg$c222 = "as", + peg$c223 = peg$literalExpectation("AS", true), + peg$c224 = "table", + peg$c225 = peg$literalExpectation("TABLE", true), + peg$c226 = "on", + peg$c227 = peg$literalExpectation("ON", true), + peg$c228 = "left", + peg$c229 = peg$literalExpectation("LEFT", true), + peg$c230 = "inner", + peg$c231 = peg$literalExpectation("INNER", true), + peg$c232 = "join", + peg$c233 = peg$literalExpectation("JOIN", true), + peg$c234 = "union", + peg$c235 = peg$literalExpectation("UNION", true), + peg$c236 = "values", + peg$c237 = peg$literalExpectation("VALUES", true), + peg$c238 = "exists", + peg$c239 = peg$literalExpectation("EXISTS", true), + peg$c240 = "where", + peg$c241 = peg$literalExpectation("WHERE", true), + peg$c242 = "group", + peg$c243 = peg$literalExpectation("GROUP", true), + peg$c244 = "by", + peg$c245 = peg$literalExpectation("BY", true), + peg$c246 = "order", + peg$c247 = peg$literalExpectation("ORDER", true), + peg$c248 = "having", + peg$c249 = peg$literalExpectation("HAVING", true), + peg$c250 = "limit", + peg$c251 = peg$literalExpectation("LIMIT", true), + peg$c252 = "asc", + peg$c253 = peg$literalExpectation("ASC", true), + peg$c254 = function() { return 'ASC'; }, + peg$c255 = "desc", + peg$c256 = peg$literalExpectation("DESC", true), + peg$c257 = function() { return 'DESC'; }, + peg$c258 = "all", + peg$c259 = peg$literalExpectation("ALL", true), + peg$c260 = function() { return 'ALL'; }, + peg$c261 = "distinct", + peg$c262 = peg$literalExpectation("DISTINCT", true), + peg$c263 = function() { return 'DISTINCT'; }, + peg$c264 = "duplicate", + peg$c265 = peg$literalExpectation("DUPLICATE", true), + peg$c266 = function() { return 'DUPLICATE';}, + peg$c267 = "between", + peg$c268 = peg$literalExpectation("BETWEEN", true), + peg$c269 = function() { return 'BETWEEN'; }, + peg$c270 = "in", + peg$c271 = peg$literalExpectation("IN", true), + peg$c272 = function() { return 'IN'; }, + peg$c273 = "is", + peg$c274 = peg$literalExpectation("IS", true), + peg$c275 = function() { return 'IS'; }, + peg$c276 = "like", + peg$c277 = peg$literalExpectation("LIKE", true), + peg$c278 = function() { return 'LIKE'; }, + peg$c279 = "contains", + peg$c280 = peg$literalExpectation("CONTAINS", true), + peg$c281 = function() { return 'CONTAINS'; }, + peg$c282 = "key", + peg$c283 = peg$literalExpectation("KEY", true), + peg$c284 = function() { return 'KEY'; }, + peg$c285 = "not", + peg$c286 = peg$literalExpectation("NOT", true), + peg$c287 = function() { return 'NOT'; }, + peg$c288 = "and", + peg$c289 = peg$literalExpectation("AND", true), + peg$c290 = function() { return 'AND'; }, + peg$c291 = "or", + peg$c292 = peg$literalExpectation("OR", true), + peg$c293 = function() { return 'OR'; }, + peg$c294 = "count", + peg$c295 = peg$literalExpectation("COUNT", true), + peg$c296 = function() { return 'COUNT'; }, + peg$c297 = "max", + peg$c298 = peg$literalExpectation("MAX", true), + peg$c299 = function() { return 'MAX'; }, + peg$c300 = "min", + peg$c301 = peg$literalExpectation("MIN", true), + peg$c302 = function() { return 'MIN'; }, + peg$c303 = "sum", + peg$c304 = peg$literalExpectation("SUM", true), + peg$c305 = function() { return 'SUM'; }, + peg$c306 = "avg", + peg$c307 = peg$literalExpectation("AVG", true), + peg$c308 = function() { return 'AVG'; }, + peg$c309 = ",", + peg$c310 = peg$literalExpectation(",", false), + peg$c311 = "[", + peg$c312 = peg$literalExpectation("[", false), + peg$c313 = "]", + peg$c314 = peg$literalExpectation("]", false), + peg$c315 = /^[ \t\n\r]/, + peg$c316 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false), + peg$c317 = function() { varList = []; return true; }, + peg$c318 = function(s) { return { stmt : s, vars: varList } }, - peg$c318 = function(va, e) { + peg$c319 = function(va, e) { return { type : 'assign', left : va, right: e } }, - peg$c319 = function(e) { + peg$c320 = function(e) { return { type : 'return', expr: e } }, - peg$c320 = function(lt, op, rt, expr) { + peg$c321 = function(lt, op, rt, expr) { return { type : 'join', ltable : lt, @@ -876,7 +886,7 @@ function peg$parse(input, options) { on : expr } }, - peg$c321 = function(name, l) { + peg$c322 = function(name, l) { //compatible with original func_call return { type : 'function', @@ -887,13 +897,13 @@ function peg$parse(input, options) { } } }, - peg$c322 = function(l) { + peg$c323 = function(l) { return { type : 'array', value : l } }, - peg$c323 = function(name, m) { + peg$c324 = function(name, m) { //push for analysis varList.push(name); return { @@ -902,19 +912,19 @@ function peg$parse(input, options) { members : m } }, - peg$c324 = function(l) { + peg$c325 = function(l) { var s = []; for (var i = 0; i < l.length; i++) { s.push(l[i][1]); } return s; }, - peg$c325 = "$", - peg$c326 = peg$literalExpectation("$", false), - peg$c327 = "return", - peg$c328 = peg$literalExpectation("return", true), - peg$c329 = ":=", - peg$c330 = peg$literalExpectation(":=", false), + peg$c326 = "$", + peg$c327 = peg$literalExpectation("$", false), + peg$c328 = "return", + peg$c329 = peg$literalExpectation("return", true), + peg$c330 = ":=", + peg$c331 = peg$literalExpectation(":=", false), peg$currPos = 0, peg$savedPos = 0, @@ -2913,6 +2923,86 @@ function peg$parse(input, options) { peg$currPos = s0; s0 = peg$FAILED; } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseKW_UPDATE(); + if (s1 !== peg$FAILED) { + s2 = peg$parse__(); + if (s2 !== peg$FAILED) { + s3 = peg$parsetable_name(); + if (s3 !== peg$FAILED) { + s4 = peg$parse__(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parsetable_ref(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsetable_ref(); + } + if (s5 !== peg$FAILED) { + s6 = peg$parse__(); + if (s6 !== peg$FAILED) { + s7 = peg$parseKW_SET(); + if (s7 !== peg$FAILED) { + s8 = peg$parse__(); + if (s8 !== peg$FAILED) { + s9 = peg$parseset_list(); + if (s9 !== peg$FAILED) { + s10 = peg$parse__(); + if (s10 !== peg$FAILED) { + s11 = peg$parsewhere_clause(); + if (s11 === peg$FAILED) { + s11 = null; + } + if (s11 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c42(s3, s5, s9, s11); + 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; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } } return s0; @@ -3007,11 +3097,11 @@ function peg$parse(input, options) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c42; + s3 = peg$c43; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s3 !== peg$FAILED) { s4 = peg$parse__(); @@ -3019,7 +3109,7 @@ function peg$parse(input, options) { s5 = peg$parseadditive_expr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c44(s1, s5); + s1 = peg$c45(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -3056,11 +3146,11 @@ function peg$parse(input, options) { s6 = peg$parse__(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s7 = peg$c42; + s7 = peg$c43; peg$currPos++; } else { s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s7 !== peg$FAILED) { s8 = peg$parse__(); @@ -3068,7 +3158,7 @@ function peg$parse(input, options) { s9 = peg$parseadditive_expr(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c45(s1, s5, s9); + s1 = peg$c46(s1, s5, s9); s0 = s1; } else { peg$currPos = s0; @@ -3142,7 +3232,7 @@ function peg$parse(input, options) { s13 = peg$parsevalue_clause(); if (s13 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c46(s1, s5, s9, s11, s13); + s1 = peg$c47(s1, s5, s9, s11, s13); s0 = s1; } else { peg$currPos = s0; @@ -3232,7 +3322,7 @@ function peg$parse(input, options) { } if (s15 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c47(s1, s5, s9, s13, s15); + s1 = peg$c48(s1, s5, s9, s13, s15); s0 = s1; } else { peg$currPos = s0; @@ -3315,7 +3405,7 @@ function peg$parse(input, options) { s9 = peg$parsevalue_clause(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c48(s1, s5, s7, s9); + s1 = peg$c49(s1, s5, s7, s9); s0 = s1; } else { peg$currPos = s0; @@ -3381,7 +3471,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c49(s1, s5, s9, s11); + s1 = peg$c50(s1, s5, s9, s11); s0 = s1; } else { peg$currPos = s0; @@ -3450,7 +3540,7 @@ function peg$parse(input, options) { s6 = peg$parseRPAREN(); if (s6 === peg$FAILED) { peg$savedPos = peg$currPos; - s6 = peg$c50(s4); + s6 = peg$c51(s4); if (s6) { s6 = peg$FAILED; } else { @@ -3459,7 +3549,7 @@ function peg$parse(input, options) { } if (s6 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$c51(s4); + s4 = peg$c52(s4); s3 = s4; } else { peg$currPos = s3; @@ -3499,7 +3589,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_INSERT(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c52(); + s1 = peg$c53(); } s0 = s1; if (s0 === peg$FAILED) { @@ -3507,7 +3597,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_REPLACE(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c53(); + s1 = peg$c54(); } s0 = s1; } @@ -3567,7 +3657,7 @@ function peg$parse(input, options) { s9 = peg$parseset_list(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c54(s9); + s1 = peg$c55(s9); s0 = s1; } else { peg$currPos = s0; @@ -3704,7 +3794,7 @@ function peg$parse(input, options) { s5 = peg$parseRPAREN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c55(s3); + s1 = peg$c56(s3); s0 = s1; } else { peg$currPos = s0; @@ -3796,7 +3886,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c56(s1, s2); + s1 = peg$c57(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -3816,10 +3906,10 @@ function peg$parse(input, options) { s0 = peg$parseexpr_list(); if (s0 === peg$FAILED) { s0 = peg$currPos; - s1 = peg$c57; + s1 = peg$c58; if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c58(); + s1 = peg$c59(); } s0 = s1; } @@ -3893,7 +3983,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -3973,7 +4063,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -3995,21 +4085,21 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { - s2 = peg$c60; + s2 = peg$c61; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c62); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 61) { - s4 = peg$c42; + s4 = peg$c43; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } peg$silentFails--; if (s4 === peg$FAILED) { @@ -4036,7 +4126,7 @@ function peg$parse(input, options) { s3 = peg$parsenot_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c62(s3); + s1 = peg$c63(s3); s0 = s1; } else { peg$currPos = s0; @@ -4071,7 +4161,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c63(s1, s3); + s1 = peg$c64(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4180,7 +4270,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c64(s1); + s1 = peg$c65(s1); } s0 = s1; @@ -4190,60 +4280,60 @@ function peg$parse(input, options) { function peg$parsearithmetic_comparison_operator() { var s0; - if (input.substr(peg$currPos, 2) === peg$c65) { - s0 = peg$c65; + if (input.substr(peg$currPos, 2) === peg$c66) { + s0 = peg$c66; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { - s0 = peg$c67; + s0 = peg$c68; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c69) { - s0 = peg$c69; + if (input.substr(peg$currPos, 2) === peg$c70) { + s0 = peg$c70; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$c71); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c71) { - s0 = peg$c71; + if (input.substr(peg$currPos, 2) === peg$c72) { + s0 = peg$c72; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { - s0 = peg$c73; + s0 = peg$c74; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } + if (peg$silentFails === 0) { peg$fail(peg$c75); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s0 = peg$c42; + s0 = peg$c43; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c75) { - s0 = peg$c75; + if (input.substr(peg$currPos, 2) === peg$c76) { + s0 = peg$c76; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c77); } } } } @@ -4266,7 +4356,7 @@ function peg$parse(input, options) { s3 = peg$parseadditive_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c77(s1, s3); + s1 = peg$c78(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4303,7 +4393,7 @@ function peg$parse(input, options) { s7 = peg$parseadditive_expr(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c78(s1, s3, s7); + s1 = peg$c79(s1, s3, s7); s0 = s1; } else { peg$currPos = s0; @@ -4364,7 +4454,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(s1); + s1 = peg$c80(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4401,7 +4491,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(s1); + s1 = peg$c80(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4438,7 +4528,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(s1); + s1 = peg$c80(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -4459,7 +4549,7 @@ function peg$parse(input, options) { s3 = peg$parsecomparison_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c80(s1, s3); + s1 = peg$c81(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4496,7 +4586,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c81(s1, s5); + s1 = peg$c82(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -4535,7 +4625,7 @@ function peg$parse(input, options) { s3 = peg$parseselect_stmt(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c82(s1, s3); + s1 = peg$c83(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4558,7 +4648,7 @@ function peg$parse(input, options) { s3 = peg$parsevar_decl(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c83(s1, s3); + s1 = peg$c84(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4597,7 +4687,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c84(s1, s5); + s1 = peg$c85(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -4636,7 +4726,7 @@ function peg$parse(input, options) { s3 = peg$parsevar_decl(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c83(s1, s3); + s1 = peg$c84(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -4721,7 +4811,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -4739,19 +4829,19 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c85; + s0 = peg$c86; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c87; + s0 = peg$c88; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } } @@ -4824,7 +4914,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c89(s1, s2); + s1 = peg$c90(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -4842,27 +4932,27 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 42) { - s0 = peg$c90; + s0 = peg$c91; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s0 = peg$c92; + s0 = peg$c93; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { - s0 = peg$c94; + s0 = peg$c95; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } } } @@ -4895,7 +4985,7 @@ function peg$parse(input, options) { s5 = peg$parseRPAREN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c96(s3); + s1 = peg$c97(s3); s0 = s1; } else { peg$currPos = s0; @@ -4944,7 +5034,7 @@ function peg$parse(input, options) { s5 = peg$parsecolumn(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c97(s1, s5); + s1 = peg$c98(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -4971,7 +5061,7 @@ function peg$parse(input, options) { s1 = peg$parsecolumn(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c98(s1); + s1 = peg$c99(s1); } s0 = s1; } @@ -5066,7 +5156,7 @@ function peg$parse(input, options) { s1 = peg$parseident_name(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; - s2 = peg$c99(s1); + s2 = peg$c100(s1); if (s2) { s2 = peg$FAILED; } else { @@ -5074,7 +5164,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c100(s1); + s1 = peg$c101(s1); s0 = s1; } else { peg$currPos = s0; @@ -5087,30 +5177,30 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 96) { - s1 = peg$c101; + s1 = peg$c102; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } } } else { @@ -5118,15 +5208,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 96) { - s3 = peg$c101; + s3 = peg$c102; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c105(s2); + s1 = peg$c106(s2); s0 = s1; } else { peg$currPos = s0; @@ -5152,7 +5242,7 @@ function peg$parse(input, options) { s1 = peg$parsecolumn_name(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; - s2 = peg$c99(s1); + s2 = peg$c100(s1); if (s2) { s2 = peg$FAILED; } else { @@ -5160,7 +5250,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c100(s1); + s1 = peg$c101(s1); s0 = s1; } else { peg$currPos = s0; @@ -5173,30 +5263,30 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 96) { - s1 = peg$c101; + s1 = peg$c102; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c103.test(input.charAt(peg$currPos))) { + if (peg$c104.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } } } else { @@ -5204,15 +5294,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 96) { - s3 = peg$c101; + s3 = peg$c102; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c105(s2); + s1 = peg$c106(s2); s0 = s1; } else { peg$currPos = s0; @@ -5245,7 +5335,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c106(s1, s2); + s1 = peg$c107(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5273,7 +5363,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c106(s1, s2); + s1 = peg$c107(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5290,12 +5380,12 @@ function peg$parse(input, options) { function peg$parseident_start() { var s0; - if (peg$c107.test(input.charAt(peg$currPos))) { + if (peg$c108.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } return s0; @@ -5304,12 +5394,12 @@ function peg$parse(input, options) { function peg$parseident_part() { var s0; - if (peg$c109.test(input.charAt(peg$currPos))) { + if (peg$c110.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c110); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } return s0; @@ -5318,12 +5408,12 @@ function peg$parse(input, options) { function peg$parsecolumn_part() { var s0; - if (peg$c111.test(input.charAt(peg$currPos))) { + if (peg$c112.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c112); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } return s0; @@ -5335,11 +5425,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c113; + s2 = peg$c114; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c114); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } if (s2 !== peg$FAILED) { s3 = peg$parseident_name(); @@ -5356,7 +5446,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c115(s1); + s1 = peg$c116(s1); } s0 = s1; @@ -5393,7 +5483,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c116(s1, s5); + s1 = peg$c117(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -5463,7 +5553,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c117(s1, s5); + s1 = peg$c118(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -5504,7 +5594,7 @@ function peg$parse(input, options) { s1 = peg$parsestar_expr(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c118(s1); + s1 = peg$c119(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -5519,7 +5609,7 @@ function peg$parse(input, options) { s3 = peg$parsecolumn_ref(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c119(s1, s3); + s1 = peg$c120(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -5543,15 +5633,15 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { - s1 = peg$c90; + s1 = peg$c91; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c120(); + s1 = peg$c121(); } s0 = s1; @@ -5577,7 +5667,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c121(s1, s5); + s1 = peg$c122(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -5694,7 +5784,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c122(s1, s2); + s1 = peg$c123(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5715,7 +5805,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_NULL(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c123(); + s1 = peg$c124(); } s0 = s1; @@ -5729,7 +5819,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_TRUE(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c125(); } s0 = s1; if (s0 === peg$FAILED) { @@ -5737,7 +5827,7 @@ function peg$parse(input, options) { s1 = peg$parseKW_FALSE(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c125(); + s1 = peg$c126(); } s0 = s1; } @@ -5751,11 +5841,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c126; + s2 = peg$c127; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s2 !== peg$FAILED) { s3 = []; @@ -5766,11 +5856,11 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s4 = peg$c126; + s4 = peg$c127; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s4 !== peg$FAILED) { s2 = [s2, s3, s4]; @@ -5790,11 +5880,11 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { - s2 = peg$c128; + s2 = peg$c129; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c129); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s2 !== peg$FAILED) { s3 = []; @@ -5805,11 +5895,11 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s4 = peg$c128; + s4 = peg$c129; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c129); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s4 !== peg$FAILED) { s2 = [s2, s3, s4]; @@ -5829,7 +5919,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c130(s1); + s1 = peg$c131(s1); } s0 = s1; @@ -5839,12 +5929,12 @@ function peg$parse(input, options) { function peg$parsesingle_char() { var s0; - if (peg$c131.test(input.charAt(peg$currPos))) { + if (peg$c132.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } + if (peg$silentFails === 0) { peg$fail(peg$c133); } } if (s0 === peg$FAILED) { s0 = peg$parseescape_char(); @@ -5856,12 +5946,12 @@ function peg$parse(input, options) { function peg$parsedouble_char() { var s0; - if (peg$c133.test(input.charAt(peg$currPos))) { + if (peg$c134.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$c135); } } if (s0 === peg$FAILED) { s0 = peg$parseescape_char(); @@ -5874,138 +5964,138 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c135) { - s1 = peg$c135; + if (input.substr(peg$currPos, 2) === peg$c136) { + s1 = peg$c136; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c136); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c137(); + s1 = peg$c138(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c138) { - s1 = peg$c138; + if (input.substr(peg$currPos, 2) === peg$c139) { + s1 = peg$c139; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c139); } + if (peg$silentFails === 0) { peg$fail(peg$c140); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c140(); + s1 = peg$c141(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c141) { - s1 = peg$c141; + if (input.substr(peg$currPos, 2) === peg$c142) { + s1 = peg$c142; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c142); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c143(); + s1 = peg$c144(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c144) { - s1 = peg$c144; + if (input.substr(peg$currPos, 2) === peg$c145) { + s1 = peg$c145; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c146); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c146(); + s1 = peg$c147(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c147) { - s1 = peg$c147; + if (input.substr(peg$currPos, 2) === peg$c148) { + s1 = peg$c148; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c148); } + if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c149(); + s1 = peg$c150(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c150) { - s1 = peg$c150; + if (input.substr(peg$currPos, 2) === peg$c151) { + s1 = peg$c151; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c151); } + if (peg$silentFails === 0) { peg$fail(peg$c152); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c152(); + s1 = peg$c153(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c153) { - s1 = peg$c153; + if (input.substr(peg$currPos, 2) === peg$c154) { + s1 = peg$c154; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c154); } + if (peg$silentFails === 0) { peg$fail(peg$c155); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c155(); + s1 = peg$c156(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c156) { - s1 = peg$c156; + if (input.substr(peg$currPos, 2) === peg$c157) { + s1 = peg$c157; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$c158); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c158(); + s1 = peg$c159(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c159) { - s1 = peg$c159; + if (input.substr(peg$currPos, 2) === peg$c160) { + s1 = peg$c160; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c160); } + if (peg$silentFails === 0) { peg$fail(peg$c161); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c161(); + s1 = peg$c162(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c162) { - s1 = peg$c162; + if (input.substr(peg$currPos, 2) === peg$c163) { + s1 = peg$c163; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c163); } + if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { s2 = peg$parsehexDigit(); @@ -6017,7 +6107,7 @@ function peg$parse(input, options) { s5 = peg$parsehexDigit(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c164(s2, s3, s4, s5); + s1 = peg$c165(s2, s3, s4, s5); s0 = s1; } else { peg$currPos = s0; @@ -6055,12 +6145,12 @@ function peg$parse(input, options) { function peg$parseline_terminator() { var s0; - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$c166.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$c167); } } return s0; @@ -6073,7 +6163,7 @@ function peg$parse(input, options) { s1 = peg$parsenumber(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c167(s1); + s1 = peg$c168(s1); } s0 = s1; @@ -6093,7 +6183,7 @@ function peg$parse(input, options) { s4 = peg$parse__(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c168(s1, s2, s3); + s1 = peg$c169(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -6120,7 +6210,7 @@ function peg$parse(input, options) { s3 = peg$parse__(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c169(s1, s2); + s1 = peg$c170(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6143,7 +6233,7 @@ function peg$parse(input, options) { s3 = peg$parse__(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c170(s1, s2); + s1 = peg$c171(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6164,7 +6254,7 @@ function peg$parse(input, options) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c171(s1); + s1 = peg$c172(s1); s0 = s1; } else { peg$currPos = s0; @@ -6190,7 +6280,7 @@ function peg$parse(input, options) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c172(s1, s2); + s1 = peg$c173(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6205,19 +6295,19 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { - s1 = peg$c87; + s1 = peg$c88; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s1 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { - s1 = peg$c85; + s1 = peg$c86; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } } if (s1 !== peg$FAILED) { @@ -6226,7 +6316,7 @@ function peg$parse(input, options) { s3 = peg$parsedigits(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c173(s1, s2, s3); + s1 = peg$c174(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -6243,26 +6333,26 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { - s1 = peg$c87; + s1 = peg$c88; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s1 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { - s1 = peg$c85; + s1 = peg$c86; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } } if (s1 !== peg$FAILED) { s2 = peg$parsedigit(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c174(s1, s2); + s1 = peg$c175(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6284,17 +6374,17 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s1 = peg$c175; + s1 = peg$c176; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c177(s2); + s1 = peg$c178(s2); s0 = s1; } else { peg$currPos = s0; @@ -6317,7 +6407,7 @@ function peg$parse(input, options) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c178(s1, s2); + s1 = peg$c179(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6347,7 +6437,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c179(s1); + s1 = peg$c180(s1); } s0 = s1; @@ -6357,12 +6447,12 @@ function peg$parse(input, options) { function peg$parsedigit() { var s0; - if (peg$c180.test(input.charAt(peg$currPos))) { + if (peg$c181.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$c182); } } return s0; @@ -6371,12 +6461,12 @@ function peg$parse(input, options) { function peg$parsedigit19() { var s0; - if (peg$c182.test(input.charAt(peg$currPos))) { + if (peg$c183.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c183); } + if (peg$silentFails === 0) { peg$fail(peg$c184); } } return s0; @@ -6385,12 +6475,12 @@ function peg$parse(input, options) { function peg$parsehexDigit() { var s0; - if (peg$c184.test(input.charAt(peg$currPos))) { + if (peg$c185.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c185); } + if (peg$silentFails === 0) { peg$fail(peg$c186); } } return s0; @@ -6400,27 +6490,27 @@ function peg$parse(input, options) { var s0, s1, s2; s0 = peg$currPos; - if (peg$c186.test(input.charAt(peg$currPos))) { + if (peg$c187.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c187); } + if (peg$silentFails === 0) { peg$fail(peg$c188); } } if (s1 !== peg$FAILED) { - if (peg$c188.test(input.charAt(peg$currPos))) { + if (peg$c189.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c189); } + if (peg$silentFails === 0) { peg$fail(peg$c190); } } if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c190(s1, s2); + s1 = peg$c191(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -6438,12 +6528,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c191) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c192) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c192); } + if (peg$silentFails === 0) { peg$fail(peg$c193); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6475,12 +6565,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c193) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c194) { 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$c195); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6512,12 +6602,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c195) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c196) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c196); } + if (peg$silentFails === 0) { peg$fail(peg$c197); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6549,12 +6639,12 @@ 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$c198) { 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$c199); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6586,12 +6676,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c199) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c200) { 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$c201); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6623,12 +6713,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c201) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c202) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c202); } + if (peg$silentFails === 0) { peg$fail(peg$c203); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6660,12 +6750,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c203) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c204) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c204); } + if (peg$silentFails === 0) { peg$fail(peg$c205); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6697,12 +6787,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c205) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c206) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c206); } + if (peg$silentFails === 0) { peg$fail(peg$c207); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6734,12 +6824,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c207) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c208) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c208); } + if (peg$silentFails === 0) { peg$fail(peg$c209); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6771,12 +6861,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c209) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c210) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c210); } + if (peg$silentFails === 0) { peg$fail(peg$c211); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6808,12 +6898,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c211) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c212) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c212); } + if (peg$silentFails === 0) { peg$fail(peg$c213); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6845,12 +6935,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c213) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c214) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c214); } + if (peg$silentFails === 0) { peg$fail(peg$c215); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6882,12 +6972,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c215) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c216) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c216); } + if (peg$silentFails === 0) { peg$fail(peg$c217); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6919,12 +7009,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c217) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c218) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c218); } + if (peg$silentFails === 0) { peg$fail(peg$c219); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6956,12 +7046,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c219) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c220) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c220); } + if (peg$silentFails === 0) { peg$fail(peg$c221); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -6993,12 +7083,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c221) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c222) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c222); } + if (peg$silentFails === 0) { peg$fail(peg$c223); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7030,12 +7120,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c223) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c224) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c224); } + if (peg$silentFails === 0) { peg$fail(peg$c225); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7067,12 +7157,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c225) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c226) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c226); } + if (peg$silentFails === 0) { peg$fail(peg$c227); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7104,12 +7194,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c227) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c228) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c228); } + if (peg$silentFails === 0) { peg$fail(peg$c229); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7141,12 +7231,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c229) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c230) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c230); } + if (peg$silentFails === 0) { peg$fail(peg$c231); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7178,12 +7268,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c231) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c232) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c232); } + if (peg$silentFails === 0) { peg$fail(peg$c233); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7215,12 +7305,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c233) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c234) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c234); } + if (peg$silentFails === 0) { peg$fail(peg$c235); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7252,12 +7342,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c235) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c236) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c236); } + if (peg$silentFails === 0) { peg$fail(peg$c237); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7289,12 +7379,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c237) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c238) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c238); } + if (peg$silentFails === 0) { peg$fail(peg$c239); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7326,12 +7416,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c239) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c240) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c240); } + if (peg$silentFails === 0) { peg$fail(peg$c241); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7363,12 +7453,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c241) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c242) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c242); } + if (peg$silentFails === 0) { peg$fail(peg$c243); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7400,12 +7490,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c243) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c244) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c244); } + if (peg$silentFails === 0) { peg$fail(peg$c245); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7437,12 +7527,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c245) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c246) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c246); } + if (peg$silentFails === 0) { peg$fail(peg$c247); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7474,12 +7564,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c247) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c248) { s1 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c248); } + if (peg$silentFails === 0) { peg$fail(peg$c249); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7511,12 +7601,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c249) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c250) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c250); } + if (peg$silentFails === 0) { peg$fail(peg$c251); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7548,12 +7638,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c251) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c252) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c252); } + if (peg$silentFails === 0) { peg$fail(peg$c253); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7568,7 +7658,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c253(); + s1 = peg$c254(); s0 = s1; } else { peg$currPos = s0; @@ -7586,12 +7676,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c254) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c255) { 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$c256); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7606,7 +7696,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c256(); + s1 = peg$c257(); s0 = s1; } else { peg$currPos = s0; @@ -7624,12 +7714,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c257) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c258) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c258); } + if (peg$silentFails === 0) { peg$fail(peg$c259); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7644,7 +7734,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c259(); + s1 = peg$c260(); s0 = s1; } else { peg$currPos = s0; @@ -7662,12 +7752,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c260) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c261) { s1 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c261); } + if (peg$silentFails === 0) { peg$fail(peg$c262); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7682,7 +7772,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c262(); + s1 = peg$c263(); s0 = s1; } else { peg$currPos = s0; @@ -7700,12 +7790,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c263) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c264) { s1 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c264); } + if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7720,7 +7810,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c265(); + s1 = peg$c266(); s0 = s1; } else { peg$currPos = s0; @@ -7738,12 +7828,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c266) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c267) { s1 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c267); } + if (peg$silentFails === 0) { peg$fail(peg$c268); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7758,7 +7848,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c268(); + s1 = peg$c269(); s0 = s1; } else { peg$currPos = s0; @@ -7776,12 +7866,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c269) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c270) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c270); } + if (peg$silentFails === 0) { peg$fail(peg$c271); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7796,7 +7886,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c271(); + s1 = peg$c272(); s0 = s1; } else { peg$currPos = s0; @@ -7814,12 +7904,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c272) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c273) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c273); } + if (peg$silentFails === 0) { peg$fail(peg$c274); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7834,7 +7924,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c274(); + s1 = peg$c275(); s0 = s1; } else { peg$currPos = s0; @@ -7852,12 +7942,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c275) { + if (input.substr(peg$currPos, 4).toLowerCase() === peg$c276) { s1 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c276); } + if (peg$silentFails === 0) { peg$fail(peg$c277); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7872,7 +7962,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c277(); + s1 = peg$c278(); s0 = s1; } else { peg$currPos = s0; @@ -7890,12 +7980,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c278) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c279) { s1 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c279); } + if (peg$silentFails === 0) { peg$fail(peg$c280); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7910,7 +8000,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c280(); + s1 = peg$c281(); s0 = s1; } else { peg$currPos = s0; @@ -7928,12 +8018,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c281) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c282) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c282); } + if (peg$silentFails === 0) { peg$fail(peg$c283); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7948,7 +8038,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c283(); + s1 = peg$c284(); s0 = s1; } else { peg$currPos = s0; @@ -7966,12 +8056,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c284) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c285) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c285); } + if (peg$silentFails === 0) { peg$fail(peg$c286); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7986,7 +8076,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c286(); + s1 = peg$c287(); s0 = s1; } else { peg$currPos = s0; @@ -8004,12 +8094,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c287) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c288) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c288); } + if (peg$silentFails === 0) { peg$fail(peg$c289); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8024,7 +8114,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c289(); + s1 = peg$c290(); s0 = s1; } else { peg$currPos = s0; @@ -8042,12 +8132,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c290) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c291) { s1 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c291); } + if (peg$silentFails === 0) { peg$fail(peg$c292); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8062,7 +8152,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c292(); + s1 = peg$c293(); s0 = s1; } else { peg$currPos = s0; @@ -8080,12 +8170,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c293) { + if (input.substr(peg$currPos, 5).toLowerCase() === peg$c294) { s1 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c294); } + if (peg$silentFails === 0) { peg$fail(peg$c295); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8100,7 +8190,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c295(); + s1 = peg$c296(); s0 = s1; } else { peg$currPos = s0; @@ -8118,12 +8208,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c296) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c297) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c297); } + if (peg$silentFails === 0) { peg$fail(peg$c298); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8138,7 +8228,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c298(); + s1 = peg$c299(); s0 = s1; } else { peg$currPos = s0; @@ -8156,12 +8246,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c299) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c300) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c300); } + if (peg$silentFails === 0) { peg$fail(peg$c301); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8176,7 +8266,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c301(); + s1 = peg$c302(); s0 = s1; } else { peg$currPos = s0; @@ -8194,12 +8284,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c302) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c303) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c303); } + if (peg$silentFails === 0) { peg$fail(peg$c304); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8214,7 +8304,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c304(); + s1 = peg$c305(); s0 = s1; } else { peg$currPos = s0; @@ -8232,12 +8322,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c305) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c306) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c306); } + if (peg$silentFails === 0) { peg$fail(peg$c307); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -8252,7 +8342,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c307(); + s1 = peg$c308(); s0 = s1; } else { peg$currPos = s0; @@ -8270,11 +8360,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c175; + s0 = peg$c176; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } return s0; @@ -8284,11 +8374,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 44) { - s0 = peg$c308; + s0 = peg$c309; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c309); } + if (peg$silentFails === 0) { peg$fail(peg$c310); } } return s0; @@ -8298,11 +8388,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 42) { - s0 = peg$c90; + s0 = peg$c91; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } return s0; @@ -8340,11 +8430,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 91) { - s0 = peg$c310; + s0 = peg$c311; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c311); } + if (peg$silentFails === 0) { peg$fail(peg$c312); } } return s0; @@ -8354,11 +8444,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 93) { - s0 = peg$c312; + s0 = peg$c313; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c313); } + if (peg$silentFails === 0) { peg$fail(peg$c314); } } return s0; @@ -8394,12 +8484,12 @@ function peg$parse(input, options) { function peg$parsewhitespace() { var s0; - if (peg$c314.test(input.charAt(peg$currPos))) { + if (peg$c315.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c315); } + if (peg$silentFails === 0) { peg$fail(peg$c316); } } return s0; @@ -8411,22 +8501,22 @@ function peg$parse(input, options) { s0 = peg$parseEOF(); if (s0 === peg$FAILED) { s0 = []; - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$c166.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c166); } + if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c165.test(input.charAt(peg$currPos))) { + if (peg$c166.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c166); } + if (peg$silentFails === 0) { peg$fail(peg$c167); } } } } else { @@ -8478,7 +8568,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$c316(); + s1 = peg$c317(); if (s1) { s1 = void 0; } else { @@ -8493,7 +8583,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c317(s3); + s1 = peg$c318(s3); s0 = s1; } else { peg$currPos = s0; @@ -8526,7 +8616,7 @@ function peg$parse(input, options) { s5 = peg$parseproc_expr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c318(s1, s5); + s1 = peg$c319(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -8563,7 +8653,7 @@ function peg$parse(input, options) { s3 = peg$parseproc_expr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c319(s3); + s1 = peg$c320(s3); s0 = s1; } else { peg$currPos = s0; @@ -8664,7 +8754,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -8744,7 +8834,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(s1, s2); + s1 = peg$c60(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -8777,7 +8867,7 @@ function peg$parse(input, options) { s7 = peg$parseon_clause(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c320(s1, s3, s5, s7); + s1 = peg$c321(s1, s3, s5, s7); s0 = s1; } else { peg$currPos = s0; @@ -8834,7 +8924,7 @@ function peg$parse(input, options) { s5 = peg$parseRPAREN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c96(s3); + s1 = peg$c97(s3); s0 = s1; } else { peg$currPos = s0; @@ -8883,7 +8973,7 @@ function peg$parse(input, options) { s7 = peg$parseRPAREN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c321(s1, s5); + s1 = peg$c322(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -9012,7 +9102,7 @@ function peg$parse(input, options) { s5 = peg$parseRBRAKE(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c322(s3); + s1 = peg$c323(s3); s0 = s1; } else { peg$currPos = s0; @@ -9049,7 +9139,7 @@ function peg$parse(input, options) { s3 = peg$parsemem_chain(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c323(s2, s3); + s1 = peg$c324(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -9074,11 +9164,11 @@ function peg$parse(input, options) { s1 = []; s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c175; + s3 = peg$c176; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } if (s3 !== peg$FAILED) { s4 = peg$parseident_name(); @@ -9097,11 +9187,11 @@ function peg$parse(input, options) { s1.push(s2); s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c175; + s3 = peg$c176; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c176); } + if (peg$silentFails === 0) { peg$fail(peg$c177); } } if (s3 !== peg$FAILED) { s4 = peg$parseident_name(); @@ -9119,7 +9209,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c324(s1); + s1 = peg$c325(s1); } s0 = s1; @@ -9130,11 +9220,11 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 36) { - s0 = peg$c325; + s0 = peg$c326; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c326); } + if (peg$silentFails === 0) { peg$fail(peg$c327); } } return s0; @@ -9143,12 +9233,12 @@ function peg$parse(input, options) { function peg$parseKW_RETURN() { var s0; - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c327) { + if (input.substr(peg$currPos, 6).toLowerCase() === peg$c328) { s0 = input.substr(peg$currPos, 6); peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c328); } + if (peg$silentFails === 0) { peg$fail(peg$c329); } } return s0; @@ -9157,12 +9247,12 @@ function peg$parse(input, options) { function peg$parseKW_ASSIGN() { var s0; - if (input.substr(peg$currPos, 2) === peg$c329) { - s0 = peg$c329; + if (input.substr(peg$currPos, 2) === peg$c330) { + s0 = peg$c330; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c330); } + if (peg$silentFails === 0) { peg$fail(peg$c331); } } return s0; diff --git a/packages/sql-parser/package.json b/packages/sql-parser/package.json index dc6a26f7..9d089e2e 100644 --- a/packages/sql-parser/package.json +++ b/packages/sql-parser/package.json @@ -5,6 +5,7 @@ "version": "0.2.0", "typings": "index.d.ts", "scripts": { + "test": "jest", "build": "npm run generateParser && npm run generateFromClauseParser", "generateParser": "pegjs -o ./base/parser.js parser.pegjs", "generateFromClauseParser": "pegjs -o ./base/fromClauseParser.js --allowed-start-rules extract_from_clause parser.pegjs" @@ -14,6 +15,7 @@ }, "dependencies": {}, "devDependencies": { + "jest": "^26.0.1", "pegjs": "=0.10.0" }, "readmeFilename": "README.md", diff --git a/packages/sql-parser/parser.pegjs b/packages/sql-parser/parser.pegjs index f9d22dbf..1ff5fd00 100644 --- a/packages/sql-parser/parser.pegjs +++ b/packages/sql-parser/parser.pegjs @@ -405,6 +405,21 @@ update_stmt where : w } } + / KW_UPDATE __ + t:table_name __ + j:table_ref* __ + KW_SET __ + l:set_list __ + w:where_clause? { + return { + type : 'update', + db : '', + table : t, + join : j, + set : l, + where : w + } + } set_list = head:set_item tail:(__ COMMA __ set_item)* { diff --git a/packages/sql-parser/test/update.test.js b/packages/sql-parser/test/update.test.js new file mode 100644 index 00000000..d121e749 --- /dev/null +++ b/packages/sql-parser/test/update.test.js @@ -0,0 +1,24 @@ +const { parse } = require('../index') + +// https://www.mysqltutorial.org/mysql-update-join/ +describe('UPDATE JOIN', () => { + it('should success to parse', () => { + const sql = ` + UPDATE T1 + JOIN T2 + ON T1.t2_id = T2.id + SET T1.name = T2.name + WHERE T1.name = 1 + ` + const result = parse(sql) + expect(result).toBeDefined() + expect(result.join.length).toEqual(1) + expect(result.join[0]).toMatchObject({ + type: 'table', + db: '', + table: 'T2', + as: null, + join: 'INNER JOIN' + }) + }) +}) \ No newline at end of file