diff --git a/dist/browser/filtrex.js b/dist/browser/filtrex.js index df058e3..b393f72 100644 --- a/dist/browser/filtrex.js +++ b/dist/browser/filtrex.js @@ -27,19 +27,20 @@ var filtrex = (function (exports) { "<=": 19, ">": 20, ">=": 21, - "?": 22, - ":": 23, - "(": 24, - ")": 25, - "array": 26, - ",": 27, - "NUMBER": 28, - "STRING": 29, - "SYMBOL": 30, - "of": 31, - "argsList": 32, - "in": 33, - "inSet": 34, + "if": 22, + "then": 23, + "else": 24, + "(": 25, + ")": 26, + "array": 27, + ",": 28, + "NUMBER": 29, + "STRING": 30, + "SYMBOL": 31, + "of": 32, + "argsList": 33, + "in": 34, + "inSet": 35, "$accept": 0, "$end": 1 }, @@ -62,16 +63,17 @@ var filtrex = (function (exports) { 19: "<=", 20: ">", 21: ">=", - 22: "?", - 23: ":", - 24: "(", - 25: ")", - 27: ",", - 28: "NUMBER", - 29: "STRING", - 30: "SYMBOL", - 31: "of", - 33: "in" + 22: "if", + 23: "then", + 24: "else", + 25: "(", + 26: ")", + 28: ",", + 29: "NUMBER", + 30: "STRING", + 31: "SYMBOL", + 32: "of", + 34: "in" }, productions_: [0, [3, 2], [4, 3], @@ -91,7 +93,7 @@ var filtrex = (function (exports) { [4, 3], [4, 3], [4, 3], - [4, 5], + [4, 6], [4, 3], [4, 5], [4, 1], @@ -102,12 +104,12 @@ var filtrex = (function (exports) { [4, 4], [4, 3], [4, 4], - [32, 1], - [32, 3], - [34, 1], - [34, 3], - [26, 1], - [26, 3] + [33, 1], + [33, 3], + [35, 1], + [35, 3], + [27, 1], + [27, 3] ], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { @@ -167,7 +169,7 @@ var filtrex = (function (exports) { this.$ = ["(", "", $$[$0 - 2], " >= ", $$[$0], "", ")"]; break; case 19: - this.$ = ["(", "", $$[$0 - 4], " ? ", $$[$0 - 2], " : ", $$[$0], "", ")"]; + this.$ = ["(", "", "std.coerceBoolean", "(", $$[$0 - 4], ") ? ", $$[$0 - 2], " : ", $$[$0], "", ")"]; break; case 20: this.$ = ["(", "", $$[$0 - 1], "", ")"]; @@ -224,57 +226,69 @@ var filtrex = (function (exports) { 4: 2, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 1: [3] }, { - 5: [1, 9], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 5: [1, 10], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 34: [1, 26] }, { 4: 28, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 29, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 30, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 26: 31, - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] + }, { + 4: 31, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], + 27: 32, + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 22], 6: [2, 22], @@ -293,11 +307,11 @@ var filtrex = (function (exports) { 19: [2, 22], 20: [2, 22], 21: [2, 22], - 22: [2, 22], 23: [2, 22], - 25: [2, 22], - 27: [2, 22], - 33: [2, 22] + 24: [2, 22], + 26: [2, 22], + 28: [2, 22], + 34: [2, 22] }, { 5: [2, 23], 6: [2, 23], @@ -316,11 +330,11 @@ var filtrex = (function (exports) { 19: [2, 23], 20: [2, 23], 21: [2, 23], - 22: [2, 23], 23: [2, 23], - 25: [2, 23], - 27: [2, 23], - 33: [2, 23] + 24: [2, 23], + 26: [2, 23], + 28: [2, 23], + 34: [2, 23] }, { 5: [2, 24], 6: [2, 24], @@ -339,153 +353,161 @@ var filtrex = (function (exports) { 19: [2, 24], 20: [2, 24], 21: [2, 24], - 22: [2, 24], 23: [2, 24], - 24: [1, 33], - 25: [2, 24], - 27: [2, 24], - 31: [1, 32], - 33: [2, 24] + 24: [2, 24], + 25: [1, 34], + 26: [2, 24], + 28: [2, 24], + 32: [1, 33], + 34: [2, 24] }, { 1: [2, 1] - }, { - 4: 34, - 7: [1, 3], - 14: [1, 4], - 24: [1, 5], - 28: [1, 6], - 29: [1, 7], - 30: [1, 8] }, { 4: 35, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 36, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 37, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 38, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 39, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 40, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 41, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 42, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 43, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 44, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 45, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 46, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 47, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 48, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 49, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 50, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 33: [1, 51] + 34: [1, 51] }, { 5: [2, 8], 6: [2, 8], @@ -504,11 +526,11 @@ var filtrex = (function (exports) { 19: [2, 8], 20: [2, 8], 21: [2, 8], - 22: [2, 8], 23: [2, 8], - 25: [2, 8], - 27: [2, 8], - 33: [2, 8] + 24: [2, 8], + 26: [2, 8], + 28: [2, 8], + 34: [2, 8] }, { 5: [2, 11], 6: [2, 11], @@ -527,60 +549,80 @@ var filtrex = (function (exports) { 19: [2, 11], 20: [2, 11], 21: [2, 11], - 22: [2, 11], 23: [2, 11], - 25: [2, 11], - 27: [2, 11], - 33: [2, 11] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 11], + 26: [2, 11], + 28: [2, 11], + 34: [2, 11] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 23: [1, 52], + 34: [1, 26] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [1, 52], - 27: [2, 34], - 33: [1, 26] - }, { - 27: [1, 53] - }, { - 4: 54, + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [1, 53], + 28: [2, 34], + 34: [1, 26] + }, { + 28: [1, 54] + }, { + 4: 55, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 4: 57, + 4: 58, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 25: [1, 55], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 26: [1, 56], 29: [1, 7], 30: [1, 8], - 32: 56 + 31: [1, 9], + 33: 57 }, { 5: [2, 2], 6: [2, 2], 7: [2, 2], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 2], 13: [2, 2], 14: [1, 27], @@ -591,19 +633,19 @@ var filtrex = (function (exports) { 19: [2, 2], 20: [2, 2], 21: [2, 2], - 22: [2, 2], 23: [2, 2], - 25: [2, 2], - 27: [2, 2], - 33: [2, 2] + 24: [2, 2], + 26: [2, 2], + 28: [2, 2], + 34: [2, 2] }, { 5: [2, 3], 6: [2, 3], 7: [2, 3], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 3], 13: [2, 3], 14: [1, 27], @@ -614,11 +656,11 @@ var filtrex = (function (exports) { 19: [2, 3], 20: [2, 3], 21: [2, 3], - 22: [2, 3], 23: [2, 3], - 25: [2, 3], - 27: [2, 3], - 33: [2, 3] + 24: [2, 3], + 26: [2, 3], + 28: [2, 3], + 34: [2, 3] }, { 5: [2, 4], 6: [2, 4], @@ -626,7 +668,7 @@ var filtrex = (function (exports) { 8: [2, 4], 9: [2, 4], 10: [2, 4], - 11: [1, 15], + 11: [1, 16], 12: [2, 4], 13: [2, 4], 14: [1, 27], @@ -637,11 +679,11 @@ var filtrex = (function (exports) { 19: [2, 4], 20: [2, 4], 21: [2, 4], - 22: [2, 4], 23: [2, 4], - 25: [2, 4], - 27: [2, 4], - 33: [2, 4] + 24: [2, 4], + 26: [2, 4], + 28: [2, 4], + 34: [2, 4] }, { 5: [2, 5], 6: [2, 5], @@ -649,7 +691,7 @@ var filtrex = (function (exports) { 8: [2, 5], 9: [2, 5], 10: [2, 5], - 11: [1, 15], + 11: [1, 16], 12: [2, 5], 13: [2, 5], 14: [1, 27], @@ -660,11 +702,11 @@ var filtrex = (function (exports) { 19: [2, 5], 20: [2, 5], 21: [2, 5], - 22: [2, 5], 23: [2, 5], - 25: [2, 5], - 27: [2, 5], - 33: [2, 5] + 24: [2, 5], + 26: [2, 5], + 28: [2, 5], + 34: [2, 5] }, { 5: [2, 6], 6: [2, 6], @@ -672,7 +714,7 @@ var filtrex = (function (exports) { 8: [2, 6], 9: [2, 6], 10: [2, 6], - 11: [1, 15], + 11: [1, 16], 12: [2, 6], 13: [2, 6], 14: [1, 27], @@ -683,11 +725,11 @@ var filtrex = (function (exports) { 19: [2, 6], 20: [2, 6], 21: [2, 6], - 22: [2, 6], 23: [2, 6], - 25: [2, 6], - 27: [2, 6], - 33: [2, 6] + 24: [2, 6], + 26: [2, 6], + 28: [2, 6], + 34: [2, 6] }, { 5: [2, 7], 6: [2, 7], @@ -706,134 +748,134 @@ var filtrex = (function (exports) { 19: [2, 7], 20: [2, 7], 21: [2, 7], - 22: [2, 7], 23: [2, 7], - 25: [2, 7], - 27: [2, 7], - 33: [2, 7] + 24: [2, 7], + 26: [2, 7], + 28: [2, 7], + 34: [2, 7] }, { 5: [2, 9], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 9], 13: [2, 9], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 9], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 9], - 25: [2, 9], - 27: [2, 9], - 33: [1, 26] + 24: [2, 9], + 26: [2, 9], + 28: [2, 9], + 34: [1, 26] }, { 5: [2, 10], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], 13: [2, 10], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 10], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 10], - 25: [2, 10], - 27: [2, 10], - 33: [1, 26] + 24: [2, 10], + 26: [2, 10], + 28: [2, 10], + 34: [1, 26] }, { 5: [2, 12], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 12], 13: [2, 12], 14: [1, 27], 15: [2, 12], 16: [2, 12], 17: [2, 12], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 12], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 12], - 25: [2, 12], - 27: [2, 12], - 33: [2, 12] + 24: [2, 12], + 26: [2, 12], + 28: [2, 12], + 34: [2, 12] }, { 5: [2, 13], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 13], 13: [2, 13], 14: [1, 27], 15: [2, 13], 16: [2, 13], 17: [2, 13], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 13], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 13], - 25: [2, 13], - 27: [2, 13], - 33: [2, 13] + 24: [2, 13], + 26: [2, 13], + 28: [2, 13], + 34: [2, 13] }, { 5: [2, 14], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 14], 13: [2, 14], 14: [1, 27], 15: [2, 14], 16: [2, 14], 17: [2, 14], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 14], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 14], - 25: [2, 14], - 27: [2, 14], - 33: [2, 14] + 24: [2, 14], + 26: [2, 14], + 28: [2, 14], + 34: [2, 14] }, { 5: [2, 15], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 15], 13: [2, 15], 14: [1, 27], @@ -844,19 +886,19 @@ var filtrex = (function (exports) { 19: [2, 15], 20: [2, 15], 21: [2, 15], - 22: [2, 15], 23: [2, 15], - 25: [2, 15], - 27: [2, 15], - 33: [2, 15] + 24: [2, 15], + 26: [2, 15], + 28: [2, 15], + 34: [2, 15] }, { 5: [2, 16], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 16], 13: [2, 16], 14: [1, 27], @@ -867,19 +909,19 @@ var filtrex = (function (exports) { 19: [2, 16], 20: [2, 16], 21: [2, 16], - 22: [2, 16], 23: [2, 16], - 25: [2, 16], - 27: [2, 16], - 33: [2, 16] + 24: [2, 16], + 26: [2, 16], + 28: [2, 16], + 34: [2, 16] }, { 5: [2, 17], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 17], 13: [2, 17], 14: [1, 27], @@ -890,19 +932,19 @@ var filtrex = (function (exports) { 19: [2, 17], 20: [2, 17], 21: [2, 17], - 22: [2, 17], 23: [2, 17], - 25: [2, 17], - 27: [2, 17], - 33: [2, 17] + 24: [2, 17], + 26: [2, 17], + 28: [2, 17], + 34: [2, 17] }, { 5: [2, 18], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 18], 13: [2, 18], 14: [1, 27], @@ -913,62 +955,52 @@ var filtrex = (function (exports) { 19: [2, 18], 20: [2, 18], 21: [2, 18], - 22: [2, 18], 23: [2, 18], - 25: [2, 18], - 27: [2, 18], - 33: [2, 18] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], - 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 23: [1, 58], - 33: [1, 26] + 24: [2, 18], + 26: [2, 18], + 28: [2, 18], + 34: [2, 18] }, { 5: [2, 28], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 28], 13: [2, 28], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 28], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 28], - 25: [2, 28], - 27: [2, 28], - 33: [2, 28] + 24: [2, 28], + 26: [2, 28], + 28: [2, 28], + 34: [2, 28] }, { 4: 59, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] + }, { + 4: 60, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 20], 6: [2, 20], @@ -987,19 +1019,20 @@ var filtrex = (function (exports) { 19: [2, 20], 20: [2, 20], 21: [2, 20], - 22: [2, 20], 23: [2, 20], - 25: [2, 20], - 27: [2, 20], - 33: [2, 20] + 24: [2, 20], + 26: [2, 20], + 28: [2, 20], + 34: [2, 20] }, { - 4: 60, + 4: 61, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 25], 6: [2, 25], @@ -1018,11 +1051,11 @@ var filtrex = (function (exports) { 19: [2, 25], 20: [2, 25], 21: [2, 25], - 22: [2, 25], 23: [2, 25], - 25: [2, 25], - 27: [2, 25], - 33: [2, 25] + 24: [2, 25], + 26: [2, 25], + 28: [2, 25], + 34: [2, 25] }, { 5: [2, 26], 6: [2, 26], @@ -1041,43 +1074,34 @@ var filtrex = (function (exports) { 19: [2, 26], 20: [2, 26], 21: [2, 26], - 22: [2, 26], 23: [2, 26], - 25: [2, 26], - 27: [2, 26], - 33: [2, 26] - }, { - 25: [1, 61], - 27: [1, 62] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 26], + 26: [2, 26], + 28: [2, 26], + 34: [2, 26] + }, { + 26: [1, 62], + 28: [1, 63] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [2, 30], - 27: [2, 30], - 33: [1, 26] - }, { - 4: 63, - 7: [1, 3], - 14: [1, 4], - 24: [1, 5], - 28: [1, 6], - 29: [1, 7], - 30: [1, 8] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [2, 30], + 28: [2, 30], + 34: [1, 26] }, { 5: [2, 29], 6: [2, 29], @@ -1096,32 +1120,50 @@ var filtrex = (function (exports) { 19: [2, 29], 20: [2, 29], 21: [2, 29], - 22: [2, 29], 23: [2, 29], - 25: [2, 29], - 27: [2, 29], - 33: [2, 29] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 29], + 26: [2, 29], + 28: [2, 29], + 34: [2, 29] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 24: [1, 64], + 34: [1, 26] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [1, 64], - 27: [2, 35], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [1, 65], + 28: [2, 35], + 34: [1, 26] }, { 5: [2, 27], 6: [2, 27], @@ -1140,42 +1182,29 @@ var filtrex = (function (exports) { 19: [2, 27], 20: [2, 27], 21: [2, 27], - 22: [2, 27], 23: [2, 27], - 25: [2, 27], - 27: [2, 27], - 33: [2, 27] + 24: [2, 27], + 26: [2, 27], + 28: [2, 27], + 34: [2, 27] }, { - 4: 65, + 4: 66, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 5: [2, 19], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], - 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 19], - 23: [2, 19], - 25: [2, 19], - 27: [2, 19], - 33: [1, 26] + 4: 67, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 21], 6: [2, 21], @@ -1194,35 +1223,57 @@ var filtrex = (function (exports) { 19: [2, 21], 20: [2, 21], 21: [2, 21], - 22: [2, 21], 23: [2, 21], - 25: [2, 21], - 27: [2, 21], - 33: [2, 21] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 21], + 26: [2, 21], + 28: [2, 21], + 34: [2, 21] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [2, 31], + 28: [2, 31], + 34: [1, 26] + }, { + 5: [2, 19], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [2, 31], - 27: [2, 31], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 23: [2, 19], + 24: [2, 19], + 26: [2, 19], + 28: [2, 19], + 34: [1, 26] }], defaultActions: { - 9: [2, 1] + 10: [2, 1] }, parseError: function parseError(str, hash) { throw new Error(str); @@ -1639,40 +1690,42 @@ var filtrex = (function (exports) { case 15: return ">"; case 16: - return "?"; + return "and"; case 17: - return ":"; + return "or"; case 18: - return "and"; + return "not"; case 19: - return "or"; + return "in"; case 20: - return "not"; + return "of"; case 21: - return "in"; + return "if"; case 22: - return "of"; + return "then"; case 23: - break; + return "else"; case 24: - return "NUMBER"; + break; case 25: + return "NUMBER"; + case 26: yy_.yytext = JSON.stringify(yy_.yytext); return "SYMBOL"; - case 26: + case 27: yy_.yytext = yy.buildString("'", yy_.yytext); return "SYMBOL"; - case 27: + case 28: yy_.yytext = yy.buildString('"', yy_.yytext); return "STRING"; - case 28: + case 29: return "EOF"; } }; - lexer.rules = [/^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\%)/, /^(?:\()/, /^(?:\))/, /^(?:\,)/, /^(?:==)/, /^(?:\!=)/, /^(?:\~=)/, /^(?:>=)/, /^(?:<=)/, /^(?:<)/, /^(?:>)/, /^(?:\?)/, /^(?:\:)/, /^(?:and[^\w])/, /^(?:or[^\w])/, /^(?:not[^\w])/, /^(?:in[^\w])/, /^(?:of[^\w])/, /^(?:\s+)/, /^(?:[0-9]+(?:\.[0-9]+)?\b)/, /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/, /^(?:'(?:\\'|\\\\|[^'\\])*')/, /^(?:"(?:\\"|\\\\|[^"\\])*")/, /^(?:$)/]; + lexer.rules = [/^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\%)/, /^(?:\()/, /^(?:\))/, /^(?:\,)/, /^(?:==)/, /^(?:\!=)/, /^(?:\~=)/, /^(?:>=)/, /^(?:<=)/, /^(?:<)/, /^(?:>)/, /^(?:and[^\w])/, /^(?:or[^\w])/, /^(?:not[^\w])/, /^(?:in[^\w])/, /^(?:of[^\w])/, /^(?:if[^\w])/, /^(?:then[^\w])/, /^(?:else[^\w])/, /^(?:\s+)/, /^(?:[0-9]+(?:\.[0-9]+)?\b)/, /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/, /^(?:'(?:\\'|\\\\|[^'\\])*')/, /^(?:"(?:\\"|\\\\|[^"\\])*")/, /^(?:$)/]; lexer.conditions = { "INITIAL": { - "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28], + "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "inclusive": true } }; @@ -1908,12 +1961,18 @@ var filtrex = (function (exports) { // Metaprogramming functions function prop(name, obj) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } function safeGetter(obj) { return function get(name) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } } diff --git a/dist/browser/filtrex.min.js b/dist/browser/filtrex.min.js index 44352fb..2c0f030 100644 --- a/dist/browser/filtrex.min.js +++ b/dist/browser/filtrex.min.js @@ -1 +1 @@ -var filtrex=function(t){"use strict";var e=function(){var t={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"+":6,"-":7,"*":8,"/":9,"%":10,"^":11,and:12,or:13,not:14,"==":15,"!=":16,"~=":17,"<":18,"<=":19,">":20,">=":21,"?":22,":":23,"(":24,")":25,array:26,",":27,NUMBER:28,STRING:29,SYMBOL:30,of:31,argsList:32,in:33,inSet:34,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"+",7:"-",8:"*",9:"/",10:"%",11:"^",12:"and",13:"or",14:"not",15:"==",16:"!=",17:"~=",18:"<",19:"<=",20:">",21:">=",22:"?",23:":",24:"(",25:")",27:",",28:"NUMBER",29:"STRING",30:"SYMBOL",31:"of",33:"in"},productions_:[0,[3,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,3],[4,3],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,5],[4,3],[4,5],[4,1],[4,1],[4,1],[4,3],[4,3],[4,4],[4,3],[4,4],[32,1],[32,3],[34,1],[34,3],[26,1],[26,3]],performAction:function(t,e,n,r,i,s,o){var h=s.length-1;switch(i){case 1:return s[h-1];case 2:this.$=["(","",s[h-2]," + ",s[h],"",")"];break;case 3:this.$=["(","",s[h-2]," - ",s[h],"",")"];break;case 4:this.$=["(","",s[h-2]," * ",s[h],"",")"];break;case 5:this.$=["(","",s[h-2]," / ",s[h],"",")"];break;case 6:this.$=["(","",s[h-2]," % ",s[h],"",")"];break;case 7:this.$=["(","Math.pow( ",s[h-2],", ",s[h]," )",")"];break;case 8:this.$=["(","- ",s[h],"",")"];break;case 9:this.$=["(","","std.coerceBoolean","(",s[h-2],") && ","std.coerceBoolean","(",s[h],")",")"];break;case 10:this.$=["(","","std.coerceBoolean","(",s[h-2],") || ","std.coerceBoolean","(",s[h],")",")"];break;case 11:this.$=["(","! ","std.coerceBoolean","(",s[h],")",")"];break;case 12:this.$=["(","",s[h-2]," === ",s[h],"",")"];break;case 13:this.$=["(","",s[h-2]," !== ",s[h],"",")"];break;case 14:this.$=["(","RegExp(",s[h],").test(",s[h-2],")",")"];break;case 15:this.$=["(","",s[h-2]," < ",s[h],"",")"];break;case 16:this.$=["(","",s[h-2]," <= ",s[h],"",")"];break;case 17:this.$=["(","",s[h-2]," > ",s[h],"",")"];break;case 18:this.$=["(","",s[h-2]," >= ",s[h],"",")"];break;case 19:this.$=["(","",s[h-4]," ? ",s[h-2]," : ",s[h],"",")"];break;case 20:this.$=["(","",s[h-1],"",")"];break;case 21:this.$=["(","[ ",s[h-3],", ",s[h-1]," ]",")"];break;case 22:case 23:this.$=["(","",s[h],"",")"];break;case 24:this.$=["(","prop(",s[h],", data)",")"];break;case 25:this.$=["(","prop(",s[h-2],", ",s[h],")",")"];break;case 26:this.$=["(","std.isfn(fns, ",s[h-2],") ? fns[",s[h-2],"]() : std.unknown(",s[h-2],")",")"];break;case 27:this.$=["(","std.isfn(fns, ",s[h-3],") ? fns[",s[h-3],"](",s[h-1],") : std.unknown(",s[h-3],")",")"];break;case 28:this.$=["(","std.isSubset(",s[h-2],", ",s[h],")",")"];break;case 29:this.$=["(","!std.isSubset(",s[h-3],", ",s[h],")",")"];break;case 30:this.$=["",s[h],""];break;case 31:this.$=["",s[h-2],", ",s[h],""];break;case 32:this.$=["o === ",s[h],""];break;case 33:this.$=["",s[h-2]," || o === ",s[h],""];break;case 34:this.$=["",s[h],""];break;case 35:this.$=["",s[h-2],", ",s[h],""]}},table:[{3:1,4:2,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{1:[3]},{5:[1,9],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],33:[1,26]},{4:28,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:29,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:30,7:[1,3],14:[1,4],24:[1,5],26:31,28:[1,6],29:[1,7],30:[1,8]},{5:[2,22],6:[2,22],7:[2,22],8:[2,22],9:[2,22],10:[2,22],11:[2,22],12:[2,22],13:[2,22],14:[2,22],15:[2,22],16:[2,22],17:[2,22],18:[2,22],19:[2,22],20:[2,22],21:[2,22],22:[2,22],23:[2,22],25:[2,22],27:[2,22],33:[2,22]},{5:[2,23],6:[2,23],7:[2,23],8:[2,23],9:[2,23],10:[2,23],11:[2,23],12:[2,23],13:[2,23],14:[2,23],15:[2,23],16:[2,23],17:[2,23],18:[2,23],19:[2,23],20:[2,23],21:[2,23],22:[2,23],23:[2,23],25:[2,23],27:[2,23],33:[2,23]},{5:[2,24],6:[2,24],7:[2,24],8:[2,24],9:[2,24],10:[2,24],11:[2,24],12:[2,24],13:[2,24],14:[2,24],15:[2,24],16:[2,24],17:[2,24],18:[2,24],19:[2,24],20:[2,24],21:[2,24],22:[2,24],23:[2,24],24:[1,33],25:[2,24],27:[2,24],31:[1,32],33:[2,24]},{1:[2,1]},{4:34,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:35,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:36,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:37,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:38,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:39,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:40,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:41,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:42,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:43,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:44,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:45,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:46,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:47,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:48,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:49,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:50,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{33:[1,51]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[2,8],17:[2,8],18:[2,8],19:[2,8],20:[2,8],21:[2,8],22:[2,8],23:[2,8],25:[2,8],27:[2,8],33:[2,8]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],17:[2,11],18:[2,11],19:[2,11],20:[2,11],21:[2,11],22:[2,11],23:[2,11],25:[2,11],27:[2,11],33:[2,11]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[1,52],27:[2,34],33:[1,26]},{27:[1,53]},{4:54,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:57,7:[1,3],14:[1,4],24:[1,5],25:[1,55],28:[1,6],29:[1,7],30:[1,8],32:56},{5:[2,2],6:[2,2],7:[2,2],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,2],13:[2,2],14:[1,27],15:[2,2],16:[2,2],17:[2,2],18:[2,2],19:[2,2],20:[2,2],21:[2,2],22:[2,2],23:[2,2],25:[2,2],27:[2,2],33:[2,2]},{5:[2,3],6:[2,3],7:[2,3],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,3],13:[2,3],14:[1,27],15:[2,3],16:[2,3],17:[2,3],18:[2,3],19:[2,3],20:[2,3],21:[2,3],22:[2,3],23:[2,3],25:[2,3],27:[2,3],33:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[2,4],11:[1,15],12:[2,4],13:[2,4],14:[1,27],15:[2,4],16:[2,4],17:[2,4],18:[2,4],19:[2,4],20:[2,4],21:[2,4],22:[2,4],23:[2,4],25:[2,4],27:[2,4],33:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[1,15],12:[2,5],13:[2,5],14:[1,27],15:[2,5],16:[2,5],17:[2,5],18:[2,5],19:[2,5],20:[2,5],21:[2,5],22:[2,5],23:[2,5],25:[2,5],27:[2,5],33:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[1,15],12:[2,6],13:[2,6],14:[1,27],15:[2,6],16:[2,6],17:[2,6],18:[2,6],19:[2,6],20:[2,6],21:[2,6],22:[2,6],23:[2,6],25:[2,6],27:[2,6],33:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[1,27],15:[2,7],16:[2,7],17:[2,7],18:[2,7],19:[2,7],20:[2,7],21:[2,7],22:[2,7],23:[2,7],25:[2,7],27:[2,7],33:[2,7]},{5:[2,9],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,9],13:[2,9],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,9],23:[2,9],25:[2,9],27:[2,9],33:[1,26]},{5:[2,10],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[2,10],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,10],23:[2,10],25:[2,10],27:[2,10],33:[1,26]},{5:[2,12],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,12],13:[2,12],14:[1,27],15:[2,12],16:[2,12],17:[2,12],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,12],23:[2,12],25:[2,12],27:[2,12],33:[2,12]},{5:[2,13],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,13],13:[2,13],14:[1,27],15:[2,13],16:[2,13],17:[2,13],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,13],23:[2,13],25:[2,13],27:[2,13],33:[2,13]},{5:[2,14],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,14],13:[2,14],14:[1,27],15:[2,14],16:[2,14],17:[2,14],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,14],23:[2,14],25:[2,14],27:[2,14],33:[2,14]},{5:[2,15],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,15],13:[2,15],14:[1,27],15:[2,15],16:[2,15],17:[2,15],18:[2,15],19:[2,15],20:[2,15],21:[2,15],22:[2,15],23:[2,15],25:[2,15],27:[2,15],33:[2,15]},{5:[2,16],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,16],13:[2,16],14:[1,27],15:[2,16],16:[2,16],17:[2,16],18:[2,16],19:[2,16],20:[2,16],21:[2,16],22:[2,16],23:[2,16],25:[2,16],27:[2,16],33:[2,16]},{5:[2,17],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,17],13:[2,17],14:[1,27],15:[2,17],16:[2,17],17:[2,17],18:[2,17],19:[2,17],20:[2,17],21:[2,17],22:[2,17],23:[2,17],25:[2,17],27:[2,17],33:[2,17]},{5:[2,18],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,18],13:[2,18],14:[1,27],15:[2,18],16:[2,18],17:[2,18],18:[2,18],19:[2,18],20:[2,18],21:[2,18],22:[2,18],23:[2,18],25:[2,18],27:[2,18],33:[2,18]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],23:[1,58],33:[1,26]},{5:[2,28],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,28],13:[2,28],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,28],23:[2,28],25:[2,28],27:[2,28],33:[2,28]},{4:59,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,20],6:[2,20],7:[2,20],8:[2,20],9:[2,20],10:[2,20],11:[2,20],12:[2,20],13:[2,20],14:[2,20],15:[2,20],16:[2,20],17:[2,20],18:[2,20],19:[2,20],20:[2,20],21:[2,20],22:[2,20],23:[2,20],25:[2,20],27:[2,20],33:[2,20]},{4:60,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,25],6:[2,25],7:[2,25],8:[2,25],9:[2,25],10:[2,25],11:[2,25],12:[2,25],13:[2,25],14:[2,25],15:[2,25],16:[2,25],17:[2,25],18:[2,25],19:[2,25],20:[2,25],21:[2,25],22:[2,25],23:[2,25],25:[2,25],27:[2,25],33:[2,25]},{5:[2,26],6:[2,26],7:[2,26],8:[2,26],9:[2,26],10:[2,26],11:[2,26],12:[2,26],13:[2,26],14:[2,26],15:[2,26],16:[2,26],17:[2,26],18:[2,26],19:[2,26],20:[2,26],21:[2,26],22:[2,26],23:[2,26],25:[2,26],27:[2,26],33:[2,26]},{25:[1,61],27:[1,62]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[2,30],27:[2,30],33:[1,26]},{4:63,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,29],6:[2,29],7:[2,29],8:[2,29],9:[2,29],10:[2,29],11:[2,29],12:[2,29],13:[2,29],14:[2,29],15:[2,29],16:[2,29],17:[2,29],18:[2,29],19:[2,29],20:[2,29],21:[2,29],22:[2,29],23:[2,29],25:[2,29],27:[2,29],33:[2,29]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[1,64],27:[2,35],33:[1,26]},{5:[2,27],6:[2,27],7:[2,27],8:[2,27],9:[2,27],10:[2,27],11:[2,27],12:[2,27],13:[2,27],14:[2,27],15:[2,27],16:[2,27],17:[2,27],18:[2,27],19:[2,27],20:[2,27],21:[2,27],22:[2,27],23:[2,27],25:[2,27],27:[2,27],33:[2,27]},{4:65,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,19],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,19],23:[2,19],25:[2,19],27:[2,19],33:[1,26]},{5:[2,21],6:[2,21],7:[2,21],8:[2,21],9:[2,21],10:[2,21],11:[2,21],12:[2,21],13:[2,21],14:[2,21],15:[2,21],16:[2,21],17:[2,21],18:[2,21],19:[2,21],20:[2,21],21:[2,21],22:[2,21],23:[2,21],25:[2,21],27:[2,21],33:[2,21]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[2,31],27:[2,31],33:[1,26]}],defaultActions:{9:[2,1]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],s=this.table,o="",h=0,a=0,l=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;i.push(c);var u=this.lexer.options&&this.lexer.options.ranges;function y(){var t;return"number"!=typeof(t=e.lexer.lex()||1)&&(t=e.symbols_[t]||t),t}"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var f,p,g,d,m,b,x,_,w,k,$={};;){if(g=n[n.length-1],this.defaultActions[g]?d=this.defaultActions[g]:(null==f&&(f=y()),d=s[g]&&s[g][f]),void 0===d||!d.length||!d[0]){var E="";if(!l){for(b in w=[],s[g])this.terminals_[b]&&b>2&&w.push("'"+this.terminals_[b]+"'");E=this.lexer.showPosition?"Parse error on line "+(h+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[f]||f,line:this.lexer.yylineno,loc:c,expected:w})}if(3==l){if(1==f)throw new Error(E||"Parsing halted.");a=this.lexer.yyleng,o=this.lexer.yytext,h=this.lexer.yylineno,c=this.lexer.yylloc,f=y()}for(;!(2..toString()in s[g]);){if(0===g)throw new Error(E||"Parsing halted.");k=1,n.length=n.length-2*k,r.length=r.length-k,i.length=i.length-k,g=n[n.length-1]}p=2==f?null:f,f=2,d=s[g=n[n.length-1]]&&s[g][2],l=3}if(d[0]instanceof Array&&d.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+f);switch(d[0]){case 1:n.push(f),r.push(this.lexer.yytext),i.push(this.lexer.yylloc),n.push(d[1]),f=null,p?(f=p,p=null):(a=this.lexer.yyleng,o=this.lexer.yytext,h=this.lexer.yylineno,c=this.lexer.yylloc,l>0&&l--);break;case 2:if(x=this.productions_[d[1]][1],$.$=r[r.length-x],$._$={first_line:i[i.length-(x||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(x||1)].first_column,last_column:i[i.length-1].last_column},u&&($._$.range=[i[i.length-(x||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call($,o,a,h,this.yy,d[1],r,i)))return m;x&&(n=n.slice(0,-1*x*2),r=r.slice(0,-1*x),i=i.slice(0,-1*x)),n.push(this.productions_[d[1]][0]),r.push($.$),i.push($._$),_=s[n[n.length-2]][n[n.length-1]],n.push(_);break;case 3:return!0}}return!0}},e=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,n,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),o=0;oe[0].length)||(e=n,r=o,this.options.flex));o++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,s[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"*";case 1:return"/";case 2:return"-";case 3:return"+";case 4:return"^";case 5:return"%";case 6:return"(";case 7:return")";case 8:return",";case 9:return"==";case 10:return"!=";case 11:return"~=";case 12:return">=";case 13:return"<=";case 14:return"<";case 15:return">";case 16:return"?";case 17:return":";case 18:return"and";case 19:return"or";case 20:return"not";case 21:return"in";case 22:return"of";case 23:break;case 24:return"NUMBER";case 25:return e.yytext=JSON.stringify(e.yytext),"SYMBOL";case 26:return e.yytext=t.buildString("'",e.yytext),"SYMBOL";case 27:return e.yytext=t.buildString('"',e.yytext),"STRING";case 28:return"EOF"}},rules:[/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\%)/,/^(?:\()/,/^(?:\))/,/^(?:\,)/,/^(?:==)/,/^(?:\!=)/,/^(?:\~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:\?)/,/^(?:\:)/,/^(?:and[^\w])/,/^(?:or[^\w])/,/^(?:not[^\w])/,/^(?:in[^\w])/,/^(?:of[^\w])/,/^(?:\s+)/,/^(?:[0-9]+(?:\.[0-9]+)?\b)/,/^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/,/^(?:'(?:\\'|\\\\|[^'\\])*')/,/^(?:"(?:\\"|\\\\|[^"\\])*")/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],inclusive:!0}}};return t}();function n(){this.yy={}}return t.lexer=e,n.prototype=t,t.Parser=n,new n}();const n=e;function r(t,e){return("object"==typeof t||"function"==typeof t)&&Object.prototype.hasOwnProperty.call(t,e)}e.Parser;const i="function"!=typeof Symbol||"symbol"!=typeof Symbol.toPrimitive?()=>{}:t=>{if("function"==typeof t[Symbol.toPrimitive])return t[Symbol.toPrimitive]};const s={isfn:function(t,e){return r(t,e)&&"function"==typeof t[e]},unknown:function(t){throw new ReferenceError("Unknown function: "+t+"()")},coerceArray:function(t){if(null==t)throw new TypeError(`Expected a list, but got ${t} instead.`);return Array.isArray(t)?t:[t]},coerceNumber:function(t){const e=t;if(null==t)throw new TypeError(`Expected a numeric value, but got ${t} instead.`);if(Array.isArray(t)&&1===t.length&&(t=t[0]),"object"==typeof t&&(t=function(t,e){if("object"==typeof t&&"function"==typeof t)try{let n=i(t)(e);if(typeof n===e)return n;if(n=t.valueOf(),typeof n===e)return n}finally{return}}(t)),"number"==typeof t||"bigint"==typeof t)return t;throw new TypeError(`Expected a numeric value, but got an ${typeof e} instead.`)},coerceBoolean:function(t){if("boolean"==typeof t)return t;if("object"==typeof t&&t instanceof Boolean)return t.valueOf();throw new TypeError(`Expected a boolean (“true” or “false”) value, but got an ${typeof t} instead.`)},isSubset:function(t,e){const n=s.coerceArray(t),r=s.coerceArray(e);return n.every(t=>r.includes(t))},buildString:function(t,e){t=String(t)[0];let n="";if((e=String(e))[0]!==t||e[e.length-1]!==t)throw new Error("Unexpected internal error: String literal doesn't begin/end with the right quotation mark.");for(let r=1;r=e.length-1)throw new Error("Unexpected internal error: Unescaped backslash at the end of string literal.");if("\\"===e[r])n+="\\";else{if(e[r]!==t)throw new Error("Unexpected internal error: Invalid escaped character in string literal: "+e[r]);n+=t}}else{if(e[r]===t)throw new Error("Unexpected internal error: String literal contains unescaped quotation mark.");n+=e[r]}return JSON.stringify(n)}};return n.yy=Object.create(s),t.compileExpression=function(t,e){if(arguments.length>2)throw new TypeError("Too many arguments.");e="object"==typeof e?e:{};let{extraFunctions:i,customProp:o}=e;for(let t of Object.getOwnPropertyNames(e))if("extraFunctions"!==t&&"customProp"!==t)throw new TypeError("Unknown option: "+t);let h={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,random:Math.random,round:Math.round,sqrt:Math.sqrt,exists:t=>null!=t,empty:t=>null==t||""===t||Array.isArray(t)&&0===t.length};if(i)for(var a in i)r(i,a)&&(h[a]=i[a]);let l=n.parse(t),c=[];function u(t){Array.isArray(t)?t.forEach(u):c.push(t)}function y(t,e){return r(e||{},t)?e[t]:void 0}function f(t){return function(e){return r(t||{},e)?t[e]:void 0}}c.push("return "),l.forEach(u),c.push(";"),"function"==typeof o&&(y=(t,e)=>o(t,f(e),e));let p=new Function("fns","std","prop","data",c.join(""));return function(t){try{return p(h,s,y,t)}catch(t){return t}}},Object.defineProperty(t,"__esModule",{value:!0}),t}({}); \ No newline at end of file +var filtrex=function(t){"use strict";var e=function(){var t={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"+":6,"-":7,"*":8,"/":9,"%":10,"^":11,and:12,or:13,not:14,"==":15,"!=":16,"~=":17,"<":18,"<=":19,">":20,">=":21,if:22,then:23,else:24,"(":25,")":26,array:27,",":28,NUMBER:29,STRING:30,SYMBOL:31,of:32,argsList:33,in:34,inSet:35,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"+",7:"-",8:"*",9:"/",10:"%",11:"^",12:"and",13:"or",14:"not",15:"==",16:"!=",17:"~=",18:"<",19:"<=",20:">",21:">=",22:"if",23:"then",24:"else",25:"(",26:")",28:",",29:"NUMBER",30:"STRING",31:"SYMBOL",32:"of",34:"in"},productions_:[0,[3,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,3],[4,3],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,6],[4,3],[4,5],[4,1],[4,1],[4,1],[4,3],[4,3],[4,4],[4,3],[4,4],[33,1],[33,3],[35,1],[35,3],[27,1],[27,3]],performAction:function(t,e,n,r,i,s,o){var h=s.length-1;switch(i){case 1:return s[h-1];case 2:this.$=["(","",s[h-2]," + ",s[h],"",")"];break;case 3:this.$=["(","",s[h-2]," - ",s[h],"",")"];break;case 4:this.$=["(","",s[h-2]," * ",s[h],"",")"];break;case 5:this.$=["(","",s[h-2]," / ",s[h],"",")"];break;case 6:this.$=["(","",s[h-2]," % ",s[h],"",")"];break;case 7:this.$=["(","Math.pow( ",s[h-2],", ",s[h]," )",")"];break;case 8:this.$=["(","- ",s[h],"",")"];break;case 9:this.$=["(","","std.coerceBoolean","(",s[h-2],") && ","std.coerceBoolean","(",s[h],")",")"];break;case 10:this.$=["(","","std.coerceBoolean","(",s[h-2],") || ","std.coerceBoolean","(",s[h],")",")"];break;case 11:this.$=["(","! ","std.coerceBoolean","(",s[h],")",")"];break;case 12:this.$=["(","",s[h-2]," === ",s[h],"",")"];break;case 13:this.$=["(","",s[h-2]," !== ",s[h],"",")"];break;case 14:this.$=["(","RegExp(",s[h],").test(",s[h-2],")",")"];break;case 15:this.$=["(","",s[h-2]," < ",s[h],"",")"];break;case 16:this.$=["(","",s[h-2]," <= ",s[h],"",")"];break;case 17:this.$=["(","",s[h-2]," > ",s[h],"",")"];break;case 18:this.$=["(","",s[h-2]," >= ",s[h],"",")"];break;case 19:this.$=["(","","std.coerceBoolean","(",s[h-4],") ? ",s[h-2]," : ",s[h],"",")"];break;case 20:this.$=["(","",s[h-1],"",")"];break;case 21:this.$=["(","[ ",s[h-3],", ",s[h-1]," ]",")"];break;case 22:case 23:this.$=["(","",s[h],"",")"];break;case 24:this.$=["(","prop(",s[h],", data)",")"];break;case 25:this.$=["(","prop(",s[h-2],", ",s[h],")",")"];break;case 26:this.$=["(","std.isfn(fns, ",s[h-2],") ? fns[",s[h-2],"]() : std.unknown(",s[h-2],")",")"];break;case 27:this.$=["(","std.isfn(fns, ",s[h-3],") ? fns[",s[h-3],"](",s[h-1],") : std.unknown(",s[h-3],")",")"];break;case 28:this.$=["(","std.isSubset(",s[h-2],", ",s[h],")",")"];break;case 29:this.$=["(","!std.isSubset(",s[h-3],", ",s[h],")",")"];break;case 30:this.$=["",s[h],""];break;case 31:this.$=["",s[h-2],", ",s[h],""];break;case 32:this.$=["o === ",s[h],""];break;case 33:this.$=["",s[h-2]," || o === ",s[h],""];break;case 34:this.$=["",s[h],""];break;case 35:this.$=["",s[h-2],", ",s[h],""]}},table:[{3:1,4:2,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{1:[3]},{5:[1,10],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],34:[1,26]},{4:28,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:29,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:30,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:31,7:[1,3],14:[1,4],22:[1,5],25:[1,6],27:32,29:[1,7],30:[1,8],31:[1,9]},{5:[2,22],6:[2,22],7:[2,22],8:[2,22],9:[2,22],10:[2,22],11:[2,22],12:[2,22],13:[2,22],14:[2,22],15:[2,22],16:[2,22],17:[2,22],18:[2,22],19:[2,22],20:[2,22],21:[2,22],23:[2,22],24:[2,22],26:[2,22],28:[2,22],34:[2,22]},{5:[2,23],6:[2,23],7:[2,23],8:[2,23],9:[2,23],10:[2,23],11:[2,23],12:[2,23],13:[2,23],14:[2,23],15:[2,23],16:[2,23],17:[2,23],18:[2,23],19:[2,23],20:[2,23],21:[2,23],23:[2,23],24:[2,23],26:[2,23],28:[2,23],34:[2,23]},{5:[2,24],6:[2,24],7:[2,24],8:[2,24],9:[2,24],10:[2,24],11:[2,24],12:[2,24],13:[2,24],14:[2,24],15:[2,24],16:[2,24],17:[2,24],18:[2,24],19:[2,24],20:[2,24],21:[2,24],23:[2,24],24:[2,24],25:[1,34],26:[2,24],28:[2,24],32:[1,33],34:[2,24]},{1:[2,1]},{4:35,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:36,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:37,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:38,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:39,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:40,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:41,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:42,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:43,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:44,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:45,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:46,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:47,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:48,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:49,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:50,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{34:[1,51]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[2,8],17:[2,8],18:[2,8],19:[2,8],20:[2,8],21:[2,8],23:[2,8],24:[2,8],26:[2,8],28:[2,8],34:[2,8]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],17:[2,11],18:[2,11],19:[2,11],20:[2,11],21:[2,11],23:[2,11],24:[2,11],26:[2,11],28:[2,11],34:[2,11]},{6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[1,52],34:[1,26]},{6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],26:[1,53],28:[2,34],34:[1,26]},{28:[1,54]},{4:55,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:58,7:[1,3],14:[1,4],22:[1,5],25:[1,6],26:[1,56],29:[1,7],30:[1,8],31:[1,9],33:57},{5:[2,2],6:[2,2],7:[2,2],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,2],13:[2,2],14:[1,27],15:[2,2],16:[2,2],17:[2,2],18:[2,2],19:[2,2],20:[2,2],21:[2,2],23:[2,2],24:[2,2],26:[2,2],28:[2,2],34:[2,2]},{5:[2,3],6:[2,3],7:[2,3],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,3],13:[2,3],14:[1,27],15:[2,3],16:[2,3],17:[2,3],18:[2,3],19:[2,3],20:[2,3],21:[2,3],23:[2,3],24:[2,3],26:[2,3],28:[2,3],34:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[2,4],11:[1,16],12:[2,4],13:[2,4],14:[1,27],15:[2,4],16:[2,4],17:[2,4],18:[2,4],19:[2,4],20:[2,4],21:[2,4],23:[2,4],24:[2,4],26:[2,4],28:[2,4],34:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[1,16],12:[2,5],13:[2,5],14:[1,27],15:[2,5],16:[2,5],17:[2,5],18:[2,5],19:[2,5],20:[2,5],21:[2,5],23:[2,5],24:[2,5],26:[2,5],28:[2,5],34:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[1,16],12:[2,6],13:[2,6],14:[1,27],15:[2,6],16:[2,6],17:[2,6],18:[2,6],19:[2,6],20:[2,6],21:[2,6],23:[2,6],24:[2,6],26:[2,6],28:[2,6],34:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[1,27],15:[2,7],16:[2,7],17:[2,7],18:[2,7],19:[2,7],20:[2,7],21:[2,7],23:[2,7],24:[2,7],26:[2,7],28:[2,7],34:[2,7]},{5:[2,9],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,9],13:[2,9],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,9],24:[2,9],26:[2,9],28:[2,9],34:[1,26]},{5:[2,10],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[2,10],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,10],24:[2,10],26:[2,10],28:[2,10],34:[1,26]},{5:[2,12],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,12],13:[2,12],14:[1,27],15:[2,12],16:[2,12],17:[2,12],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,12],24:[2,12],26:[2,12],28:[2,12],34:[2,12]},{5:[2,13],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,13],13:[2,13],14:[1,27],15:[2,13],16:[2,13],17:[2,13],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,13],24:[2,13],26:[2,13],28:[2,13],34:[2,13]},{5:[2,14],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,14],13:[2,14],14:[1,27],15:[2,14],16:[2,14],17:[2,14],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,14],24:[2,14],26:[2,14],28:[2,14],34:[2,14]},{5:[2,15],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,15],13:[2,15],14:[1,27],15:[2,15],16:[2,15],17:[2,15],18:[2,15],19:[2,15],20:[2,15],21:[2,15],23:[2,15],24:[2,15],26:[2,15],28:[2,15],34:[2,15]},{5:[2,16],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,16],13:[2,16],14:[1,27],15:[2,16],16:[2,16],17:[2,16],18:[2,16],19:[2,16],20:[2,16],21:[2,16],23:[2,16],24:[2,16],26:[2,16],28:[2,16],34:[2,16]},{5:[2,17],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,17],13:[2,17],14:[1,27],15:[2,17],16:[2,17],17:[2,17],18:[2,17],19:[2,17],20:[2,17],21:[2,17],23:[2,17],24:[2,17],26:[2,17],28:[2,17],34:[2,17]},{5:[2,18],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,18],13:[2,18],14:[1,27],15:[2,18],16:[2,18],17:[2,18],18:[2,18],19:[2,18],20:[2,18],21:[2,18],23:[2,18],24:[2,18],26:[2,18],28:[2,18],34:[2,18]},{5:[2,28],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[2,28],13:[2,28],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,28],24:[2,28],26:[2,28],28:[2,28],34:[2,28]},{4:59,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:60,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{5:[2,20],6:[2,20],7:[2,20],8:[2,20],9:[2,20],10:[2,20],11:[2,20],12:[2,20],13:[2,20],14:[2,20],15:[2,20],16:[2,20],17:[2,20],18:[2,20],19:[2,20],20:[2,20],21:[2,20],23:[2,20],24:[2,20],26:[2,20],28:[2,20],34:[2,20]},{4:61,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{5:[2,25],6:[2,25],7:[2,25],8:[2,25],9:[2,25],10:[2,25],11:[2,25],12:[2,25],13:[2,25],14:[2,25],15:[2,25],16:[2,25],17:[2,25],18:[2,25],19:[2,25],20:[2,25],21:[2,25],23:[2,25],24:[2,25],26:[2,25],28:[2,25],34:[2,25]},{5:[2,26],6:[2,26],7:[2,26],8:[2,26],9:[2,26],10:[2,26],11:[2,26],12:[2,26],13:[2,26],14:[2,26],15:[2,26],16:[2,26],17:[2,26],18:[2,26],19:[2,26],20:[2,26],21:[2,26],23:[2,26],24:[2,26],26:[2,26],28:[2,26],34:[2,26]},{26:[1,62],28:[1,63]},{6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],26:[2,30],28:[2,30],34:[1,26]},{5:[2,29],6:[2,29],7:[2,29],8:[2,29],9:[2,29],10:[2,29],11:[2,29],12:[2,29],13:[2,29],14:[2,29],15:[2,29],16:[2,29],17:[2,29],18:[2,29],19:[2,29],20:[2,29],21:[2,29],23:[2,29],24:[2,29],26:[2,29],28:[2,29],34:[2,29]},{6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],24:[1,64],34:[1,26]},{6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],26:[1,65],28:[2,35],34:[1,26]},{5:[2,27],6:[2,27],7:[2,27],8:[2,27],9:[2,27],10:[2,27],11:[2,27],12:[2,27],13:[2,27],14:[2,27],15:[2,27],16:[2,27],17:[2,27],18:[2,27],19:[2,27],20:[2,27],21:[2,27],23:[2,27],24:[2,27],26:[2,27],28:[2,27],34:[2,27]},{4:66,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{4:67,7:[1,3],14:[1,4],22:[1,5],25:[1,6],29:[1,7],30:[1,8],31:[1,9]},{5:[2,21],6:[2,21],7:[2,21],8:[2,21],9:[2,21],10:[2,21],11:[2,21],12:[2,21],13:[2,21],14:[2,21],15:[2,21],16:[2,21],17:[2,21],18:[2,21],19:[2,21],20:[2,21],21:[2,21],23:[2,21],24:[2,21],26:[2,21],28:[2,21],34:[2,21]},{6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],26:[2,31],28:[2,31],34:[1,26]},{5:[2,19],6:[1,11],7:[1,12],8:[1,13],9:[1,14],10:[1,15],11:[1,16],12:[1,17],13:[1,18],14:[1,27],15:[1,19],16:[1,20],17:[1,21],18:[1,22],19:[1,23],20:[1,24],21:[1,25],23:[2,19],24:[2,19],26:[2,19],28:[2,19],34:[1,26]}],defaultActions:{10:[2,1]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],s=this.table,o="",h=0,a=0,l=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;i.push(c);var u=this.lexer.options&&this.lexer.options.ranges;function y(){var t;return"number"!=typeof(t=e.lexer.lex()||1)&&(t=e.symbols_[t]||t),t}"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var f,p,g,d,m,b,x,_,w,k,$={};;){if(g=n[n.length-1],this.defaultActions[g]?d=this.defaultActions[g]:(null==f&&(f=y()),d=s[g]&&s[g][f]),void 0===d||!d.length||!d[0]){var E="";if(!l){for(b in w=[],s[g])this.terminals_[b]&&b>2&&w.push("'"+this.terminals_[b]+"'");E=this.lexer.showPosition?"Parse error on line "+(h+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[f]||f,line:this.lexer.yylineno,loc:c,expected:w})}if(3==l){if(1==f)throw new Error(E||"Parsing halted.");a=this.lexer.yyleng,o=this.lexer.yytext,h=this.lexer.yylineno,c=this.lexer.yylloc,f=y()}for(;!(2..toString()in s[g]);){if(0===g)throw new Error(E||"Parsing halted.");k=1,n.length=n.length-2*k,r.length=r.length-k,i.length=i.length-k,g=n[n.length-1]}p=2==f?null:f,f=2,d=s[g=n[n.length-1]]&&s[g][2],l=3}if(d[0]instanceof Array&&d.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+f);switch(d[0]){case 1:n.push(f),r.push(this.lexer.yytext),i.push(this.lexer.yylloc),n.push(d[1]),f=null,p?(f=p,p=null):(a=this.lexer.yyleng,o=this.lexer.yytext,h=this.lexer.yylineno,c=this.lexer.yylloc,l>0&&l--);break;case 2:if(x=this.productions_[d[1]][1],$.$=r[r.length-x],$._$={first_line:i[i.length-(x||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(x||1)].first_column,last_column:i[i.length-1].last_column},u&&($._$.range=[i[i.length-(x||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call($,o,a,h,this.yy,d[1],r,i)))return m;x&&(n=n.slice(0,-1*x*2),r=r.slice(0,-1*x),i=i.slice(0,-1*x)),n.push(this.productions_[d[1]][0]),r.push($.$),i.push($._$),_=s[n[n.length-2]][n[n.length-1]],n.push(_);break;case 3:return!0}}return!0}},e=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,n,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),o=0;oe[0].length)||(e=n,r=o,this.options.flex));o++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,s[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"*";case 1:return"/";case 2:return"-";case 3:return"+";case 4:return"^";case 5:return"%";case 6:return"(";case 7:return")";case 8:return",";case 9:return"==";case 10:return"!=";case 11:return"~=";case 12:return">=";case 13:return"<=";case 14:return"<";case 15:return">";case 16:return"and";case 17:return"or";case 18:return"not";case 19:return"in";case 20:return"of";case 21:return"if";case 22:return"then";case 23:return"else";case 24:break;case 25:return"NUMBER";case 26:return e.yytext=JSON.stringify(e.yytext),"SYMBOL";case 27:return e.yytext=t.buildString("'",e.yytext),"SYMBOL";case 28:return e.yytext=t.buildString('"',e.yytext),"STRING";case 29:return"EOF"}},rules:[/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\%)/,/^(?:\()/,/^(?:\))/,/^(?:\,)/,/^(?:==)/,/^(?:\!=)/,/^(?:\~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:and[^\w])/,/^(?:or[^\w])/,/^(?:not[^\w])/,/^(?:in[^\w])/,/^(?:of[^\w])/,/^(?:if[^\w])/,/^(?:then[^\w])/,/^(?:else[^\w])/,/^(?:\s+)/,/^(?:[0-9]+(?:\.[0-9]+)?\b)/,/^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/,/^(?:'(?:\\'|\\\\|[^'\\])*')/,/^(?:"(?:\\"|\\\\|[^"\\])*")/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],inclusive:!0}}};return t}();function n(){this.yy={}}return t.lexer=e,n.prototype=t,t.Parser=n,new n}();const n=e;function r(t,e){return("object"==typeof t||"function"==typeof t)&&Object.prototype.hasOwnProperty.call(t,e)}e.Parser;const i="function"!=typeof Symbol||"symbol"!=typeof Symbol.toPrimitive?()=>{}:t=>{if("function"==typeof t[Symbol.toPrimitive])return t[Symbol.toPrimitive]};const s={isfn:function(t,e){return r(t,e)&&"function"==typeof t[e]},unknown:function(t){throw new ReferenceError("Unknown function: "+t+"()")},coerceArray:function(t){if(null==t)throw new TypeError(`Expected a list, but got ${t} instead.`);return Array.isArray(t)?t:[t]},coerceNumber:function(t){const e=t;if(null==t)throw new TypeError(`Expected a numeric value, but got ${t} instead.`);if(Array.isArray(t)&&1===t.length&&(t=t[0]),"object"==typeof t&&(t=function(t,e){if("object"==typeof t&&"function"==typeof t)try{let n=i(t)(e);if(typeof n===e)return n;if(n=t.valueOf(),typeof n===e)return n}finally{return}}(t)),"number"==typeof t||"bigint"==typeof t)return t;throw new TypeError(`Expected a numeric value, but got an ${typeof e} instead.`)},coerceBoolean:function(t){if("boolean"==typeof t)return t;if("object"==typeof t&&t instanceof Boolean)return t.valueOf();throw new TypeError(`Expected a boolean (“true” or “false”) value, but got an ${typeof t} instead.`)},isSubset:function(t,e){const n=s.coerceArray(t),r=s.coerceArray(e);return n.every(t=>r.includes(t))},buildString:function(t,e){t=String(t)[0];let n="";if((e=String(e))[0]!==t||e[e.length-1]!==t)throw new Error("Unexpected internal error: String literal doesn't begin/end with the right quotation mark.");for(let r=1;r=e.length-1)throw new Error("Unexpected internal error: Unescaped backslash at the end of string literal.");if("\\"===e[r])n+="\\";else{if(e[r]!==t)throw new Error("Unexpected internal error: Invalid escaped character in string literal: "+e[r]);n+=t}}else{if(e[r]===t)throw new Error("Unexpected internal error: String literal contains unescaped quotation mark.");n+=e[r]}return JSON.stringify(n)}};return n.yy=Object.create(s),t.compileExpression=function(t,e){if(arguments.length>2)throw new TypeError("Too many arguments.");e="object"==typeof e?e:{};let{extraFunctions:i,customProp:o}=e;for(let t of Object.getOwnPropertyNames(e))if("extraFunctions"!==t&&"customProp"!==t)throw new TypeError("Unknown option: "+t);let h={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,random:Math.random,round:Math.round,sqrt:Math.sqrt,exists:t=>null!=t,empty:t=>null==t||""===t||Array.isArray(t)&&0===t.length};if(i)for(var a in i)r(i,a)&&(h[a]=i[a]);let l=n.parse(t),c=[];function u(t){Array.isArray(t)?t.forEach(u):c.push(t)}function y(t,e){if(r(e||{},t))return e[t];throw new ReferenceError(`Property “${t}” does not exist.`)}function f(t){return function(e){if(r(t||{},e))return t[e];throw new ReferenceError(`Property “${e}” does not exist.`)}}c.push("return "),l.forEach(u),c.push(";"),"function"==typeof o&&(y=(t,e)=>o(t,f(e),e));let p=new Function("fns","std","prop","data",c.join(""));return function(t){try{return p(h,s,y,t)}catch(t){return t}}},Object.defineProperty(t,"__esModule",{value:!0}),t}({}); \ No newline at end of file diff --git a/dist/cjs/filtrex.js b/dist/cjs/filtrex.js index 1d57fc2..afa3584 100644 --- a/dist/cjs/filtrex.js +++ b/dist/cjs/filtrex.js @@ -28,19 +28,20 @@ var _parser = (function() { "<=": 19, ">": 20, ">=": 21, - "?": 22, - ":": 23, - "(": 24, - ")": 25, - "array": 26, - ",": 27, - "NUMBER": 28, - "STRING": 29, - "SYMBOL": 30, - "of": 31, - "argsList": 32, - "in": 33, - "inSet": 34, + "if": 22, + "then": 23, + "else": 24, + "(": 25, + ")": 26, + "array": 27, + ",": 28, + "NUMBER": 29, + "STRING": 30, + "SYMBOL": 31, + "of": 32, + "argsList": 33, + "in": 34, + "inSet": 35, "$accept": 0, "$end": 1 }, @@ -63,16 +64,17 @@ var _parser = (function() { 19: "<=", 20: ">", 21: ">=", - 22: "?", - 23: ":", - 24: "(", - 25: ")", - 27: ",", - 28: "NUMBER", - 29: "STRING", - 30: "SYMBOL", - 31: "of", - 33: "in" + 22: "if", + 23: "then", + 24: "else", + 25: "(", + 26: ")", + 28: ",", + 29: "NUMBER", + 30: "STRING", + 31: "SYMBOL", + 32: "of", + 34: "in" }, productions_: [0, [3, 2], [4, 3], @@ -92,7 +94,7 @@ var _parser = (function() { [4, 3], [4, 3], [4, 3], - [4, 5], + [4, 6], [4, 3], [4, 5], [4, 1], @@ -103,12 +105,12 @@ var _parser = (function() { [4, 4], [4, 3], [4, 4], - [32, 1], - [32, 3], - [34, 1], - [34, 3], - [26, 1], - [26, 3] + [33, 1], + [33, 3], + [35, 1], + [35, 3], + [27, 1], + [27, 3] ], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { @@ -168,7 +170,7 @@ var _parser = (function() { this.$ = ["(", "", $$[$0 - 2], " >= ", $$[$0], "", ")"]; break; case 19: - this.$ = ["(", "", $$[$0 - 4], " ? ", $$[$0 - 2], " : ", $$[$0], "", ")"]; + this.$ = ["(", "", "std.coerceBoolean", "(", $$[$0 - 4], ") ? ", $$[$0 - 2], " : ", $$[$0], "", ")"]; break; case 20: this.$ = ["(", "", $$[$0 - 1], "", ")"]; @@ -225,57 +227,69 @@ var _parser = (function() { 4: 2, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 1: [3] }, { - 5: [1, 9], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 5: [1, 10], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 34: [1, 26] }, { 4: 28, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 29, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 30, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 26: 31, - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] + }, { + 4: 31, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], + 27: 32, + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 22], 6: [2, 22], @@ -294,11 +308,11 @@ var _parser = (function() { 19: [2, 22], 20: [2, 22], 21: [2, 22], - 22: [2, 22], 23: [2, 22], - 25: [2, 22], - 27: [2, 22], - 33: [2, 22] + 24: [2, 22], + 26: [2, 22], + 28: [2, 22], + 34: [2, 22] }, { 5: [2, 23], 6: [2, 23], @@ -317,11 +331,11 @@ var _parser = (function() { 19: [2, 23], 20: [2, 23], 21: [2, 23], - 22: [2, 23], 23: [2, 23], - 25: [2, 23], - 27: [2, 23], - 33: [2, 23] + 24: [2, 23], + 26: [2, 23], + 28: [2, 23], + 34: [2, 23] }, { 5: [2, 24], 6: [2, 24], @@ -340,153 +354,161 @@ var _parser = (function() { 19: [2, 24], 20: [2, 24], 21: [2, 24], - 22: [2, 24], 23: [2, 24], - 24: [1, 33], - 25: [2, 24], - 27: [2, 24], - 31: [1, 32], - 33: [2, 24] + 24: [2, 24], + 25: [1, 34], + 26: [2, 24], + 28: [2, 24], + 32: [1, 33], + 34: [2, 24] }, { 1: [2, 1] - }, { - 4: 34, - 7: [1, 3], - 14: [1, 4], - 24: [1, 5], - 28: [1, 6], - 29: [1, 7], - 30: [1, 8] }, { 4: 35, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 36, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 37, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 38, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 39, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 40, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 41, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 42, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 43, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 44, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 45, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 46, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 47, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 48, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 49, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 50, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 33: [1, 51] + 34: [1, 51] }, { 5: [2, 8], 6: [2, 8], @@ -505,11 +527,11 @@ var _parser = (function() { 19: [2, 8], 20: [2, 8], 21: [2, 8], - 22: [2, 8], 23: [2, 8], - 25: [2, 8], - 27: [2, 8], - 33: [2, 8] + 24: [2, 8], + 26: [2, 8], + 28: [2, 8], + 34: [2, 8] }, { 5: [2, 11], 6: [2, 11], @@ -528,60 +550,80 @@ var _parser = (function() { 19: [2, 11], 20: [2, 11], 21: [2, 11], - 22: [2, 11], 23: [2, 11], - 25: [2, 11], - 27: [2, 11], - 33: [2, 11] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 11], + 26: [2, 11], + 28: [2, 11], + 34: [2, 11] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 23: [1, 52], + 34: [1, 26] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [1, 52], - 27: [2, 34], - 33: [1, 26] - }, { - 27: [1, 53] - }, { - 4: 54, + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [1, 53], + 28: [2, 34], + 34: [1, 26] + }, { + 28: [1, 54] + }, { + 4: 55, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 4: 57, + 4: 58, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 25: [1, 55], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 26: [1, 56], 29: [1, 7], 30: [1, 8], - 32: 56 + 31: [1, 9], + 33: 57 }, { 5: [2, 2], 6: [2, 2], 7: [2, 2], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 2], 13: [2, 2], 14: [1, 27], @@ -592,19 +634,19 @@ var _parser = (function() { 19: [2, 2], 20: [2, 2], 21: [2, 2], - 22: [2, 2], 23: [2, 2], - 25: [2, 2], - 27: [2, 2], - 33: [2, 2] + 24: [2, 2], + 26: [2, 2], + 28: [2, 2], + 34: [2, 2] }, { 5: [2, 3], 6: [2, 3], 7: [2, 3], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 3], 13: [2, 3], 14: [1, 27], @@ -615,11 +657,11 @@ var _parser = (function() { 19: [2, 3], 20: [2, 3], 21: [2, 3], - 22: [2, 3], 23: [2, 3], - 25: [2, 3], - 27: [2, 3], - 33: [2, 3] + 24: [2, 3], + 26: [2, 3], + 28: [2, 3], + 34: [2, 3] }, { 5: [2, 4], 6: [2, 4], @@ -627,7 +669,7 @@ var _parser = (function() { 8: [2, 4], 9: [2, 4], 10: [2, 4], - 11: [1, 15], + 11: [1, 16], 12: [2, 4], 13: [2, 4], 14: [1, 27], @@ -638,11 +680,11 @@ var _parser = (function() { 19: [2, 4], 20: [2, 4], 21: [2, 4], - 22: [2, 4], 23: [2, 4], - 25: [2, 4], - 27: [2, 4], - 33: [2, 4] + 24: [2, 4], + 26: [2, 4], + 28: [2, 4], + 34: [2, 4] }, { 5: [2, 5], 6: [2, 5], @@ -650,7 +692,7 @@ var _parser = (function() { 8: [2, 5], 9: [2, 5], 10: [2, 5], - 11: [1, 15], + 11: [1, 16], 12: [2, 5], 13: [2, 5], 14: [1, 27], @@ -661,11 +703,11 @@ var _parser = (function() { 19: [2, 5], 20: [2, 5], 21: [2, 5], - 22: [2, 5], 23: [2, 5], - 25: [2, 5], - 27: [2, 5], - 33: [2, 5] + 24: [2, 5], + 26: [2, 5], + 28: [2, 5], + 34: [2, 5] }, { 5: [2, 6], 6: [2, 6], @@ -673,7 +715,7 @@ var _parser = (function() { 8: [2, 6], 9: [2, 6], 10: [2, 6], - 11: [1, 15], + 11: [1, 16], 12: [2, 6], 13: [2, 6], 14: [1, 27], @@ -684,11 +726,11 @@ var _parser = (function() { 19: [2, 6], 20: [2, 6], 21: [2, 6], - 22: [2, 6], 23: [2, 6], - 25: [2, 6], - 27: [2, 6], - 33: [2, 6] + 24: [2, 6], + 26: [2, 6], + 28: [2, 6], + 34: [2, 6] }, { 5: [2, 7], 6: [2, 7], @@ -707,134 +749,134 @@ var _parser = (function() { 19: [2, 7], 20: [2, 7], 21: [2, 7], - 22: [2, 7], 23: [2, 7], - 25: [2, 7], - 27: [2, 7], - 33: [2, 7] + 24: [2, 7], + 26: [2, 7], + 28: [2, 7], + 34: [2, 7] }, { 5: [2, 9], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 9], 13: [2, 9], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 9], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 9], - 25: [2, 9], - 27: [2, 9], - 33: [1, 26] + 24: [2, 9], + 26: [2, 9], + 28: [2, 9], + 34: [1, 26] }, { 5: [2, 10], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], 13: [2, 10], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 10], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 10], - 25: [2, 10], - 27: [2, 10], - 33: [1, 26] + 24: [2, 10], + 26: [2, 10], + 28: [2, 10], + 34: [1, 26] }, { 5: [2, 12], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 12], 13: [2, 12], 14: [1, 27], 15: [2, 12], 16: [2, 12], 17: [2, 12], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 12], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 12], - 25: [2, 12], - 27: [2, 12], - 33: [2, 12] + 24: [2, 12], + 26: [2, 12], + 28: [2, 12], + 34: [2, 12] }, { 5: [2, 13], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 13], 13: [2, 13], 14: [1, 27], 15: [2, 13], 16: [2, 13], 17: [2, 13], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 13], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 13], - 25: [2, 13], - 27: [2, 13], - 33: [2, 13] + 24: [2, 13], + 26: [2, 13], + 28: [2, 13], + 34: [2, 13] }, { 5: [2, 14], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 14], 13: [2, 14], 14: [1, 27], 15: [2, 14], 16: [2, 14], 17: [2, 14], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 14], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 14], - 25: [2, 14], - 27: [2, 14], - 33: [2, 14] + 24: [2, 14], + 26: [2, 14], + 28: [2, 14], + 34: [2, 14] }, { 5: [2, 15], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 15], 13: [2, 15], 14: [1, 27], @@ -845,19 +887,19 @@ var _parser = (function() { 19: [2, 15], 20: [2, 15], 21: [2, 15], - 22: [2, 15], 23: [2, 15], - 25: [2, 15], - 27: [2, 15], - 33: [2, 15] + 24: [2, 15], + 26: [2, 15], + 28: [2, 15], + 34: [2, 15] }, { 5: [2, 16], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 16], 13: [2, 16], 14: [1, 27], @@ -868,19 +910,19 @@ var _parser = (function() { 19: [2, 16], 20: [2, 16], 21: [2, 16], - 22: [2, 16], 23: [2, 16], - 25: [2, 16], - 27: [2, 16], - 33: [2, 16] + 24: [2, 16], + 26: [2, 16], + 28: [2, 16], + 34: [2, 16] }, { 5: [2, 17], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 17], 13: [2, 17], 14: [1, 27], @@ -891,19 +933,19 @@ var _parser = (function() { 19: [2, 17], 20: [2, 17], 21: [2, 17], - 22: [2, 17], 23: [2, 17], - 25: [2, 17], - 27: [2, 17], - 33: [2, 17] + 24: [2, 17], + 26: [2, 17], + 28: [2, 17], + 34: [2, 17] }, { 5: [2, 18], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 18], 13: [2, 18], 14: [1, 27], @@ -914,62 +956,52 @@ var _parser = (function() { 19: [2, 18], 20: [2, 18], 21: [2, 18], - 22: [2, 18], 23: [2, 18], - 25: [2, 18], - 27: [2, 18], - 33: [2, 18] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], - 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 23: [1, 58], - 33: [1, 26] + 24: [2, 18], + 26: [2, 18], + 28: [2, 18], + 34: [2, 18] }, { 5: [2, 28], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 28], 13: [2, 28], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 28], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 28], - 25: [2, 28], - 27: [2, 28], - 33: [2, 28] + 24: [2, 28], + 26: [2, 28], + 28: [2, 28], + 34: [2, 28] }, { 4: 59, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] + }, { + 4: 60, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 20], 6: [2, 20], @@ -988,19 +1020,20 @@ var _parser = (function() { 19: [2, 20], 20: [2, 20], 21: [2, 20], - 22: [2, 20], 23: [2, 20], - 25: [2, 20], - 27: [2, 20], - 33: [2, 20] + 24: [2, 20], + 26: [2, 20], + 28: [2, 20], + 34: [2, 20] }, { - 4: 60, + 4: 61, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 25], 6: [2, 25], @@ -1019,11 +1052,11 @@ var _parser = (function() { 19: [2, 25], 20: [2, 25], 21: [2, 25], - 22: [2, 25], 23: [2, 25], - 25: [2, 25], - 27: [2, 25], - 33: [2, 25] + 24: [2, 25], + 26: [2, 25], + 28: [2, 25], + 34: [2, 25] }, { 5: [2, 26], 6: [2, 26], @@ -1042,43 +1075,34 @@ var _parser = (function() { 19: [2, 26], 20: [2, 26], 21: [2, 26], - 22: [2, 26], 23: [2, 26], - 25: [2, 26], - 27: [2, 26], - 33: [2, 26] - }, { - 25: [1, 61], - 27: [1, 62] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 26], + 26: [2, 26], + 28: [2, 26], + 34: [2, 26] + }, { + 26: [1, 62], + 28: [1, 63] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [2, 30], - 27: [2, 30], - 33: [1, 26] - }, { - 4: 63, - 7: [1, 3], - 14: [1, 4], - 24: [1, 5], - 28: [1, 6], - 29: [1, 7], - 30: [1, 8] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [2, 30], + 28: [2, 30], + 34: [1, 26] }, { 5: [2, 29], 6: [2, 29], @@ -1097,32 +1121,50 @@ var _parser = (function() { 19: [2, 29], 20: [2, 29], 21: [2, 29], - 22: [2, 29], 23: [2, 29], - 25: [2, 29], - 27: [2, 29], - 33: [2, 29] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 29], + 26: [2, 29], + 28: [2, 29], + 34: [2, 29] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 24: [1, 64], + 34: [1, 26] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [1, 64], - 27: [2, 35], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [1, 65], + 28: [2, 35], + 34: [1, 26] }, { 5: [2, 27], 6: [2, 27], @@ -1141,42 +1183,29 @@ var _parser = (function() { 19: [2, 27], 20: [2, 27], 21: [2, 27], - 22: [2, 27], 23: [2, 27], - 25: [2, 27], - 27: [2, 27], - 33: [2, 27] + 24: [2, 27], + 26: [2, 27], + 28: [2, 27], + 34: [2, 27] }, { - 4: 65, + 4: 66, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 5: [2, 19], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], - 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 19], - 23: [2, 19], - 25: [2, 19], - 27: [2, 19], - 33: [1, 26] + 4: 67, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 21], 6: [2, 21], @@ -1195,35 +1224,57 @@ var _parser = (function() { 19: [2, 21], 20: [2, 21], 21: [2, 21], - 22: [2, 21], 23: [2, 21], - 25: [2, 21], - 27: [2, 21], - 33: [2, 21] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 21], + 26: [2, 21], + 28: [2, 21], + 34: [2, 21] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [2, 31], + 28: [2, 31], + 34: [1, 26] + }, { + 5: [2, 19], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [2, 31], - 27: [2, 31], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 23: [2, 19], + 24: [2, 19], + 26: [2, 19], + 28: [2, 19], + 34: [1, 26] }], defaultActions: { - 9: [2, 1] + 10: [2, 1] }, parseError: function parseError(str, hash) { throw new Error(str); @@ -1640,40 +1691,42 @@ var _parser = (function() { case 15: return ">"; case 16: - return "?"; + return "and"; case 17: - return ":"; + return "or"; case 18: - return "and"; + return "not"; case 19: - return "or"; + return "in"; case 20: - return "not"; + return "of"; case 21: - return "in"; + return "if"; case 22: - return "of"; + return "then"; case 23: - break; + return "else"; case 24: - return "NUMBER"; + break; case 25: + return "NUMBER"; + case 26: yy_.yytext = JSON.stringify(yy_.yytext); return "SYMBOL"; - case 26: + case 27: yy_.yytext = yy.buildString("'", yy_.yytext); return "SYMBOL"; - case 27: + case 28: yy_.yytext = yy.buildString('"', yy_.yytext); return "STRING"; - case 28: + case 29: return "EOF"; } }; - lexer.rules = [/^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\%)/, /^(?:\()/, /^(?:\))/, /^(?:\,)/, /^(?:==)/, /^(?:\!=)/, /^(?:\~=)/, /^(?:>=)/, /^(?:<=)/, /^(?:<)/, /^(?:>)/, /^(?:\?)/, /^(?:\:)/, /^(?:and[^\w])/, /^(?:or[^\w])/, /^(?:not[^\w])/, /^(?:in[^\w])/, /^(?:of[^\w])/, /^(?:\s+)/, /^(?:[0-9]+(?:\.[0-9]+)?\b)/, /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/, /^(?:'(?:\\'|\\\\|[^'\\])*')/, /^(?:"(?:\\"|\\\\|[^"\\])*")/, /^(?:$)/]; + lexer.rules = [/^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\%)/, /^(?:\()/, /^(?:\))/, /^(?:\,)/, /^(?:==)/, /^(?:\!=)/, /^(?:\~=)/, /^(?:>=)/, /^(?:<=)/, /^(?:<)/, /^(?:>)/, /^(?:and[^\w])/, /^(?:or[^\w])/, /^(?:not[^\w])/, /^(?:in[^\w])/, /^(?:of[^\w])/, /^(?:if[^\w])/, /^(?:then[^\w])/, /^(?:else[^\w])/, /^(?:\s+)/, /^(?:[0-9]+(?:\.[0-9]+)?\b)/, /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/, /^(?:'(?:\\'|\\\\|[^'\\])*')/, /^(?:"(?:\\"|\\\\|[^"\\])*")/, /^(?:$)/]; lexer.conditions = { "INITIAL": { - "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28], + "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "inclusive": true } }; @@ -1909,12 +1962,18 @@ function compileExpression(expression, options) { // Metaprogramming functions function prop(name, obj) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } function safeGetter(obj) { return function get(name) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } } diff --git a/dist/esm/filtrex.mjs b/dist/esm/filtrex.mjs index 30323cd..06613b6 100644 --- a/dist/esm/filtrex.mjs +++ b/dist/esm/filtrex.mjs @@ -168,12 +168,18 @@ export function compileExpression(expression, options) { // Metaprogramming functions function prop(name, obj) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } function safeGetter(obj) { return function get(name) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } } diff --git a/dist/esm/parser.mjs b/dist/esm/parser.mjs index 0e7f183..785c06e 100644 --- a/dist/esm/parser.mjs +++ b/dist/esm/parser.mjs @@ -24,19 +24,20 @@ var _parser = (function() { "<=": 19, ">": 20, ">=": 21, - "?": 22, - ":": 23, - "(": 24, - ")": 25, - "array": 26, - ",": 27, - "NUMBER": 28, - "STRING": 29, - "SYMBOL": 30, - "of": 31, - "argsList": 32, - "in": 33, - "inSet": 34, + "if": 22, + "then": 23, + "else": 24, + "(": 25, + ")": 26, + "array": 27, + ",": 28, + "NUMBER": 29, + "STRING": 30, + "SYMBOL": 31, + "of": 32, + "argsList": 33, + "in": 34, + "inSet": 35, "$accept": 0, "$end": 1 }, @@ -59,16 +60,17 @@ var _parser = (function() { 19: "<=", 20: ">", 21: ">=", - 22: "?", - 23: ":", - 24: "(", - 25: ")", - 27: ",", - 28: "NUMBER", - 29: "STRING", - 30: "SYMBOL", - 31: "of", - 33: "in" + 22: "if", + 23: "then", + 24: "else", + 25: "(", + 26: ")", + 28: ",", + 29: "NUMBER", + 30: "STRING", + 31: "SYMBOL", + 32: "of", + 34: "in" }, productions_: [0, [3, 2], [4, 3], @@ -88,7 +90,7 @@ var _parser = (function() { [4, 3], [4, 3], [4, 3], - [4, 5], + [4, 6], [4, 3], [4, 5], [4, 1], @@ -99,12 +101,12 @@ var _parser = (function() { [4, 4], [4, 3], [4, 4], - [32, 1], - [32, 3], - [34, 1], - [34, 3], - [26, 1], - [26, 3] + [33, 1], + [33, 3], + [35, 1], + [35, 3], + [27, 1], + [27, 3] ], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { @@ -165,7 +167,7 @@ var _parser = (function() { this.$ = ["(", "", $$[$0 - 2], " >= ", $$[$0], "", ")"]; break; case 19: - this.$ = ["(", "", $$[$0 - 4], " ? ", $$[$0 - 2], " : ", $$[$0], "", ")"]; + this.$ = ["(", "", "std.coerceBoolean", "(", $$[$0 - 4], ") ? ", $$[$0 - 2], " : ", $$[$0], "", ")"]; break; case 20: this.$ = ["(", "", $$[$0 - 1], "", ")"]; @@ -222,57 +224,69 @@ var _parser = (function() { 4: 2, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 1: [3] }, { - 5: [1, 9], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 5: [1, 10], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 34: [1, 26] }, { 4: 28, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 29, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 30, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 26: 31, - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] + }, { + 4: 31, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], + 27: 32, 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 22], 6: [2, 22], @@ -291,11 +305,11 @@ var _parser = (function() { 19: [2, 22], 20: [2, 22], 21: [2, 22], - 22: [2, 22], 23: [2, 22], - 25: [2, 22], - 27: [2, 22], - 33: [2, 22] + 24: [2, 22], + 26: [2, 22], + 28: [2, 22], + 34: [2, 22] }, { 5: [2, 23], 6: [2, 23], @@ -314,11 +328,11 @@ var _parser = (function() { 19: [2, 23], 20: [2, 23], 21: [2, 23], - 22: [2, 23], 23: [2, 23], - 25: [2, 23], - 27: [2, 23], - 33: [2, 23] + 24: [2, 23], + 26: [2, 23], + 28: [2, 23], + 34: [2, 23] }, { 5: [2, 24], 6: [2, 24], @@ -337,153 +351,161 @@ var _parser = (function() { 19: [2, 24], 20: [2, 24], 21: [2, 24], - 22: [2, 24], 23: [2, 24], - 24: [1, 33], - 25: [2, 24], - 27: [2, 24], - 31: [1, 32], - 33: [2, 24] + 24: [2, 24], + 25: [1, 34], + 26: [2, 24], + 28: [2, 24], + 32: [1, 33], + 34: [2, 24] }, { 1: [2, 1] - }, { - 4: 34, - 7: [1, 3], - 14: [1, 4], - 24: [1, 5], - 28: [1, 6], - 29: [1, 7], - 30: [1, 8] }, { 4: 35, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 36, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 37, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 38, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 39, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 40, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 41, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 42, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 43, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 44, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 45, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 46, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 47, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 48, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 49, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 4: 50, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 33: [1, 51] + 34: [1, 51] }, { 5: [2, 8], 6: [2, 8], @@ -502,11 +524,11 @@ var _parser = (function() { 19: [2, 8], 20: [2, 8], 21: [2, 8], - 22: [2, 8], 23: [2, 8], - 25: [2, 8], - 27: [2, 8], - 33: [2, 8] + 24: [2, 8], + 26: [2, 8], + 28: [2, 8], + 34: [2, 8] }, { 5: [2, 11], 6: [2, 11], @@ -525,60 +547,80 @@ var _parser = (function() { 19: [2, 11], 20: [2, 11], 21: [2, 11], - 22: [2, 11], 23: [2, 11], - 25: [2, 11], - 27: [2, 11], - 33: [2, 11] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 11], + 26: [2, 11], + 28: [2, 11], + 34: [2, 11] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [1, 52], - 27: [2, 34], - 33: [1, 26] - }, { - 27: [1, 53] - }, { - 4: 54, + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 23: [1, 52], + 34: [1, 26] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [1, 53], + 28: [2, 34], + 34: [1, 26] + }, { + 28: [1, 54] + }, { + 4: 55, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 4: 57, + 4: 58, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 25: [1, 55], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 26: [1, 56], 29: [1, 7], 30: [1, 8], - 32: 56 + 31: [1, 9], + 33: 57 }, { 5: [2, 2], 6: [2, 2], 7: [2, 2], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 2], 13: [2, 2], 14: [1, 27], @@ -589,19 +631,19 @@ var _parser = (function() { 19: [2, 2], 20: [2, 2], 21: [2, 2], - 22: [2, 2], 23: [2, 2], - 25: [2, 2], - 27: [2, 2], - 33: [2, 2] + 24: [2, 2], + 26: [2, 2], + 28: [2, 2], + 34: [2, 2] }, { 5: [2, 3], 6: [2, 3], 7: [2, 3], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 3], 13: [2, 3], 14: [1, 27], @@ -612,11 +654,11 @@ var _parser = (function() { 19: [2, 3], 20: [2, 3], 21: [2, 3], - 22: [2, 3], 23: [2, 3], - 25: [2, 3], - 27: [2, 3], - 33: [2, 3] + 24: [2, 3], + 26: [2, 3], + 28: [2, 3], + 34: [2, 3] }, { 5: [2, 4], 6: [2, 4], @@ -624,7 +666,7 @@ var _parser = (function() { 8: [2, 4], 9: [2, 4], 10: [2, 4], - 11: [1, 15], + 11: [1, 16], 12: [2, 4], 13: [2, 4], 14: [1, 27], @@ -635,11 +677,11 @@ var _parser = (function() { 19: [2, 4], 20: [2, 4], 21: [2, 4], - 22: [2, 4], 23: [2, 4], - 25: [2, 4], - 27: [2, 4], - 33: [2, 4] + 24: [2, 4], + 26: [2, 4], + 28: [2, 4], + 34: [2, 4] }, { 5: [2, 5], 6: [2, 5], @@ -647,7 +689,7 @@ var _parser = (function() { 8: [2, 5], 9: [2, 5], 10: [2, 5], - 11: [1, 15], + 11: [1, 16], 12: [2, 5], 13: [2, 5], 14: [1, 27], @@ -658,11 +700,11 @@ var _parser = (function() { 19: [2, 5], 20: [2, 5], 21: [2, 5], - 22: [2, 5], 23: [2, 5], - 25: [2, 5], - 27: [2, 5], - 33: [2, 5] + 24: [2, 5], + 26: [2, 5], + 28: [2, 5], + 34: [2, 5] }, { 5: [2, 6], 6: [2, 6], @@ -670,7 +712,7 @@ var _parser = (function() { 8: [2, 6], 9: [2, 6], 10: [2, 6], - 11: [1, 15], + 11: [1, 16], 12: [2, 6], 13: [2, 6], 14: [1, 27], @@ -681,11 +723,11 @@ var _parser = (function() { 19: [2, 6], 20: [2, 6], 21: [2, 6], - 22: [2, 6], 23: [2, 6], - 25: [2, 6], - 27: [2, 6], - 33: [2, 6] + 24: [2, 6], + 26: [2, 6], + 28: [2, 6], + 34: [2, 6] }, { 5: [2, 7], 6: [2, 7], @@ -704,134 +746,134 @@ var _parser = (function() { 19: [2, 7], 20: [2, 7], 21: [2, 7], - 22: [2, 7], 23: [2, 7], - 25: [2, 7], - 27: [2, 7], - 33: [2, 7] + 24: [2, 7], + 26: [2, 7], + 28: [2, 7], + 34: [2, 7] }, { 5: [2, 9], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 9], 13: [2, 9], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 9], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 9], - 25: [2, 9], - 27: [2, 9], - 33: [1, 26] + 24: [2, 9], + 26: [2, 9], + 28: [2, 9], + 34: [1, 26] }, { 5: [2, 10], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], 13: [2, 10], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 10], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 10], - 25: [2, 10], - 27: [2, 10], - 33: [1, 26] + 24: [2, 10], + 26: [2, 10], + 28: [2, 10], + 34: [1, 26] }, { 5: [2, 12], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 12], 13: [2, 12], 14: [1, 27], 15: [2, 12], 16: [2, 12], 17: [2, 12], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 12], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 12], - 25: [2, 12], - 27: [2, 12], - 33: [2, 12] + 24: [2, 12], + 26: [2, 12], + 28: [2, 12], + 34: [2, 12] }, { 5: [2, 13], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 13], 13: [2, 13], 14: [1, 27], 15: [2, 13], 16: [2, 13], 17: [2, 13], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 13], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 13], - 25: [2, 13], - 27: [2, 13], - 33: [2, 13] + 24: [2, 13], + 26: [2, 13], + 28: [2, 13], + 34: [2, 13] }, { 5: [2, 14], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 14], 13: [2, 14], 14: [1, 27], 15: [2, 14], 16: [2, 14], 17: [2, 14], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 14], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 14], - 25: [2, 14], - 27: [2, 14], - 33: [2, 14] + 24: [2, 14], + 26: [2, 14], + 28: [2, 14], + 34: [2, 14] }, { 5: [2, 15], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 15], 13: [2, 15], 14: [1, 27], @@ -842,19 +884,19 @@ var _parser = (function() { 19: [2, 15], 20: [2, 15], 21: [2, 15], - 22: [2, 15], 23: [2, 15], - 25: [2, 15], - 27: [2, 15], - 33: [2, 15] + 24: [2, 15], + 26: [2, 15], + 28: [2, 15], + 34: [2, 15] }, { 5: [2, 16], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 16], 13: [2, 16], 14: [1, 27], @@ -865,19 +907,19 @@ var _parser = (function() { 19: [2, 16], 20: [2, 16], 21: [2, 16], - 22: [2, 16], 23: [2, 16], - 25: [2, 16], - 27: [2, 16], - 33: [2, 16] + 24: [2, 16], + 26: [2, 16], + 28: [2, 16], + 34: [2, 16] }, { 5: [2, 17], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 17], 13: [2, 17], 14: [1, 27], @@ -888,19 +930,19 @@ var _parser = (function() { 19: [2, 17], 20: [2, 17], 21: [2, 17], - 22: [2, 17], 23: [2, 17], - 25: [2, 17], - 27: [2, 17], - 33: [2, 17] + 24: [2, 17], + 26: [2, 17], + 28: [2, 17], + 34: [2, 17] }, { 5: [2, 18], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 18], 13: [2, 18], 14: [1, 27], @@ -911,62 +953,52 @@ var _parser = (function() { 19: [2, 18], 20: [2, 18], 21: [2, 18], - 22: [2, 18], 23: [2, 18], - 25: [2, 18], - 27: [2, 18], - 33: [2, 18] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], - 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 23: [1, 58], - 33: [1, 26] + 24: [2, 18], + 26: [2, 18], + 28: [2, 18], + 34: [2, 18] }, { 5: [2, 28], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], 12: [2, 28], 13: [2, 28], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 28], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], 23: [2, 28], - 25: [2, 28], - 27: [2, 28], - 33: [2, 28] + 24: [2, 28], + 26: [2, 28], + 28: [2, 28], + 34: [2, 28] }, { 4: 59, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] + }, { + 4: 60, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 20], 6: [2, 20], @@ -985,19 +1017,20 @@ var _parser = (function() { 19: [2, 20], 20: [2, 20], 21: [2, 20], - 22: [2, 20], 23: [2, 20], - 25: [2, 20], - 27: [2, 20], - 33: [2, 20] + 24: [2, 20], + 26: [2, 20], + 28: [2, 20], + 34: [2, 20] }, { - 4: 60, + 4: 61, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 25], 6: [2, 25], @@ -1016,11 +1049,11 @@ var _parser = (function() { 19: [2, 25], 20: [2, 25], 21: [2, 25], - 22: [2, 25], 23: [2, 25], - 25: [2, 25], - 27: [2, 25], - 33: [2, 25] + 24: [2, 25], + 26: [2, 25], + 28: [2, 25], + 34: [2, 25] }, { 5: [2, 26], 6: [2, 26], @@ -1039,43 +1072,34 @@ var _parser = (function() { 19: [2, 26], 20: [2, 26], 21: [2, 26], - 22: [2, 26], 23: [2, 26], - 25: [2, 26], - 27: [2, 26], - 33: [2, 26] - }, { - 25: [1, 61], - 27: [1, 62] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 26], + 26: [2, 26], + 28: [2, 26], + 34: [2, 26] + }, { + 26: [1, 62], + 28: [1, 63] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [2, 30], - 27: [2, 30], - 33: [1, 26] - }, { - 4: 63, - 7: [1, 3], - 14: [1, 4], - 24: [1, 5], - 28: [1, 6], - 29: [1, 7], - 30: [1, 8] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [2, 30], + 28: [2, 30], + 34: [1, 26] }, { 5: [2, 29], 6: [2, 29], @@ -1094,32 +1118,50 @@ var _parser = (function() { 19: [2, 29], 20: [2, 29], 21: [2, 29], - 22: [2, 29], 23: [2, 29], - 25: [2, 29], - 27: [2, 29], - 33: [2, 29] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 29], + 26: [2, 29], + 28: [2, 29], + 34: [2, 29] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 24: [1, 64], + 34: [1, 26] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [1, 64], - 27: [2, 35], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [1, 65], + 28: [2, 35], + 34: [1, 26] }, { 5: [2, 27], 6: [2, 27], @@ -1138,42 +1180,29 @@ var _parser = (function() { 19: [2, 27], 20: [2, 27], 21: [2, 27], - 22: [2, 27], 23: [2, 27], - 25: [2, 27], - 27: [2, 27], - 33: [2, 27] + 24: [2, 27], + 26: [2, 27], + 28: [2, 27], + 34: [2, 27] }, { - 4: 65, + 4: 66, 7: [1, 3], 14: [1, 4], - 24: [1, 5], - 28: [1, 6], + 22: [1, 5], + 25: [1, 6], 29: [1, 7], - 30: [1, 8] + 30: [1, 8], + 31: [1, 9] }, { - 5: [2, 19], - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], - 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [2, 19], - 23: [2, 19], - 25: [2, 19], - 27: [2, 19], - 33: [1, 26] + 4: 67, + 7: [1, 3], + 14: [1, 4], + 22: [1, 5], + 25: [1, 6], + 29: [1, 7], + 30: [1, 8], + 31: [1, 9] }, { 5: [2, 21], 6: [2, 21], @@ -1192,35 +1221,57 @@ var _parser = (function() { 19: [2, 21], 20: [2, 21], 21: [2, 21], - 22: [2, 21], 23: [2, 21], - 25: [2, 21], - 27: [2, 21], - 33: [2, 21] - }, { - 6: [1, 10], - 7: [1, 11], - 8: [1, 12], - 9: [1, 13], - 10: [1, 14], - 11: [1, 15], - 12: [1, 16], - 13: [1, 17], + 24: [2, 21], + 26: [2, 21], + 28: [2, 21], + 34: [2, 21] + }, { + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], 14: [1, 27], - 15: [1, 18], - 16: [1, 19], - 17: [1, 20], - 18: [1, 21], - 19: [1, 22], - 20: [1, 23], - 21: [1, 24], - 22: [1, 25], - 25: [2, 31], - 27: [2, 31], - 33: [1, 26] + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 26: [2, 31], + 28: [2, 31], + 34: [1, 26] + }, { + 5: [2, 19], + 6: [1, 11], + 7: [1, 12], + 8: [1, 13], + 9: [1, 14], + 10: [1, 15], + 11: [1, 16], + 12: [1, 17], + 13: [1, 18], + 14: [1, 27], + 15: [1, 19], + 16: [1, 20], + 17: [1, 21], + 18: [1, 22], + 19: [1, 23], + 20: [1, 24], + 21: [1, 25], + 23: [2, 19], + 24: [2, 19], + 26: [2, 19], + 28: [2, 19], + 34: [1, 26] }], defaultActions: { - 9: [2, 1] + 10: [2, 1] }, parseError: function parseError(str, hash) { throw new Error(str); @@ -1658,52 +1709,55 @@ var _parser = (function() { return ">"; break; case 16: - return "?"; + return "and"; break; case 17: - return ":"; + return "or"; break; case 18: - return "and"; + return "not"; break; case 19: - return "or"; + return "in"; break; case 20: - return "not"; + return "of"; break; case 21: - return "in"; + return "if"; break; case 22: - return "of"; + return "then"; break; case 23: + return "else"; break; case 24: - return "NUMBER"; break; case 25: + return "NUMBER"; + break; + case 26: yy_.yytext = JSON.stringify(yy_.yytext); return "SYMBOL"; break; - case 26: + case 27: yy_.yytext = yy.buildString("'", yy_.yytext); return "SYMBOL"; break; - case 27: + case 28: yy_.yytext = yy.buildString('"', yy_.yytext); return "STRING"; break; - case 28: + case 29: return "EOF"; break; } }; - lexer.rules = [/^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\%)/, /^(?:\()/, /^(?:\))/, /^(?:\,)/, /^(?:==)/, /^(?:\!=)/, /^(?:\~=)/, /^(?:>=)/, /^(?:<=)/, /^(?:<)/, /^(?:>)/, /^(?:\?)/, /^(?:\:)/, /^(?:and[^\w])/, /^(?:or[^\w])/, /^(?:not[^\w])/, /^(?:in[^\w])/, /^(?:of[^\w])/, /^(?:\s+)/, /^(?:[0-9]+(?:\.[0-9]+)?\b)/, /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/, /^(?:'(?:\\'|\\\\|[^'\\])*')/, /^(?:"(?:\\"|\\\\|[^"\\])*")/, /^(?:$)/]; + lexer.rules = [/^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\%)/, /^(?:\()/, /^(?:\))/, /^(?:\,)/, /^(?:==)/, /^(?:\!=)/, /^(?:\~=)/, /^(?:>=)/, /^(?:<=)/, /^(?:<)/, /^(?:>)/, /^(?:and[^\w])/, /^(?:or[^\w])/, /^(?:not[^\w])/, /^(?:in[^\w])/, /^(?:of[^\w])/, /^(?:if[^\w])/, /^(?:then[^\w])/, /^(?:else[^\w])/, /^(?:\s+)/, /^(?:[0-9]+(?:\.[0-9]+)?\b)/, /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/, /^(?:'(?:\\'|\\\\|[^'\\])*')/, /^(?:"(?:\\"|\\\\|[^"\\])*")/, /^(?:$)/]; lexer.conditions = { "INITIAL": { - "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28], + "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "inclusive": true } }; diff --git a/src/filtrex.mjs b/src/filtrex.mjs index 30323cd..06613b6 100644 --- a/src/filtrex.mjs +++ b/src/filtrex.mjs @@ -168,12 +168,18 @@ export function compileExpression(expression, options) { // Metaprogramming functions function prop(name, obj) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } function safeGetter(obj) { return function get(name) { - return hasOwnProperty(obj||{}, name) ? obj[name] : undefined; + if (hasOwnProperty(obj||{}, name)) + return obj[name]; + + throw new ReferenceError(`Property “${name}” does not exist.`) } } diff --git a/src/generateParser.js b/src/generateParser.js index 3cec9e2..1245d96 100644 --- a/src/generateParser.js +++ b/src/generateParser.js @@ -1,16 +1,6 @@ const Jison = require("./lib/jison").Jison; -function _code(args, skipParentheses) { - var argsJs = args.map(function(a) { - return typeof(a) == 'number' ? ('$' + a) : JSON.stringify(a); - }).join(','); - - return skipParentheses - ? '$$ = [' + argsJs + '];' - : '$$ = ["(", ' + argsJs + ', ")"];'; -} - -function code(fragments, ...params) { +function _code(fragments, params, skipParentheses) { const args = [] for (let i = 0; i < fragments.length - 1; i++) { @@ -20,20 +10,21 @@ function code(fragments, ...params) { args.push(fragments[fragments.length - 1]) - return _code(args, false) -} - -function parenless(fragments, ...params) { - const args = [] + const argsJs = args.map(function(a) { + return typeof(a) == 'number' ? ('$' + a) : JSON.stringify(a); + }).join(','); - for (let i = 0; i < fragments.length - 1; i++) { - args.push(fragments[i]) - args.push(params[i]) - } + return skipParentheses + ? '$$ = [' + argsJs + '];' + : '$$ = ["(", ' + argsJs + ', ")"];'; +} - args.push(fragments[fragments.length - 1]) +function code(fragments, ...params) { + return _code(fragments, params, false) +} - return _code(args, true) +function parenless(fragments, ...params) { + return _code(fragments, params, true) } const bool = "std.coerceBoolean" @@ -59,13 +50,14 @@ const grammar = { ['<=', 'return "<=";'], ['<', 'return "<";'], ['>', 'return ">";'], - ['\\?', 'return "?";'], - ['\\:', 'return ":";'], ['and[^\\w]', 'return "and";'], ['or[^\\w]' , 'return "or";'], ['not[^\\w]', 'return "not";'], ['in[^\\w]', 'return "in";'], ['of[^\\w]', 'return "of";'], + ['if[^\\w]', 'return "if";'], + ['then[^\\w]', 'return "then";'], + ['else[^\\w]', 'return "else";'], ['\\s+', ''], // skip whitespace ['[0-9]+(?:\\.[0-9]+)?\\b', 'return "NUMBER";'], // 212.321 @@ -95,7 +87,7 @@ const grammar = { // Different languages have different rules, but this seems a good starting // point: http://en.wikipedia.org/wiki/Order_of_operations#Programming_languages operators: [ - ['left', '?', ':'], + ['left', 'if', 'then', 'else'], ['left', 'or'], ['left', 'and'], ['left', 'in'], @@ -131,7 +123,7 @@ const grammar = { ['e <= e' , code`${1} <= ${3}`], ['e > e' , code`${1} > ${3}`], ['e >= e' , code`${1} >= ${3}`], - ['e ? e : e', code`${1} ? ${3} : ${5}`], + ['if e then e else e', code`${bool}(${2}) ? ${4} : ${6}`], ['( e )' , code`${2}`], ['( array , e )', code`[ ${2}, ${4} ]`], ['NUMBER' , code`${1}`], diff --git a/test/arithmetics.js b/test/arithmetics.js index aa9f6d9..6e8bab7 100644 --- a/test/arithmetics.js +++ b/test/arithmetics.js @@ -93,4 +93,4 @@ describe('Arithmetics', () => { expect( eval('not T and F', obj) ).equals(false); }); -}); \ No newline at end of file +}); diff --git a/test/misc.js b/test/misc.js index 93d544c..5f0bf37 100644 --- a/test/misc.js +++ b/test/misc.js @@ -16,8 +16,6 @@ const eval = (str, obj) => compileExpression(str)(obj); describe('Various other things', () => { - - it('in / not in', () => { // value in array expect( eval('5 in (1, 2, 3, 4)') ).equals(false); @@ -68,12 +66,12 @@ describe('Various other things', () => { }); it('ternary operator', () => { - expect( eval('1 > 2 ? 3 : 4') ).equals(4); - expect( eval('1 < 2 ? 3 : 4') ).equals(3); + expect( eval('if 1 > 2 then 3 else 4') ).equals(4); + expect( eval('if 1 < 2 then 3 else 4') ).equals(3); }); it('kitchensink', () => { - var kitchenSink = compileExpression('4 > lowNumber * 2 and (max(a, b) < 20 or foo) ? 1.1 : 9.4'); + var kitchenSink = compileExpression('if 4 > lowNumber * 2 and (max(a, b) < 20 or foo) then 1.1 else 9.4'); expect( kitchenSink({lowNumber: 1.5, a: 10, b: 12, foo: false}) ).equals(1.1); expect( kitchenSink({lowNumber: 3.5, a: 10, b: 12, foo: false}) ).equals(9.4); }); diff --git a/test/objects.js b/test/objects.js index 64473bd..5d7cf76 100644 --- a/test/objects.js +++ b/test/objects.js @@ -39,8 +39,8 @@ describe('Object support', () => { {'Danube.Steamboat.Shipping.Company': {'the captain': {hat: "epic"}}} )).equals("epic"); - expect(compileExpression('something of nothing')({})).equals(undefined); - expect(compileExpression('toString of something')({ something: {}})).equals(undefined); + expect(compileExpression('something of nothing')({ nothing: undefined })).is.instanceOf(ReferenceError); + expect(compileExpression('toString of something')({ something: {}})).is.instanceOf(ReferenceError); }); -}); \ No newline at end of file +}); diff --git a/test/security.js b/test/security.js index 5299f17..a5fdff7 100644 --- a/test/security.js +++ b/test/security.js @@ -8,11 +8,7 @@ const { expect } = require("chai"); describe('Security', () => { it('cannot access prototype symbols of data', () => - expect( - compileExpression('toString')({}) - ).equals( - undefined - ) + expect(compileExpression('toString')({})).is.instanceOf(ReferenceError) ); @@ -33,7 +29,7 @@ describe('Security', () => { it('cannot access properties of the data prototype', () => - expect( compileExpression('a')(Object.create({a: 42})) ).equals(undefined) + expect( compileExpression('a')(Object.create({a: 42})) ).is.instanceOf(ReferenceError) ); @@ -88,8 +84,8 @@ describe('Security', () => { it('blocks prototype access in custom property function', () => { expect( compileExpression('a', { customProp: (name, get) => get(name) }) - (Object.create({ a:1 })) - ).equals(undefined); + (Object.create({ a: 1 })) + ).is.instanceOf(ReferenceError); }); @@ -104,4 +100,4 @@ describe('Security', () => { expect( f ).does.not.throw(); expect( f() ).is.instanceOf(Error); }); -}); \ No newline at end of file +}); diff --git a/test/strict.js b/test/strict.js new file mode 100644 index 0000000..b108110 --- /dev/null +++ b/test/strict.js @@ -0,0 +1,16 @@ +const { compileExpression } = require("../dist/cjs/filtrex"); + +const { describe, it } = require("mocha"); +const { expect } = require("chai"); + +const eval = (str, obj) => compileExpression(str)(obj); + +describe('Strict type checking', () => { + + it('checks for booleans', () => { + expect(eval('1 == 1 and 1')).is.instanceOf(TypeError) + expect(eval('1 or 1 != 1')).is.instanceOf(TypeError) + expect(eval('not "hello"')).is.instanceOf(TypeError) + }) + +})