Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9
@@ -0,5 +1,15 @@ | ||
## 1.0.0-alpha.9 (March 5, 2019) | ||
- Added support for numbers with exponent | ||
- Added support for strings as property name in object literals | ||
- Fixed edge cases with suggestions around keywords and inside functions | ||
- Allowed `-` and `+` operators to be unary | ||
- Renamed `get` buildin method to `map` | ||
- Changed `~=` operator to take any value as tester (not a regexp only); when value is a function it's behaves like `filter()`, when `null` or `undefined` it's always truthy otherwise falsy | ||
- Changed `group()` method to group by an element when key value is an array | ||
## 1.0.0-alpha.8 (February 7, 2019) | ||
- Reworked tolerant parsing mode, less failures and better suggestions | ||
- Reworked lib building, lib size reduced from 64Kb to 37Kb | ||
- Reworked lib building, lib size reduced from 71Kb to 39Kb | ||
- Fixed a function parsing, now it's greedy and a parentheses needed **only** around expressions with `>` operator when used outside braces, since `>` will end a function definition (i.e. `<a > 20>` causes to a parse error, but `<(a > 20)>` or `<foo.[a > 20]>` is not) | ||
@@ -6,0 +16,0 @@ - Allowed a block inside a function, i.e. function can be empty (returns a `current` in this case) and definitions are allowed in function's body |
@@ -1,1 +0,1 @@ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jora=t()}}(function(){return function(){return function t(e,n,r){function s(a,c){if(!n[a]){if(!e[a]){var o="function"==typeof require&&require;if(!c&&o)return o(a,!0);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){return s(e[a][1][t]||t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)s(r[a]);return s}}()({1:[function(t,e,n){var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[2,4],n=[1,12],r=[1,28],s=[1,8],i=[1,30],a=[1,20],c=[1,15],o=[1,16],h=[1,17],u=[1,18],l=[1,21],f=[1,22],y=[1,23],p=[1,24],g=[1,25],d=[1,29],b=[1,31],k=[1,32],m=[1,33],_=[1,34],$=[1,36],v=[1,35],O=[1,19],x=[5,17,60,70],S=[1,40],A=[1,41],E=[1,42],N=[1,43],w=[1,44],P=[1,45],I=[1,46],j=[1,47],T=[1,48],R=[1,49],F=[1,50],L=[1,51],U=[1,52],D=[1,53],M=[1,54],B=[1,55],q=[1,56],z=[1,57],C=[1,58],H=[5,10,12,15,16,17,21,41,42,43,44,47,48,49,50,51,54,55,57,58,59,60,61,63,69,70],G=[5,11,13,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,60,62,64,70],Y=[1,59],W=[1,60],X=[1,61],V=[1,62],Z=[1,63],J=[1,64],K=[5,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,54,55,57,58,59,60,61,70],Q=[2,47],tt=[5,11,13,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,54,55,57,58,59,60,61,62,64,70],et=[1,70],nt=[1,82],rt=[1,81],st=[1,83],it=[1,84],at=[2,48],ct=[5,11,13,17,26,27,28,60,62,64,70],ot=[62,64],ht=[5,11,13,17,22,23,24,25,26,27,28,60,62,64,70],ut=[5,11,13,17,22,23,24,25,26,27,28,29,30,34,35,36,37,38,39,40,60,62,64,70],lt=[5,11,13,17,22,23,24,25,26,27,28,34,35,40,60,62,64,70],ft=[5,11,13,17,22,23,24,25,26,27,28,34,35,36,37,38,39,40,60,62,64,70],yt=[1,144],pt=[17,62],gt={trace:function(){},yy:{},symbols_:{error:2,root:3,block:4,EOF:5,nonEmptyBlock:6,definitions:7,e:8,def:9,$:10,";":11,SYMBOL:12,":":13,query:14,SELF:15,"(":16,")":17,keyword:18,function:19,op:20,NOT:21,IN:22,HAS:23,NOTIN:24,HASNO:25,AND:26,OR:27,"?":28,"+":29,"-":30,"*":31,"/":32,"%":33,"=":34,"!=":35,"<":36,"<=":37,">":38,">=":39,"~=":40,TRUE:41,FALSE:42,NULL:43,UNDEFINED:44,queryRoot:45,relativePath:46,"@":47,"#":48,STRING:49,NUMBER:50,REGEXP:51,object:52,array:53,".":54,".(":55,arguments:56,"..":57,"..(":58,".[":59,"]":60,"[":61,",":62,"{":63,"}":64,properties:65,property:66,"...":67,arrayItems:68,FUNCTION_START:69,FUNCTION_END:70,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",10:"$",11:";",12:"SYMBOL",13:":",15:"SELF",16:"(",17:")",21:"NOT",22:"IN",23:"HAS",24:"NOTIN",25:"HASNO",26:"AND",27:"OR",28:"?",29:"+",30:"-",31:"*",32:"/",33:"%",34:"=",35:"!=",36:"<",37:"<=",38:">",39:">=",40:"~=",41:"TRUE",42:"FALSE",43:"NULL",44:"UNDEFINED",47:"@",48:"#",49:"STRING",50:"NUMBER",51:"REGEXP",54:".",55:".(",57:"..",58:"..(",59:".[",60:"]",61:"[",62:",",63:"{",64:"}",67:"...",69:"FUNCTION_START",70:"FUNCTION_END"},productions_:[0,[3,2],[4,1],[4,1],[4,0],[6,2],[6,1],[7,1],[7,2],[9,2],[9,3],[9,5],[8,1],[8,1],[8,3],[8,4],[8,1],[8,1],[8,1],[20,2],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,5],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[18,1],[18,1],[18,1],[18,1],[14,1],[14,1],[45,1],[45,1],[45,1],[45,2],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,2],[45,3],[45,3],[45,3],[45,4],[45,4],[45,5],[45,2],[45,3],[45,3],[46,3],[46,5],[46,6],[46,4],[46,3],[46,4],[46,4],[46,4],[56,1],[56,3],[52,2],[52,3],[65,1],[65,3],[66,1],[66,1],[66,2],[66,3],[66,5],[66,1],[66,2],[53,2],[53,3],[68,1],[68,3],[19,3]],performAction:function(t,e,n,r,s,i,a){var c=i.length-1;switch(s){case 1:return this.$={ast:i[c-1],commentRanges:r.commentRanges};case 2:this.$=["/*scope*/",i[c]];break;case 3:this.$=["/*scope*/",i[c],"\nreturn current"];break;case 4:this.$=["/*scope*/","return ","/*s*/","current","/*"+this._$.range+",*/"];break;case 5:this.$=[i[c-1],"\nreturn ",i[c]];break;case 6:this.$=["return ",i[c]];break;case 7:case 12:case 16:case 17:case 18:case 43:case 44:case 49:case 50:case 51:case 52:case 53:case 73:case 77:case 88:this.$=[i[c]];break;case 8:this.$=[i[c-1],"\n",i[c]];break;case 9:this.$=["/*s*/","current","/*"+a[c-1].range+",key*/",";"];break;case 10:this.$=["/*define:"+a[c-1].range+"*/","const $",i[c-1]," = fn.get(","/*s*/","current","/*"+a[c-1].range+",key*/",', "',i[c-1],'");'];break;case 11:this.$=["/*define:"+a[c-3].range+"*/","const $",i[c-3]," = ",i[c-1],";"];break;case 13:this.$=["current => self(current, context)"];break;case 14:this.$=["self(current, context)"];break;case 15:this.$=["self(",i[c-1],", context)"];break;case 19:this.$=["!fn.bool(",i[c],")"];break;case 20:this.$=["fn.in(",i[c-2],", ","/*s*/",i[c],"/*"+a[c-2].range+",in-value*/",")"];break;case 21:this.$=["fn.in(",i[c],", ","/*s*/",i[c-2],"/*"+a[c].range+",in-value*/",")"];break;case 22:this.$=["!fn.in(",i[c-2],", ",i[c],")"];break;case 23:this.$=["!fn.in(",i[c],", ",i[c-2],")"];break;case 24:this.$=["fn.bool(tmp = ",i[c-2],") ? ",i[c]," : tmp"];break;case 25:this.$=["fn.bool(tmp = ",i[c-2],") ? tmp : ",i[c]];break;case 26:this.$=["fn.bool(",i[c-4],") ? ",i[c-2]," : ",i[c]];break;case 27:this.$=["fn.add(",i[c-2],", ",i[c],")"];break;case 28:this.$=["fn.sub(",i[c-2],", ",i[c],")"];break;case 29:this.$=["fn.mul(",i[c-2],", ",i[c],")"];break;case 30:this.$=["fn.div(",i[c-2],", ",i[c],")"];break;case 31:this.$=["fn.mod(",i[c-2],", ",i[c],")"];break;case 32:this.$=["fn.eq(","/*s*/",i[c-2],"/*"+a[c].range+",value*/",", ",i[c],")"];break;case 33:this.$=["fn.ne(","/*s*/",i[c-2],"/*"+a[c].range+",value*/",", ",i[c],")"];break;case 34:this.$=["fn.lt(",i[c-2],", ",i[c],")"];break;case 35:this.$=["fn.lte(",i[c-2],", ",i[c],")"];break;case 36:this.$=["fn.gt(",i[c-2],", ",i[c],")"];break;case 37:this.$=["fn.gte(",i[c-2],", ",i[c],")"];break;case 38:this.$=["fn.regexp(",i[c-2],", ",i[c],")"];break;case 39:this.$=["true"];break;case 40:this.$=["false"];break;case 41:this.$=["null"];break;case 42:this.$=["undefined"];break;case 45:this.$=["data"];break;case 46:this.$=["context"];break;case 47:this.$=["/*var:"+a[c].range+"*/","current"];break;case 48:this.$=["/*var:"+this._$.range+"*/","typeof $",i[c]," !== 'undefined' ? $",i[c]," : undefined"];break;case 54:this.$=["/*var:"+a[c].range+"*/","fn.get(","/*s*/","current","/*"+a[c].range+",*/",', "',i[c],"\", 'xxx')"];break;case 55:this.$=["fn.get(","/*s*/","current","/*"+a[c].range+",*/",', "',i[c],'")'];break;case 56:this.$=["(",i[c-1],")"];break;case 57:this.$=["fn.get(current, current => { ",i[c-1]," })"];break;case 58:case 60:this.$=["method.",i[c-2],"(","/*s*/","current","/*"+a[c-2].range+",,"+a[c-1].range+",*/",")"];break;case 59:case 61:this.$=["method.",i[c-3],"(","/*s*/","current","/*"+a[c-3].range+",*/",", ",i[c-1],")"];break;case 62:this.$=["fn.recursive(","/*s*/","current","/*"+a[c].range+",*/",', "',i[c],'")'];break;case 63:this.$=["fn.recursive(current, current => { ",i[c-1]," })"];break;case 64:this.$=["fn.filter(current, current => { ",i[c-1]," })"];break;case 65:this.$=["fn.get(","/*s*/",i[c-2],"/*"+a[c].range+",*/",', "',i[c],'")'];break;case 66:this.$=["method.",i[c-2],"(","/*s*/",i[c-4],"/*"+a[c-2].range+",,"+a[c-1].range+",*/",")"];break;case 67:this.$=["method.",i[c-3],"(","/*s*/",i[c-5],"/*"+a[c-3].range+",*/",", ",i[c-1],")"];break;case 68:this.$=["fn.get(",i[c-3],", current => { ",i[c-1]," })"];break;case 69:this.$=["fn.recursive(","/*s*/",i[c-2],"/*"+a[c].range+",*/",', "',i[c],'")'];break;case 70:this.$=["fn.recursive(",i[c-3],", current => { ",i[c-1]," })"];break;case 71:this.$=["fn.filter(",i[c-3],", current => { ",i[c-1]," })"];break;case 72:this.$=["fn.get(",i[c-3],", ",i[c-1],")"];break;case 74:case 78:case 89:this.$=[i[c-2],", ",i[c]];break;case 75:this.$=["(","/*s*/","current","/*"+a[c-1].range+",*/",", {})"];break;case 76:this.$=["({ ",i[c-1]," })"];break;case 79:this.$=["/*var:"+a[c].range+"*/",i[c],": fn.get(","/*s*/","current","/*"+a[c].range+",*/",', "',i[c],'")'];break;case 80:this.$=["[Symbol()]: ","/*var:"+this._$.range+"*/","0"];break;case 81:this.$=["/*var:"+this._$.range+"*/",i[c],": typeof $",i[c]," !== 'undefined' ? $",i[c]," : undefined"];break;case 82:this.$=[i[c-2],": ",i[c]];break;case 83:this.$=["[",i[c-3],"]: ",i[c]];break;case 84:this.$=["...","/*var:"+a[c].range+"*/","/*s*/","current","/*"+a[c].range+",*/"];break;case 85:this.$=["...",i[c]];break;case 86:this.$=["(","/*s*/","current","/*"+a[c-1].range+",*/",", [])"];break;case 87:this.$=["[",i[c-1],"]"];break;case 90:this.$=["current => { ",i[c-1]," }"]}},table:[{3:1,4:2,5:e,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{1:[3]},{5:[1,37]},t(x,[2,2]),t(x,[2,3],{14:7,18:9,19:10,20:11,45:13,46:14,52:26,53:27,8:38,9:39,10:n,12:r,15:s,16:i,21:a,41:c,42:o,43:h,44:u,47:l,48:f,49:y,50:p,51:g,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O}),t(x,[2,6],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(H,[2,7]),t(G,[2,12],{54:Y,55:W,57:X,58:V,59:Z,61:J}),t(G,[2,13],{16:[1,65]}),t(G,[2,16]),t(G,[2,17]),t(G,[2,18]),t(K,Q,{11:[1,66],12:[1,67]}),t(tt,[2,43]),t(tt,[2,44]),t(G,[2,39]),t(G,[2,40]),t(G,[2,41]),t(G,[2,42]),{4:68,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O,70:e},{8:69,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(tt,[2,45]),t(tt,[2,46]),t(tt,[2,49]),t(tt,[2,50]),t(tt,[2,51]),t(tt,[2,52]),t(tt,[2,53]),t(tt,[2,54],{16:[1,71]}),{12:[1,72]},{8:73,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{4:74,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{12:[1,75]},{4:76,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{4:77,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,60:e,61:$,63:v,69:O},{10:nt,12:rt,61:st,64:[1,78],65:79,66:80,67:it},{8:87,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,60:[1,85],61:$,63:v,68:86,69:O},{1:[2,1]},t(x,[2,5],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(H,[2,8]),{8:88,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:89,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:90,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:91,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:92,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:93,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:94,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:95,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:96,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:97,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:98,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:99,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:100,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:101,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:102,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:103,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:104,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:105,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:106,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{12:[1,107]},{4:108,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{12:[1,109]},{4:110,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{4:111,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,60:e,61:$,63:v,69:O},{8:112,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:114,10:et,12:r,14:7,15:s,16:i,17:[1,113],18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(H,[2,9]),t(K,at,{11:[1,115],13:[1,116]}),{70:[1,117]},t(ct,[2,19],{22:S,23:A,24:E,25:N,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(tt,Q,{12:[1,118]}),{8:121,10:et,12:r,14:7,15:s,16:i,17:[1,119],18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,56:120,57:k,58:m,59:_,61:$,63:v,69:O},t(tt,[2,55],{16:[1,122]}),{17:[1,123],22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C},{17:[1,124]},t(tt,[2,62]),{17:[1,125]},{60:[1,126]},t(tt,[2,75]),{62:[1,128],64:[1,127]},t(ot,[2,77]),t(ot,[2,79],{13:[1,129]}),t(ot,[2,80],{12:[1,130]}),{8:131,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(ot,[2,84],{45:13,46:14,52:26,53:27,14:132,10:et,12:r,16:i,47:l,48:f,49:y,50:p,51:g,54:d,55:b,57:k,58:m,59:_,61:$,63:v}),t(tt,[2,86]),{60:[1,133]},{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C,60:[2,88],62:[1,134]},t(ht,[2,20],{29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(ht,[2,21],{29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(ht,[2,22],{29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(ht,[2,23],{29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(ct,[2,24],{22:S,23:A,24:E,25:N,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t([5,11,13,17,27,28,60,62,64,70],[2,25],{22:S,23:A,24:E,25:N,26:w,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),{13:[1,135],22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C},t(ut,[2,27],{31:R,32:F,33:L}),t(ut,[2,28],{31:R,32:F,33:L}),t(G,[2,29]),t(G,[2,30]),t(G,[2,31]),t(lt,[2,32],{29:j,30:T,31:R,32:F,33:L,36:M,37:B,38:q,39:z}),t(lt,[2,33],{29:j,30:T,31:R,32:F,33:L,36:M,37:B,38:q,39:z}),t(ft,[2,34],{29:j,30:T,31:R,32:F,33:L}),t(ft,[2,35],{29:j,30:T,31:R,32:F,33:L}),t(ft,[2,36],{29:j,30:T,31:R,32:F,33:L}),t(ft,[2,37],{29:j,30:T,31:R,32:F,33:L}),t(lt,[2,38],{29:j,30:T,31:R,32:F,33:L,36:M,37:B,38:q,39:z}),t(tt,[2,65],{16:[1,136]}),{17:[1,137]},t(tt,[2,69]),{17:[1,138]},{60:[1,139]},{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C,60:[1,140]},t(G,[2,14]),{17:[1,141],22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C},t(H,[2,10]),{8:142,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(G,[2,90]),t(tt,at),t(tt,[2,58]),{17:[1,143],62:yt},t(pt,[2,73],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),{8:121,10:et,12:r,14:7,15:s,16:i,17:[1,145],18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,56:146,57:k,58:m,59:_,61:$,63:v,69:O},t(tt,[2,56]),t(tt,[2,57]),t(tt,[2,63]),t(tt,[2,64]),t(tt,[2,76]),{10:nt,12:rt,61:st,66:147,67:it},{8:148,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(ot,[2,81]),{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C,60:[1,149]},t(ot,[2,85],{54:Y,55:W,57:X,58:V,59:Z,61:J}),t(tt,[2,87]),{8:87,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,68:150,69:O},{8:151,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},{8:121,10:et,12:r,14:7,15:s,16:i,17:[1,152],18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,56:153,57:k,58:m,59:_,61:$,63:v,69:O},t(tt,[2,68]),t(tt,[2,70]),t(tt,[2,71]),t(tt,[2,72]),t(G,[2,15]),{11:[1,154],22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C},t(tt,[2,59]),{8:155,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(tt,[2,60]),{17:[1,156],62:yt},t(ot,[2,78]),t(ot,[2,82],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),{13:[1,157]},{60:[2,89]},t([5,11,13,17,60,62,64,70],[2,26],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(tt,[2,66]),{17:[1,158],62:yt},t(H,[2,11]),t(pt,[2,74],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C}),t(tt,[2,61]),{8:159,10:et,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,41:c,42:o,43:h,44:u,45:13,46:14,47:l,48:f,49:y,50:p,51:g,52:26,53:27,54:d,55:b,57:k,58:m,59:_,61:$,63:v,69:O},t(tt,[2,67]),t(ot,[2,83],{22:S,23:A,24:E,25:N,26:w,27:P,28:I,29:j,30:T,31:R,32:F,33:L,34:U,35:D,36:M,37:B,38:q,39:z,40:C})],defaultActions:{37:[2,1],150:[2,89]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],s=[],i=this.table,a="",c=0,o=0,h=0,u=s.slice.call(arguments,1),l=Object.create(this.lexer),f={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(f.yy[y]=this.yy[y]);l.setInput(t,f.yy),f.yy.lexer=l,f.yy.parser=this,void 0===l.yylloc&&(l.yylloc={});var p=l.yylloc;s.push(p);var g=l.options&&l.options.ranges;"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var d,b,k,m,_,$,v,O,x,S=function(){var t;return"number"!=typeof(t=l.lex()||1)&&(t=e.symbols_[t]||t),t},A={};;){if(k=n[n.length-1],this.defaultActions[k]?m=this.defaultActions[k]:(null!==d&&void 0!==d||(d=S()),m=i[k]&&i[k][d]),void 0===m||!m.length||!m[0]){var E="";for($ in x=[],i[k])this.terminals_[$]&&$>2&&x.push("'"+this.terminals_[$]+"'");E=l.showPosition?"Parse error on line "+(c+1)+":\n"+l.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(E,{text:l.match,token:this.terminals_[d]||d,line:l.yylineno,loc:p,expected:x})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+d);switch(m[0]){case 1:n.push(d),r.push(l.yytext),s.push(l.yylloc),n.push(m[1]),d=null,b?(d=b,b=null):(o=l.yyleng,a=l.yytext,c=l.yylineno,p=l.yylloc,h>0&&h--);break;case 2:if(v=this.productions_[m[1]][1],A.$=r[r.length-v],A._$={first_line:s[s.length-(v||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(v||1)].first_column,last_column:s[s.length-1].last_column},g&&(A._$.range=[s[s.length-(v||1)].range[0],s[s.length-1].range[1]]),void 0!==(_=this.performAction.apply(A,[a,o,c,f.yy,m[1],r,s].concat(u))))return _;v&&(n=n.slice(0,-1*v*2),r=r.slice(0,-1*v),s=s.slice(0,-1*v)),n.push(this.productions_[m[1]][0]),r.push(A.$),s.push(A._$),O=i[n[n.length-2]][n[n.length-1]],n.push(O);break;case 3:return!0}}return!0}},dt={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=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),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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},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+"^"},test_match:function(t,e){var n,r,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if((n=this._input.match(this.rules[s[i]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[r]))&&t:""===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 t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{ranges:!0},performAction:function(t,e,n,r){switch(n){case 0:t.commentRanges.push(e.yylloc.range);break;case 1:break;case 2:return this.popState(),"/";case 3:return this.popState(),"<";case 4:this.done=!1,this.popState();break;case 5:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"(";case 6:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),")";case 7:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"[";case 8:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"]";case 9:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"{";case 10:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"}";case 11:return"TRUE";case 12:return"FALSE";case 13:return"NULL";case 14:return"UNDEFINED";case 15:return"AND";case 16:return"OR";case 17:return"HASNO";case 18:return"HAS";case 19:return"IN";case 20:return"NOTIN";case 21:return"NOT";case 22:return this._input&&this.begin("preventPrimitive"),"@";case 23:return this._input&&this.begin("preventPrimitive"),"#";case 24:return this._input&&this.begin("preventPrimitive"),"$";case 25:return"SELF";case 26:return this._input&&this.begin("preventPrimitive"),"NUMBER";case 27:case 28:return this._input&&this.begin("preventPrimitive"),"STRING";case 29:return this._input&&this.begin("preventPrimitive"),"REGEXP";case 30:return this._input&&this.begin("preventPrimitive"),"SYMBOL";case 31:return this.fnOpened++,"FUNCTION_START";case 32:return"=";case 33:return"!=";case 34:return"~=";case 35:return">=";case 36:return"<=";case 37:return"<";case 38:return this.fnOpened?(this.fnOpened--,"FUNCTION_END"):">";case 39:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"..(";case 40:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".(";case 41:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".[";case 42:return"...";case 43:return this._input&&this.begin("preventPrimitive"),"..";case 44:return this._input&&this.begin("preventPrimitive"),".";case 45:return"?";case 46:return",";case 47:return":";case 48:return";";case 49:return"-";case 50:return"+";case 51:return"*";case 52:return"/";case 53:return"%";case 54:return"EOF"}},rules:[/^(?:(\/\/.*?(\r|\n|$)+))/,/^(?:(\s+))/,/^(?:\/)/,/^(?:<(?!=))/,/^(?:)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:true(\b))/,/^(?:false(\b))/,/^(?:null(\b))/,/^(?:undefined(\b))/,/^(?:and(\b))/,/^(?:or(\b))/,/^(?:has(\s+)no(\b))/,/^(?:has(\b))/,/^(?:in(\b))/,/^(?:not(\s+)in(\b))/,/^(?:not?(\b))/,/^(?:@)/,/^(?:#)/,/^(?:\$)/,/^(?:::self)/,/^(?:\d+(?:\.\d+)?(\b))/,/^(?:"(?:\\.|[^"])*")/,/^(?:'(?:\\.|[^'])*')/,/^(?:(\/(?:\\.|[^\/])+\/i?))/,/^(?:[a-zA-Z_][a-zA-Z_$0-9]*)/,/^(?:<(?!=))/,/^(?:=)/,/^(?:!=)/,/^(?:~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:\.\.\()/,/^(?:\.\()/,/^(?:\.\[)/,/^(?:\.\.\.)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\?)/,/^(?:,)/,/^(?::)/,/^(?:;)/,/^(?:\-)/,/^(?:\+)/,/^(?:\*)/,/^(?:\/)/,/^(?:\%)/,/^(?:$)/],conditions:{preventPrimitive:{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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],inclusive:!0},INITIAL:{rules:[0,1,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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],inclusive:!0}}};function bt(){this.yy={}}return gt.lexer=dt,bt.prototype=gt,gt.Parser=bt,new bt}();e.exports=function(t){function e(t,e){Object.entries(e).forEach(([e,n])=>t[e]=n(t[e]))}const n=new t.Parser;return n.lexer=Object.assign({},t.lexer),[t.lexer,n.lexer].forEach(t=>e(t,{setInput:t=>(function(e,n){return this.fnOpened=0,this.fnOpenedStack=[],n.commentRanges=[],t.call(this,e,n)})})),e(n.lexer,{lex:t=>{let e=null,n={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]};const r=["AND","OR","IN","NOTIN","HAS","HASNO","NOT"],s=["+","-","*","/","%","=","!=","~=",">=","<=","<",">"],i=[null,":",";",",",".","..",...s,...r],a=new Set([",","?",":",";","EOF","]",")","}",...s,...r]),c=i.reduce((t,e)=>t.set(e,a),new Map);return c.set("{",new Set([","])),c.set("[",new Set([","])),function s(){this.lex=t;const i=this.lex(this);if(this.lex=s,c.has(e)&&c.get(e).has(i)){const t={first_line:n.last_line,last_line:this.yylloc.first_line,first_column:n.last_column,last_column:this.yylloc.first_column,range:[n.range[1],this.yylloc.range[0]]};return this.unput(this.yytext),this.done=!1,this.yytext="_",this.yylloc=n=t,this.pushState("preventPrimitive"),e="SYMBOL"}if(n=this.yylloc,r.includes(i))switch(this._input[0]){case" ":case"\t":n=Object.assign({},n,{last_column:n.last_column+1,range:[n.range[0],n.range[1]+1]});break;case"\n":n=Object.assign({},n,{last_line:n.last_line+1,last_column:0,range:[n.range[0],n.range[1]+1]})}return e=i}}}),t.strict=t,t.tolerant=n,t}(r)},{}],2:[function(t,e,n){e.exports={version:"1.0.0-alpha.8"}},{}],3:[function(t,e,n){const{addToSet:r,getPropertyValue:s,isPlainObject:i}=t("./utils");e.exports=Object.freeze({bool:function(t){if(Array.isArray(t))return t.length>0;if(i(t)){for(const e in t)if(hasOwnProperty.call(t,e))return!0;return!1}return Boolean(t)},and:function(t,e){return this.bool(t)?e:t},or:function(t,e){return this.bool(t)?t:e},add:function(t,e){return Array.isArray(t)||Array.isArray(e)?[...new Set([].concat(t,e))]:t+e},sub:function(t,e){if(Array.isArray(t)){const n=new Set(t);return Array.isArray(e)?e.forEach(t=>n.delete(t)):n.delete(e),[...n]}return t-e},mul:function(t,e){return t*e},div:function(t,e){return t/e},mod:function(t,e){return t%e},eq:function(t,e){return t===e},ne:function(t,e){return t!==e},lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e},in:function(t,e){return i(e)?hasOwnProperty.call(e,t):!(!e||"function"!=typeof e.indexOf)&&-1!==e.indexOf(t)},regexp:function(t,e){return Array.isArray(t)?this.filter(t,t=>e.test(t)):e.test(t)},get:function(t,e){const n="function"==typeof e?e:t=>s(t,e);return Array.isArray(t)?[...t.reduce((t,e)=>r(t,n(e)),new Set)]:void 0!==t?n(t):t},recursive:function(t,e){const n=new Set;return r(n,this.get(t,e)),n.forEach(t=>r(n,this.get(t,e))),[...n]},filter:function(t,e){return Array.isArray(t)?t.filter(t=>this.bool(e(t))):this.bool(e(t))?t:void 0}})},{"./utils":6}],4:[function(t,e,n){const r=t("./buildin"),s=t("./methods"),{strict:i,tolerant:a}=t("./parser"),{addToSet:c,isPlainObject:o}=t("./utils"),h=new Map,u=new Map,l=new Map,f=new Map,y={path:"property",key:"property",value:"value","in-value":"value",var:"variable"};function p(t,e){const n=t.charCodeAt(e);return 9===n||10===n||13===n||32===n}function g(t,e,n,r){const s=[];for(let i=0;i<n.length;i++){const[a,c,o]=n[i];for(let n=0;n<c.length;n+=2){let i=c[n],h=c[n+1];if(e>=i&&e<=h&&(r||a.size||a.length)){let n=t.substring(i,h);/\S/.test(n)||(n="",i=h=e),s.push({context:o,current:n,from:i,to:h,values:a})}}}return s}e.exports=function(t,e){e=e||{};const n=Boolean(e.debug),d=Boolean(e.stat),b=Boolean(e.tolerant),k=e.methods?Object.assign({},s,e.methods):s,m=d?b?f:u:b?l:h;let _;return t=String(t),m.has(t)?_=m.get(t):(_=function(t,e,n,r){function s(e,n){const r=[];for(let t=0;t<h.length;t++){const[s,i]=h[t];if(s>n)break;s<e||(s===e?r.push(e,e):r.push(e,s),e=i)}return e===t.length&&f||r.push(e,n),r}r&&(console.log("\n== compile ======"),console.log("source:",t));const c=n?a:i,{ast:o,commentRanges:h}=c.parse(t),u=[],l=[],f=h.length&&h[h.length-1][1]===t.length&&!/[\r\n]$/.test(t);let y=[],g=[];return function n(r,i){if(Array.isArray(r)){const e=r[0];let s=!1,a=0;if("/*scope*/"===e)i=i.slice(),a++;else if("string"==typeof e&&e.startsWith("/*define:")){let[n,r]=e.substring(9,e.length-2).split(",");if(s=t.substring(n,r),i.includes(`"${s}"`))throw new Error(`Identifier '$${s}' has already been declared`);a++}for(;a<r.length;a++)n(r[a],i);s&&i.push(`"${s}"`)}else if(e&&r.startsWith("/*"))if("/*s*/"===r)u.push("suggestPoint(");else if(r.startsWith("/*var:")){let[e,n]=r.substring(6,r.length-2).split(",");if(e===n)for(;n<t.length&&p(t,n);)n++;l.push(`[[${i}], [${s(e,n)}], "var"]`)}else{const e=y.push("sp"+y.length+" = new Set()")-1,n=r.substring(2,r.length-2).split(",");for(let r=0;r<n.length;r+=3){let i=Number(n[r]),a=Number(n[r+1]),c=n[r+2];const o=t.substring(i,a);if(".["===o||".("===o||"..("===o||"{"===o||"["===o||"("===o||"..."===o||i===a)for(i=a;a<t.length&&p(t,a);)a++;l.push(`[sp${e}, [${s(i,a)}], "${c||"path"}"]`)}u.push(`, sp${e})`)}else u.push(r)}(o,[]),y.length&&g.push("const "+y.join(", ")+";","const suggestPoint = (value, set) => set.add(value) && value;"),g.push("const $data = undefined, $context = undefined, $ctx = undefined, $array = undefined, $idx = undefined, $index = undefined;","let current = data;","let tmp;",u.join("")),e&&g.push(`,[${l}]`),r&&console.log("== body =========\n"+g.join("\n")+"\n=================\n"),new Function("fn","method","data","context","self",g.join("\n"))}(t,d,b,n),m.set(t,_)),n&&console.log("fn",_.toString()),d?function e(n,s){const i=_(r,k,n,s,e);return{stat(e,n){const r=g(t,e,i,n);return r.forEach(t=>{t.values=[...t.values]}),r.length?r:null},suggestion(e,n){const r=[];return g(t,e,i,n).forEach(t=>{const{context:e,current:n,from:s,to:i,values:a}=t;r.push(...function(t,e){const n=new Set,r=t=>{switch(typeof t){case"string":n.add(JSON.stringify(t));break;case"number":n.add(String(t))}};switch(t){case"":case"path":e.forEach(t=>{Array.isArray(t)?t.forEach(t=>{o(t)&&c(n,Object.keys(t))}):o(t)&&c(n,Object.keys(t))});break;case"key":e.forEach(t=>{o(t)&&c(n,Object.keys(t))});break;case"value":e.forEach(t=>{Array.isArray(t)?t.forEach(r):r(t)});break;case"in-value":e.forEach(t=>{Array.isArray(t)?t.forEach(r):o(t)?Object.keys(t).forEach(r):r(t)});break;case"var":e.forEach(t=>{n.add("$"+t)})}return[...n]}(e,a).map(t=>({current:n,type:y[e],value:t,from:s,to:i})))}),r.length?r:null}}}:function t(e,n){return _(r,k,e,n,t)}},e.exports.version=t("../package.json").version,e.exports.buildin=r,e.exports.methods=s},{"../package.json":2,"./buildin":3,"./methods":5,"./parser":1,"./utils":6}],5:[function(t,e,n){const r=t("./buildin"),{addToSet:s,isPlainObject:i}=t("./utils");function a(){}function c(t){return t}e.exports=Object.freeze({bool:r.bool,filter:r.filter,map:r.get,keys:function(t){return Object.keys(t||{})},values:function(t){const e=new Set;for(const n in t)hasOwnProperty.call(t,n)&&s(e,t[n]);return[...e]},entries:function(t){const e=[];for(const n in t)hasOwnProperty.call(t,n)&&e.push({key:n,value:t[n]});return e},pick:function(t,e){if(t){if("function"!=typeof e)return Array.isArray(t)?t[e||0]:t[e];if(Array.isArray(t))return t.find(t=>e(t));for(const n in t)if(hasOwnProperty.call(t,n)&&e(t[n]))return{key:n,value:t[n]}}},mapToArray:function(t,e="key",n){const r=[];for(const s in t)hasOwnProperty.call(t,s)&&r.push(n?{[e]:s,[n]:t[s]}:Object.assign({[e]:s},t[s]));return r},size:function(t){switch(!0){case Array.isArray(t):return t.length;case i(t):return Object.keys(t).length;default:return t&&t.length||0}},sort:function(t,e){return Array.isArray(t)?"function"==typeof e?t.slice().sort((t,n)=>{if(t=e(t),n=e(n),Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return t.length<n.length?-1:1;for(let e=0;e<t.length;e++){if(t[e]<n[e])return-1;if(t[e]>n[e])return 1}return 0}return t<n?-1:t>n}):t.slice().sort():t},reverse:function(t){return Array.isArray(t)?t.slice().reverse():t},group:function(t,e,n){"function"!=typeof e&&(e=a),"function"!=typeof n&&(n=c),Array.isArray(t)||(t=[t]);const r=new Map,s=[];return t.forEach(t=>{const s=e(t);r.has(s)?r.get(s).add(n(t)):r.set(s,new Set([n(t)]))}),r.forEach((t,e)=>s.push({key:e,value:[...t]})),s}})},{"./buildin":3,"./utils":6}],6:[function(t,e,n){e.exports={addToSet:function(t,e){return void 0!==e&&(Array.isArray(e)?e.forEach(e=>t.add(e)):t.add(e)),t},getPropertyValue:function(t,e){return t&&hasOwnProperty.call(t,e)?t[e]:void 0},isPlainObject:function(t){return t&&"object"==typeof t&&t.constructor===Object}}},{}]},{},[4])(4)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jora=t()}}(function(){return function(){return function t(e,n,r){function s(a,c){if(!n[a]){if(!e[a]){var o="function"==typeof require&&require;if(!c&&o)return o(a,!0);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){return s(e[a][1][t]||t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)s(r[a]);return s}}()({1:[function(t,e,n){var r=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[2,4],n=[1,12],r=[1,30],s=[1,8],i=[1,32],a=[1,20],c=[1,21],o=[1,22],h=[1,15],l=[1,16],u=[1,17],f=[1,18],p=[1,23],y=[1,24],g=[1,25],d=[1,26],b=[1,27],k=[1,31],m=[1,33],_=[1,34],v=[1,35],$=[1,36],O=[1,38],x=[1,37],S=[1,19],A=[5,17,60,70],E=[1,50],N=[1,49],w=[1,42],P=[1,43],I=[1,44],T=[1,45],j=[1,46],R=[1,47],F=[1,48],L=[1,51],U=[1,52],Y=[1,53],D=[1,54],M=[1,55],B=[1,56],z=[1,57],q=[1,58],C=[1,59],H=[1,60],G=[5,10,12,15,16,17,21,22,23,41,42,43,44,47,48,49,50,51,54,55,57,58,59,60,61,63,69,70],W=[5,11,13,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,60,62,64,70],X=[1,61],Z=[1,62],V=[1,63],J=[1,64],K=[1,65],Q=[1,66],tt=[5,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,54,55,57,58,59,60,61,70],et=[2,49],nt=[5,11,13,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,54,55,57,58,59,60,61,62,64,70],rt=[1,72],st=[1,86],it=[1,85],at=[1,87],ct=[1,88],ot=[1,89],ht=[2,50],lt=[5,11,13,17,28,29,30,60,62,64,70],ut=[5,11,13,17,22,23,24,25,26,27,28,29,30,34,35,36,37,38,39,40,60,62,64,70],ft=[62,64],pt=[5,11,13,17,24,25,26,27,28,29,30,60,62,64,70],yt=[5,11,13,17,24,25,26,27,28,29,30,34,35,40,60,62,64,70],gt=[5,11,13,17,24,25,26,27,28,29,30,34,35,36,37,38,39,40,60,62,64,70],dt=[1,150],bt=[17,62],kt={trace:function(){},yy:{},symbols_:{error:2,root:3,block:4,EOF:5,nonEmptyBlock:6,definitions:7,e:8,def:9,$:10,";":11,SYMBOL:12,":":13,query:14,SELF:15,"(":16,")":17,keyword:18,function:19,op:20,NOT:21,"-":22,"+":23,IN:24,HAS:25,NOTIN:26,HASNO:27,AND:28,OR:29,"?":30,"*":31,"/":32,"%":33,"=":34,"!=":35,"<":36,"<=":37,">":38,">=":39,"~=":40,TRUE:41,FALSE:42,NULL:43,UNDEFINED:44,queryRoot:45,relativePath:46,"@":47,"#":48,STRING:49,NUMBER:50,REGEXP:51,object:52,array:53,".":54,".(":55,arguments:56,"..":57,"..(":58,".[":59,"]":60,"[":61,",":62,"{":63,"}":64,properties:65,property:66,"...":67,arrayItems:68,FUNCTION_START:69,FUNCTION_END:70,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",10:"$",11:";",12:"SYMBOL",13:":",15:"SELF",16:"(",17:")",21:"NOT",22:"-",23:"+",24:"IN",25:"HAS",26:"NOTIN",27:"HASNO",28:"AND",29:"OR",30:"?",31:"*",32:"/",33:"%",34:"=",35:"!=",36:"<",37:"<=",38:">",39:">=",40:"~=",41:"TRUE",42:"FALSE",43:"NULL",44:"UNDEFINED",47:"@",48:"#",49:"STRING",50:"NUMBER",51:"REGEXP",54:".",55:".(",57:"..",58:"..(",59:".[",60:"]",61:"[",62:",",63:"{",64:"}",67:"...",69:"FUNCTION_START",70:"FUNCTION_END"},productions_:[0,[3,2],[4,1],[4,1],[4,0],[6,2],[6,1],[7,1],[7,2],[9,2],[9,3],[9,5],[8,1],[8,1],[8,3],[8,4],[8,1],[8,1],[8,1],[20,2],[20,2],[20,2],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,5],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[18,1],[18,1],[18,1],[18,1],[14,1],[14,1],[45,1],[45,1],[45,1],[45,2],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,2],[45,3],[45,3],[45,3],[45,4],[45,4],[45,5],[45,2],[45,3],[45,3],[46,3],[46,5],[46,6],[46,4],[46,3],[46,4],[46,4],[46,4],[56,1],[56,3],[52,2],[52,3],[65,1],[65,3],[66,1],[66,1],[66,2],[66,3],[66,3],[66,5],[66,1],[66,2],[53,2],[53,3],[68,1],[68,3],[19,3]],performAction:function(t,e,n,r,s,i,a){var c=i.length-1;switch(s){case 1:return this.$={ast:i[c-1],commentRanges:r.commentRanges};case 2:this.$=["/*scope*/",i[c]];break;case 3:this.$=["/*scope*/",i[c],"\nreturn current"];break;case 4:this.$=["/*scope*/","return ","/*sp:"+this._$.range+",*/","current","/**/"];break;case 5:this.$=[i[c-1],"\nreturn ",i[c]];break;case 6:this.$=["return ",i[c]];break;case 7:case 12:case 16:case 17:case 18:case 45:case 46:case 51:case 52:case 53:case 54:case 55:case 75:case 79:case 91:this.$=[i[c]];break;case 8:this.$=[i[c-1],"\n",i[c]];break;case 9:this.$=["/*sp:"+a[c-1].range+",key*/","current","/**/",";"];break;case 10:this.$=["/*define:"+a[c-1].range+"*/","const $",i[c-1]," = fn.map(","/*sp:"+a[c-1].range+",key*/","current","/**/",', "',i[c-1],'");'];break;case 11:this.$=["/*define:"+a[c-3].range+"*/","const $",i[c-3]," = ",i[c-1],";"];break;case 13:this.$=["current => self(current, context)"];break;case 14:this.$=["self(current, context)"];break;case 15:this.$=["self(",i[c-1],", context)"];break;case 19:this.$=["!fn.bool(",i[c],")"];break;case 20:this.$=["-",i[c]];break;case 21:this.$=["+",i[c]];break;case 22:this.$=["fn.in(",i[c-2],", ","/*sp:"+a[c-2].range+",in-value*/",i[c],"/**/",")"];break;case 23:this.$=["fn.in(",i[c],", ","/*sp:"+a[c].range+",in-value*/",i[c-2],"/**/",")"];break;case 24:this.$=["!fn.in(",i[c-2],", ",i[c],")"];break;case 25:this.$=["!fn.in(",i[c],", ",i[c-2],")"];break;case 26:this.$=["fn.bool(tmp = ",i[c-2],") ? ",i[c]," : tmp"];break;case 27:this.$=["fn.bool(tmp = ",i[c-2],") ? tmp : ",i[c]];break;case 28:this.$=["fn.bool(",i[c-4],") ? ",i[c-2]," : ",i[c]];break;case 29:this.$=["fn.add(",i[c-2],", ",i[c],")"];break;case 30:this.$=["fn.sub(",i[c-2],", ",i[c],")"];break;case 31:this.$=["fn.mul(",i[c-2],", ",i[c],")"];break;case 32:this.$=["fn.div(",i[c-2],", ",i[c],")"];break;case 33:this.$=["fn.mod(",i[c-2],", ",i[c],")"];break;case 34:this.$=["fn.eq(","/*sp:"+a[c].range+",value*/",i[c-2],"/**/",", ",i[c],")"];break;case 35:this.$=["fn.ne(","/*sp:"+a[c].range+",value*/",i[c-2],"/**/",", ",i[c],")"];break;case 36:this.$=["fn.lt(",i[c-2],", ",i[c],")"];break;case 37:this.$=["fn.lte(",i[c-2],", ",i[c],")"];break;case 38:this.$=["fn.gt(",i[c-2],", ",i[c],")"];break;case 39:this.$=["fn.gte(",i[c-2],", ",i[c],")"];break;case 40:this.$=["fn.match(",i[c-2],", ",i[c],")"];break;case 41:this.$=["true"];break;case 42:this.$=["false"];break;case 43:this.$=["null"];break;case 44:this.$=["undefined"];break;case 47:this.$=["data"];break;case 48:this.$=["context"];break;case 49:this.$=["/*var:"+a[c].range+"*/","current"];break;case 50:this.$=["/*var:"+this._$.range+"*/","typeof $",i[c]," !== 'undefined' ? $",i[c]," : undefined"];break;case 56:this.$=["/*var:"+a[c].range+"*/","fn.map(","/*sp:"+a[c].range+",*/","current","/**/",', "',i[c],"\", 'xxx')"];break;case 57:this.$=["fn.map(","/*sp:"+a[c].range+",*/","current","/**/",', "',i[c],'")'];break;case 58:this.$=["(",i[c-1],")"];break;case 59:this.$=["fn.map(current, current => { ",i[c-1]," })"];break;case 60:case 62:this.$=["method.",i[c-2],"(","/*sp:"+a[c-2].range+",,"+a[c-1].range+",*/","current","/**/",")"];break;case 61:case 63:this.$=["method.",i[c-3],"(","/*sp:"+a[c-3].range+",*/","current","/**/",", ",i[c-1],")"];break;case 64:this.$=["fn.recursive(","/*sp:"+a[c].range+",*/","current","/**/",', "',i[c],'")'];break;case 65:this.$=["fn.recursive(current, current => { ",i[c-1]," })"];break;case 66:this.$=["fn.filter(current, current => { ",i[c-1]," })"];break;case 67:this.$=["fn.map(","/*sp:"+a[c].range+",*/",i[c-2],"/**/",', "',i[c],'")'];break;case 68:this.$=["method.",i[c-2],"(","/*sp:"+a[c-2].range+",,"+a[c-1].range+",*/",i[c-4],"/**/",")"];break;case 69:this.$=["method.",i[c-3],"(","/*sp:"+a[c-3].range+",*/",i[c-5],"/**/",", ",i[c-1],")"];break;case 70:this.$=["fn.map(",i[c-3],", current => { ",i[c-1]," })"];break;case 71:this.$=["fn.recursive(","/*sp:"+a[c].range+",*/",i[c-2],"/**/",', "',i[c],'")'];break;case 72:this.$=["fn.recursive(",i[c-3],", current => { ",i[c-1]," })"];break;case 73:this.$=["fn.filter(",i[c-3],", current => { ",i[c-1]," })"];break;case 74:this.$=["fn.map(",i[c-3],", ",i[c-1],")"];break;case 76:case 80:case 92:this.$=[i[c-2],", ",i[c]];break;case 77:this.$=["(","/*sp:"+a[c-1].range+",*/","current","/**/",", {})"];break;case 78:this.$=["({ ",i[c-1]," })"];break;case 81:this.$=["/*var:"+a[c].range+"*/",i[c],": fn.map(","/*sp:"+a[c].range+",*/","current","/**/",', "',i[c],'")'];break;case 82:this.$=["[Symbol()]: ","/*var:"+this._$.range+"*/","0"];break;case 83:this.$=["/*var:"+this._$.range+"*/",i[c],": typeof $",i[c]," !== 'undefined' ? $",i[c]," : undefined"];break;case 84:case 85:this.$=[i[c-2],": ",i[c]];break;case 86:this.$=["[",i[c-3],"]: ",i[c]];break;case 87:this.$=["...","/*var:"+a[c].range+"*/","/*sp:"+a[c].range+",*/","current","/**/"];break;case 88:this.$=["...",i[c]];break;case 89:this.$=["(","/*sp:"+a[c-1].range+",*/","current","/**/",", [])"];break;case 90:this.$=["[",i[c-1],"]"];break;case 93:this.$=["current => { ",i[c-1]," }"]}},table:[{3:1,4:2,5:e,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{1:[3]},{5:[1,39]},t(A,[2,2]),t(A,[2,3],{14:7,18:9,19:10,20:11,45:13,46:14,52:28,53:29,8:40,9:41,10:n,12:r,15:s,16:i,21:a,22:c,23:o,41:h,42:l,43:u,44:f,47:p,48:y,49:g,50:d,51:b,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S}),t(A,[2,6],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(G,[2,7]),t(W,[2,12],{54:X,55:Z,57:V,58:J,59:K,61:Q}),t(W,[2,13],{16:[1,67]}),t(W,[2,16]),t(W,[2,17]),t(W,[2,18]),t(tt,et,{11:[1,68],12:[1,69]}),t(nt,[2,45]),t(nt,[2,46]),t(W,[2,41]),t(W,[2,42]),t(W,[2,43]),t(W,[2,44]),{4:70,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S,70:e},{8:71,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:73,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:74,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(nt,[2,47]),t(nt,[2,48]),t(nt,[2,51]),t(nt,[2,52]),t(nt,[2,53]),t(nt,[2,54]),t(nt,[2,55]),t(nt,[2,56],{16:[1,75]}),{12:[1,76]},{8:77,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{4:78,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{12:[1,79]},{4:80,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{4:81,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,60:e,61:O,63:x,69:S},{10:st,12:it,49:at,61:ct,64:[1,82],65:83,66:84,67:ot},{8:92,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,60:[1,90],61:O,63:x,68:91,69:S},{1:[2,1]},t(A,[2,5],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(G,[2,8]),{8:93,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:94,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:95,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:96,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:97,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:98,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:99,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:100,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:101,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:102,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:103,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:104,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:105,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:106,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:107,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:108,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:109,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:110,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:111,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{12:[1,112]},{4:113,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{12:[1,114]},{4:115,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,17:e,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{4:116,6:3,7:4,8:5,9:6,10:n,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,60:e,61:O,63:x,69:S},{8:117,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:119,10:rt,12:r,14:7,15:s,16:i,17:[1,118],18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(G,[2,9]),t(tt,ht,{11:[1,120],13:[1,121]}),{70:[1,122]},t(lt,[2,19],{22:E,23:N,24:w,25:P,26:I,27:T,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(nt,et,{12:[1,123]}),t(ut,[2,20],{31:L,32:U,33:Y}),t(ut,[2,21],{31:L,32:U,33:Y}),{8:126,10:rt,12:r,14:7,15:s,16:i,17:[1,124],18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,56:125,57:_,58:v,59:$,61:O,63:x,69:S},t(nt,[2,57],{16:[1,127]}),{17:[1,128],22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H},{17:[1,129]},t(nt,[2,64]),{17:[1,130]},{60:[1,131]},t(nt,[2,77]),{62:[1,133],64:[1,132]},t(ft,[2,79]),t(ft,[2,81],{13:[1,134]}),t(ft,[2,82],{12:[1,135]}),{13:[1,136]},{8:137,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(ft,[2,87],{45:13,46:14,52:28,53:29,14:138,10:rt,12:r,16:i,47:p,48:y,49:g,50:d,51:b,54:k,55:m,57:_,58:v,59:$,61:O,63:x}),t(nt,[2,89]),{60:[1,139]},{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H,60:[2,91],62:[1,140]},t(pt,[2,22],{22:E,23:N,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(pt,[2,23],{22:E,23:N,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(pt,[2,24],{22:E,23:N,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(pt,[2,25],{22:E,23:N,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(lt,[2,26],{22:E,23:N,24:w,25:P,26:I,27:T,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t([5,11,13,17,29,30,60,62,64,70],[2,27],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),{13:[1,141],22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H},t(ut,[2,29],{31:L,32:U,33:Y}),t(ut,[2,30],{31:L,32:U,33:Y}),t(W,[2,31]),t(W,[2,32]),t(W,[2,33]),t(yt,[2,34],{22:E,23:N,31:L,32:U,33:Y,36:B,37:z,38:q,39:C}),t(yt,[2,35],{22:E,23:N,31:L,32:U,33:Y,36:B,37:z,38:q,39:C}),t(gt,[2,36],{22:E,23:N,31:L,32:U,33:Y}),t(gt,[2,37],{22:E,23:N,31:L,32:U,33:Y}),t(gt,[2,38],{22:E,23:N,31:L,32:U,33:Y}),t(gt,[2,39],{22:E,23:N,31:L,32:U,33:Y}),t(yt,[2,40],{22:E,23:N,31:L,32:U,33:Y,36:B,37:z,38:q,39:C}),t(nt,[2,67],{16:[1,142]}),{17:[1,143]},t(nt,[2,71]),{17:[1,144]},{60:[1,145]},{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H,60:[1,146]},t(W,[2,14]),{17:[1,147],22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H},t(G,[2,10]),{8:148,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(W,[2,93]),t(nt,ht),t(nt,[2,60]),{17:[1,149],62:dt},t(bt,[2,75],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),{8:126,10:rt,12:r,14:7,15:s,16:i,17:[1,151],18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,56:152,57:_,58:v,59:$,61:O,63:x,69:S},t(nt,[2,58]),t(nt,[2,59]),t(nt,[2,65]),t(nt,[2,66]),t(nt,[2,78]),{10:st,12:it,49:at,61:ct,66:153,67:ot},{8:154,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(ft,[2,83]),{8:155,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H,60:[1,156]},t(ft,[2,88],{54:X,55:Z,57:V,58:J,59:K,61:Q}),t(nt,[2,90]),{8:92,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,68:157,69:S},{8:158,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},{8:126,10:rt,12:r,14:7,15:s,16:i,17:[1,159],18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,56:160,57:_,58:v,59:$,61:O,63:x,69:S},t(nt,[2,70]),t(nt,[2,72]),t(nt,[2,73]),t(nt,[2,74]),t(W,[2,15]),{11:[1,161],22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H},t(nt,[2,61]),{8:162,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(nt,[2,62]),{17:[1,163],62:dt},t(ft,[2,80]),t(ft,[2,84],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(ft,[2,85],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),{13:[1,164]},{60:[2,92]},t([5,11,13,17,60,62,64,70],[2,28],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(nt,[2,68]),{17:[1,165],62:dt},t(G,[2,11]),t(bt,[2,76],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H}),t(nt,[2,63]),{8:166,10:rt,12:r,14:7,15:s,16:i,18:9,19:10,20:11,21:a,22:c,23:o,41:h,42:l,43:u,44:f,45:13,46:14,47:p,48:y,49:g,50:d,51:b,52:28,53:29,54:k,55:m,57:_,58:v,59:$,61:O,63:x,69:S},t(nt,[2,69]),t(ft,[2,86],{22:E,23:N,24:w,25:P,26:I,27:T,28:j,29:R,30:F,31:L,32:U,33:Y,34:D,35:M,36:B,37:z,38:q,39:C,40:H})],defaultActions:{39:[2,1],157:[2,92]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],s=[],i=this.table,a="",c=0,o=0,h=0,l=s.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(f.yy[p]=this.yy[p]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;s.push(y);var g=u.options&&u.options.ranges;"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var d,b,k,m,_,v,$,O,x,S=function(){var t;return"number"!=typeof(t=u.lex()||1)&&(t=e.symbols_[t]||t),t},A={};;){if(k=n[n.length-1],this.defaultActions[k]?m=this.defaultActions[k]:(null!==d&&void 0!==d||(d=S()),m=i[k]&&i[k][d]),void 0===m||!m.length||!m[0]){var E="";for(v in x=[],i[k])this.terminals_[v]&&v>2&&x.push("'"+this.terminals_[v]+"'");E=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(E,{text:u.match,token:this.terminals_[d]||d,line:u.yylineno,loc:y,expected:x})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+d);switch(m[0]){case 1:n.push(d),r.push(u.yytext),s.push(u.yylloc),n.push(m[1]),d=null,b?(d=b,b=null):(o=u.yyleng,a=u.yytext,c=u.yylineno,y=u.yylloc,h>0&&h--);break;case 2:if($=this.productions_[m[1]][1],A.$=r[r.length-$],A._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},g&&(A._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),void 0!==(_=this.performAction.apply(A,[a,o,c,f.yy,m[1],r,s].concat(l))))return _;$&&(n=n.slice(0,-1*$*2),r=r.slice(0,-1*$),s=s.slice(0,-1*$)),n.push(this.productions_[m[1]][0]),r.push(A.$),s.push(A._$),O=i[n[n.length-2]][n[n.length-1]],n.push(O);break;case 3:return!0}}return!0}},mt={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=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),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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},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+"^"},test_match:function(t,e){var n,r,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if((n=this._input.match(this.rules[s[i]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[r]))&&t:""===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 t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{ranges:!0},performAction:function(t,e,n,r){switch(n){case 0:t.commentRanges.push(e.yylloc.range);break;case 1:break;case 2:return this.popState(),"/";case 3:return this.popState(),"<";case 4:this.done=!1,this.popState();break;case 5:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"(";case 6:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),")";case 7:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"[";case 8:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"]";case 9:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"{";case 10:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"}";case 11:return"TRUE";case 12:return"FALSE";case 13:return"NULL";case 14:return"UNDEFINED";case 15:return"AND";case 16:return"OR";case 17:return"HASNO";case 18:return"HAS";case 19:return"IN";case 20:return"NOTIN";case 21:return"NOT";case 22:return this._input&&this.begin("preventPrimitive"),"@";case 23:return this._input&&this.begin("preventPrimitive"),"#";case 24:return this._input&&this.begin("preventPrimitive"),"$";case 25:return"SELF";case 26:return this._input&&this.begin("preventPrimitive"),"NUMBER";case 27:case 28:return this._input&&this.begin("preventPrimitive"),"STRING";case 29:return this._input&&this.begin("preventPrimitive"),"REGEXP";case 30:return this._input&&this.begin("preventPrimitive"),"SYMBOL";case 31:return this.fnOpened++,"FUNCTION_START";case 32:return"=";case 33:return"!=";case 34:return"~=";case 35:return">=";case 36:return"<=";case 37:return"<";case 38:return this.fnOpened?(this.fnOpened--,"FUNCTION_END"):">";case 39:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"..(";case 40:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".(";case 41:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".[";case 42:return"...";case 43:return this._input&&this.begin("preventPrimitive"),"..";case 44:return this._input&&this.begin("preventPrimitive"),".";case 45:return"?";case 46:return",";case 47:return":";case 48:return";";case 49:return"-";case 50:return"+";case 51:return"*";case 52:return"/";case 53:return"%";case 54:return"EOF"}},rules:[/^(?:(\/\/.*?(\r|\n|$)))/,/^(?:(\s+))/,/^(?:\/)/,/^(?:<(?!=))/,/^(?:)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:true(\b))/,/^(?:false(\b))/,/^(?:null(\b))/,/^(?:undefined(\b))/,/^(?:and(\b))/,/^(?:or(\b))/,/^(?:has(\s+)no(\b))/,/^(?:has(\b))/,/^(?:in(\b))/,/^(?:not(\s+)in(\b))/,/^(?:not?(\b))/,/^(?:@)/,/^(?:#)/,/^(?:\$)/,/^(?:::self)/,/^(?:\d+(?:\.\d+)?([eE][-+]?\d+)?(\b))/,/^(?:"(?:\\.|[^"])*")/,/^(?:'(?:\\.|[^'])*')/,/^(?:(\/(?:\\.|[^\/])+\/i?))/,/^(?:[a-zA-Z_][a-zA-Z_$0-9]*)/,/^(?:<(?!=))/,/^(?:=)/,/^(?:!=)/,/^(?:~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:\.\.\()/,/^(?:\.\()/,/^(?:\.\[)/,/^(?:\.\.\.)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\?)/,/^(?:,)/,/^(?::)/,/^(?:;)/,/^(?:\-)/,/^(?:\+)/,/^(?:\*)/,/^(?:\/)/,/^(?:\%)/,/^(?:$)/],conditions:{preventPrimitive:{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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],inclusive:!0},INITIAL:{rules:[0,1,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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],inclusive:!0}}};function _t(){this.yy={}}return kt.lexer=mt,_t.prototype=kt,kt.Parser=_t,new _t}();e.exports=function(t){function e(t,e){Object.entries(e).forEach(([e,n])=>t[e]=n(t[e]))}const n=new t.Parser;n.lexer=Object.assign({},t.lexer),[t.lexer,n.lexer].forEach(t=>e(t,{setInput:t=>(function(e,n){return n.commentRanges=[],this.fnOpened=0,this.fnOpenedStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},t.call(this,e,n)})}));const r=["AND","OR","IN","NOTIN","HAS","HASNO"],s=[...r,"NOT"],i=["+","-","*","/","%","=","!=","~=",">=","<=","<",">"],a=[null,":",";",",",".","..",...i,...r,"NOT"],c=new Set([",","?",":",";","EOF","]",")","}",...i,...r]),o=a.reduce((t,e)=>t.set(e,c),new Map);return o.set("{",new Set([","])),o.set("[",new Set([","])),o.set("(",new Set([","])),e(n.lexer,{lex:t=>(function e(){this.lex=t;const n=this._input,r=this.lex(this);if(this.lex=e,o.has(this.prevToken)&&o.get(this.prevToken).has(r)){const t={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.yytext),this.pushState("preventPrimitive"),this.done=!1,this.yytext="_",this.yylloc=this.prevYylloc=t,n!==this._input&&s.includes(r)){const e=n.length-this._input.length-1;switch(n[e]){case" ":case"\t":t.last_column--,t.range[1]--;break;case"\n":{const r=n.lastIndexOf("\n",e-1);t.last_line--,t.last_column=-1===r?t.last_column-1:e-r,t.range[1]--;break}}}return this.prevToken="SYMBOL"}if(this.prevYylloc=this.yylloc,s.includes(r))switch(this._input[0]){case" ":case"\t":this.prevYylloc=Object.assign({},this.prevYylloc,{last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]});break;case"\n":this.prevYylloc=Object.assign({},this.prevYylloc,{last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]})}return this.prevToken=r})}),t.strict=t,t.tolerant=n,t}(r)},{}],2:[function(t,e,n){e.exports={version:"1.0.0-alpha.9"}},{}],3:[function(t,e,n){const{addToSet:r,getPropertyValue:s,isPlainObject:i,isRegExp:a}=t("./utils");e.exports=Object.freeze({bool:function(t){if(Array.isArray(t))return t.length>0;if(i(t)){for(const e in t)if(hasOwnProperty.call(t,e))return!0;return!1}return Boolean(t)},and:function(t,e){return this.bool(t)?e:t},or:function(t,e){return this.bool(t)?t:e},add:function(t,e){return Array.isArray(t)||Array.isArray(e)?[...new Set([].concat(t,e))]:t+e},sub:function(t,e){if(Array.isArray(t)){const n=new Set(t);return Array.isArray(e)?e.forEach(t=>n.delete(t)):n.delete(e),[...n]}return t-e},mul:function(t,e){return t*e},div:function(t,e){return t/e},mod:function(t,e){return t%e},eq:function(t,e){return t===e},ne:function(t,e){return t!==e},lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e},in:function(t,e){return i(e)?hasOwnProperty.call(e,t):!(!e||"function"!=typeof e.indexOf)&&-1!==e.indexOf(t)},match:function(t,e){return"function"==typeof e?this.filter(t,e):a(e)?this.filter(t,e.test.bind(e)):null===e||void 0===e},map:function(t,e){const n="function"==typeof e?e:t=>s(t,e);return Array.isArray(t)?[...t.reduce((t,e)=>r(t,n(e)),new Set)]:void 0!==t?n(t):t},recursive:function(t,e){const n=new Set;return r(n,this.map(t,e)),n.forEach(t=>r(n,this.map(t,e))),[...n]},filter:function(t,e){return Array.isArray(t)?t.filter(t=>this.bool(e(t))):this.bool(e(t))?t:void 0}})},{"./utils":6}],4:[function(t,e,n){const r=t("./buildin"),s=t("./methods"),{strict:i,tolerant:a}=t("./parser"),{addToSet:c,isPlainObject:o}=t("./utils"),h=new Map,l=new Map,u=new Map,f=new Map,p={path:"property",key:"property",value:"value","in-value":"value",var:"variable"};function y(t,e){const n=t.charCodeAt(e);return 9===n||10===n||13===n||32===n}function g(t,e){return e>=0&&e<t.length&&/[a-zA-Z_$0-9]/.test(t[e])}function d(t,e,n,r){const s=[];for(let i=0;i<n.length;i++){const[a,c,o]=n[i];for(let n=0;n<c.length;n+=2){let i=c[n],h=c[n+1];if(e>=i&&e<=h&&(r||a.size||a.length)){let n=t.substring(i,h);/\S/.test(n)||(n="",i=h=e),s.push({context:o,current:n,from:i,to:h,values:a})}}}return s}e.exports=function(t,e){e=e||{};const n=Boolean(e.debug),b=Boolean(e.stat),k=Boolean(e.tolerant),m=e.methods?Object.assign({},s,e.methods):s,_=b?k?f:l:k?u:h;let v;return t=String(t),_.has(t)?v=_.get(t):(v=function(t,e,n,r){function s(e,n){const r=[];for(let t=0;t<h.length;t++){const[s,i]=h[t];if(s>n)break;s<e||(s===e?r.push(e,e):r.push(e,s),e=i)}return e===t.length&&f||r.push(e,n),r}r&&(console.log("\n== compile ======"),console.log("source:",t));const c=n?a:i,{ast:o,commentRanges:h}=c.parse(t),l=[],u=[],f=h.length&&h[h.length-1][1]===t.length&&!/[\r\n]$/.test(t);let p=[],d=[];return function n(r,i){if(Array.isArray(r)){const e=r[0];let s=!1,a=0;if("/*scope*/"===e)i=i.slice(),a++;else if("string"==typeof e&&e.startsWith("/*define:")){let[n,r]=e.substring(9,e.length-2).split(",");if(s=t.substring(n,r),i.includes(`"${s}"`))throw new Error(`Identifier '$${s}' has already been declared`);a++}for(;a<r.length;a++)n(r[a],i);s&&i.push(`"${s}"`)}else if(e&&r.startsWith("/*"))if(r.startsWith("/*var:")){let[e,n]=r.substring(6,r.length-2).split(",");if(e===n){if(g(t,e-1))return;for(;n<t.length-1&&y(t,n);)n++;if(g(t,n)){if(e===n)return;n--}}u.push(`[[${i}], [${s(e,n)}], "var"]`)}else if(r.startsWith("/*sp:")){const e=p.push("sp"+p.length+" = new Set()")-1,n=r.substring(5,r.length-2).split(",");for(let r=0;r<n.length;r+=3){let i=Number(n[r]),a=Number(n[r+1]),c=n[r+2];const o=t.substring(i,a);if(".["===o||".("===o||"..("===o||"{"===o||"["===o||"("===o||"<"===o||"..."===o||i===a){if(g(t,(i=a)-1))continue;for(;a<t.length-1&&y(t,a);)a++;if(g(t,a)){if(i===a)continue;a--}}u.push(`[sp${e}, [${s(i,a)}], "${c||"path"}"]`)}l.push(`suggestPoint(sp${e}, `)}else"/**/"===r&&l.push(")");else l.push(r)}(o,[]),p.length&&d.push("const "+p.join(", ")+";","const suggestPoint = (set, value) => (set.add(value), value);"),d.push("const $data = undefined, $context = undefined, $ctx = undefined, $array = undefined, $idx = undefined, $index = undefined;","let current = data;","let tmp;",l.join("")),e&&d.push(`,[${u}]`),r&&console.log("== body =========\n"+d.join("\n")+"\n=================\n"),new Function("fn","method","data","context","self",d.join("\n"))}(t,b,k,n),_.set(t,v)),n&&console.log("fn",v.toString()),b?function e(n,s){const i=v(r,m,n,s,e);return{stat(e,n){const r=d(t,e,i,n);return r.forEach(t=>{t.values=[...t.values]}),r.length?r:null},suggestion(e,n){const r=[];return d(t,e,i,n).forEach(t=>{const{context:e,current:n,from:s,to:i,values:a}=t;r.push(...function(t,e){const n=new Set,r=t=>{switch(typeof t){case"string":n.add(JSON.stringify(t));break;case"number":n.add(String(t))}};switch(t){case"":case"path":e.forEach(t=>{Array.isArray(t)?t.forEach(t=>{o(t)&&c(n,Object.keys(t))}):o(t)&&c(n,Object.keys(t))});break;case"key":e.forEach(t=>{o(t)&&c(n,Object.keys(t))});break;case"value":e.forEach(t=>{Array.isArray(t)?t.forEach(r):r(t)});break;case"in-value":e.forEach(t=>{Array.isArray(t)?t.forEach(r):o(t)?Object.keys(t).forEach(r):r(t)});break;case"var":e.forEach(t=>{n.add("$"+t)})}return[...n]}(e,a).map(t=>({current:n,type:p[e],value:t,from:s,to:i})))}),r.length?r:null}}}:function t(e,n){return v(r,m,e,n,t)}},e.exports.version=t("../package.json").version,e.exports.buildin=r,e.exports.methods=s},{"../package.json":2,"./buildin":3,"./methods":5,"./parser":1,"./utils":6}],5:[function(t,e,n){const r=t("./buildin"),{addToSet:s,isPlainObject:i}=t("./utils");function a(){}function c(t){return t}e.exports=Object.freeze({bool:r.bool,filter:r.filter,map:r.map,keys:function(t){return Object.keys(t||{})},values:function(t){const e=new Set;for(const n in t)hasOwnProperty.call(t,n)&&s(e,t[n]);return[...e]},entries:function(t){const e=[];for(const n in t)hasOwnProperty.call(t,n)&&e.push({key:n,value:t[n]});return e},pick:function(t,e){if(t){if("function"!=typeof e)return Array.isArray(t)?t[e||0]:t[e];if(Array.isArray(t))return t.find(t=>e(t));for(const n in t)if(hasOwnProperty.call(t,n)&&e(t[n]))return{key:n,value:t[n]}}},mapToArray:function(t,e="key",n){const r=[];for(const s in t)hasOwnProperty.call(t,s)&&r.push(n?{[e]:s,[n]:t[s]}:Object.assign({[e]:s},t[s]));return r},size:function(t){switch(!0){case Array.isArray(t):return t.length;case i(t):return Object.keys(t).length;default:return t&&t.length||0}},sort:function(t,e){return Array.isArray(t)?"function"==typeof e?t.slice().sort((t,n)=>{if(t=e(t),n=e(n),Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return t.length<n.length?-1:1;for(let e=0;e<t.length;e++){if(t[e]<n[e])return-1;if(t[e]>n[e])return 1}return 0}return t<n?-1:t>n}):t.slice().sort():t},reverse:function(t){return Array.isArray(t)?t.slice().reverse():t},group:function(t,e,n){"function"!=typeof e&&(e=a),"function"!=typeof n&&(n=c),Array.isArray(t)||(t=[t]);const r=new Map,s=[];return t.forEach(t=>{let s=e(t);Array.isArray(s)||(s=[s]),s.forEach(e=>{r.has(e)?r.get(e).add(n(t)):r.set(e,new Set([n(t)]))})}),r.forEach((t,e)=>s.push({key:e,value:[...t]})),s}})},{"./buildin":3,"./utils":6}],6:[function(t,e,n){const r=Object.prototype.toString;e.exports={addToSet:function(t,e){return void 0!==e&&(Array.isArray(e)?e.forEach(e=>t.add(e)):t.add(e)),t},getPropertyValue:function(t,e){return t&&hasOwnProperty.call(t,e)?t[e]:void 0},isPlainObject:function(t){return t&&"object"==typeof t&&t.constructor===Object},isRegExp:function(t){return"[object RegExp]"===r.call(t)}}},{}]},{},[4])(4)}); |
{ | ||
"name": "jora", | ||
"version": "1.0.0-alpha.8", | ||
"version": "1.0.0-alpha.9", | ||
"description": "JavaScript object query engine", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -34,4 +34,7 @@ # Jora | ||
- [ ] Method namespaces, e.g. semver, path, math etc | ||
- [ ] Syntax highlighting | ||
- [ ] Prettifier | ||
- [ ] Move jison to dev dependencies | ||
- [ ] Debugging (step by step evaluation) | ||
- [ ] Prediction a shape of data suitable for a query (touching pathes) | ||
@@ -48,5 +51,5 @@ Table of content: | ||
- [Keywords](#keywords) | ||
- [Operators](#operators) | ||
- [Comparisons](#comparisons) | ||
- [Boolean logic](#boolean-logic) | ||
- [Operators](#operators) | ||
- [Block, scope and variables](#block-scope-and-variables) | ||
@@ -180,3 +183,3 @@ - [Special variables](#special-variables) | ||
--- | --- | ||
42<br>4.222<br>-12.34e56 | Numbers | ||
42<br>-123<br>4.22<br>1e3<br>1e-2 | Numbers | ||
"string"<br>'string' | Strings | ||
@@ -190,3 +193,3 @@ /regexp/<br>/regexp/i | A JavaScript regexp, only `i` flag supported | ||
The follow keyword can be used as in JavaScript: | ||
Following keywords can be used as in JavaScript: | ||
@@ -198,2 +201,12 @@ - `true` | ||
### Operators | ||
Jora | Description | ||
--- | --- | ||
x + y | Add<br>In case one of the operands is an array it produces new array with elements from `x` and `y` excluding duplicates | ||
x - y | Subtract<br>In case one of the operands is an array with elements from `x` excluding elements from `y` | ||
x * y | Multiply | ||
x / y | Divide | ||
x % y | Modulo | ||
### Comparisons | ||
@@ -209,5 +222,3 @@ | ||
x >= y | Greater than or equal to | ||
x ~= y | Regular expression match | ||
x in [a, b, c]<br>[a, b, c] has x | Equivalent to `x === a or x === b or x === c` | ||
x not in [a, b, c]<br>[a, b, c] has no x | Equivalent to `x !== a and x !== b and x !== c` | ||
x ~= y | Match operator, behaviour depends on `y` type:<br>RegExp – test against regexp<br>function – test like `filter()`<br>`null` or `undefined` – always truthy<br>anything else – always falsy | ||
@@ -218,18 +229,10 @@ ### Boolean logic | ||
--- | --- | ||
( x ) | Explicity operator precedence | ||
x or y | Boolean `or`.<br>Equivalent to `\|\|` in JS, but `x` tests with `bool()` method | ||
x and y | Boolean `and`.<br>Equivalent to `&&` in JS, but `x` tests with `bool()` method | ||
not x | Boolean `not`.<br>Equivalent to `&&` in JS, but `x` tests with `bool()` method | ||
not x<br>no x | Boolean `not`.<br>Equivalent to `&&` in JS, but `x` tests with `bool()` method | ||
x ? y : z | If `x` is truthy than return `y` else return `z`. `x` tests with `bool()` method | ||
( x ) | Explicity operator precedence | ||
x in [a, b, c]<br>[a, b, c] has x | Equivalent to `x = a or x = b or x = c` | ||
x not in [a, b, c]<br>[a, b, c] has no x | Equivalent to `x != a and x != b and x != c` | ||
### Operators | ||
Jora | Description | ||
--- | --- | ||
x + y | Add | ||
x - y | Subtract | ||
x * y | Multiply | ||
x / y | Divide | ||
x % y | Modulo | ||
### Block, scope and variables | ||
@@ -236,0 +239,0 @@ |
const { | ||
addToSet, | ||
getPropertyValue, | ||
isPlainObject | ||
isPlainObject, | ||
isRegExp | ||
} = require('./utils'); | ||
@@ -88,10 +89,18 @@ | ||
}, | ||
regexp: function(value, rx) { | ||
if (Array.isArray(value)) { | ||
return this.filter(value, current => rx.test(current)); | ||
match: function(value, tester) { | ||
if (typeof tester === 'function') { | ||
return this.filter(value, tester); | ||
} | ||
return rx.test(value); | ||
if (isRegExp(tester)) { | ||
return this.filter(value, tester.test.bind(tester)); | ||
} | ||
if (tester === null || tester === undefined) { | ||
return true; | ||
} | ||
return false; | ||
}, | ||
get: function(value, getter) { | ||
map: function(value, getter) { | ||
const fn = typeof getter === 'function' | ||
@@ -115,6 +124,6 @@ ? getter | ||
addToSet(result, this.get(value, getter)); | ||
addToSet(result, this.map(value, getter)); | ||
result.forEach(current => | ||
addToSet(result, this.get(current, getter)) | ||
addToSet(result, this.map(current, getter)) | ||
); | ||
@@ -121,0 +130,0 @@ |
@@ -26,2 +26,10 @@ const buildin = require('./buildin'); | ||
function suggestProhitedChar(str, offset) { | ||
return ( | ||
offset >= 0 && | ||
offset < str.length && | ||
/[a-zA-Z_$0-9]/.test(str[offset]) | ||
); | ||
} | ||
function valuesToSuggestions(context, values) { | ||
@@ -189,17 +197,29 @@ const suggestions = new Set(); | ||
} else if (statMode && node.startsWith('/*')) { | ||
if (node === '/*s*/') { | ||
code.push('suggestPoint('); | ||
} else if (node.startsWith('/*var:')) { | ||
if (node.startsWith('/*var:')) { | ||
let [from, to] = node.substring(6, node.length - 2).split(','); | ||
if (from === to) { | ||
while (to < source.length && isWhiteSpace(source, to)) { | ||
// when starts on keyword/number/var end | ||
if (suggestProhitedChar(source, from - 1)) { | ||
return; | ||
} | ||
// extend a range by white spaces | ||
while (to < source.length - 1 && isWhiteSpace(source, to)) { | ||
to++; | ||
} | ||
// when ends on keyword/number/var start | ||
if (suggestProhitedChar(source, to)) { | ||
if (from === to) { | ||
return; | ||
} | ||
to--; | ||
} | ||
} | ||
suggestPoints.push(`[[${scopeVars}], [${getSuggestRanges(from, to)}], "var"]`); | ||
} else { | ||
} else if (node.startsWith('/*sp:')) { | ||
const pointId = suggestSets.push('sp' + suggestSets.length + ' = new Set()') - 1; | ||
const items = node.substring(2, node.length - 2).split(','); | ||
const items = node.substring(5, node.length - 2).split(','); | ||
@@ -214,9 +234,24 @@ // FIXME: position correction should be in parser | ||
if (frag === '.[' || frag === '.(' || frag === '..(' || | ||
frag === '{' || frag === '[' || frag === '(' || | ||
frag === '{' || frag === '[' || frag === '(' || frag === '<' || | ||
frag === '...' || | ||
from === to) { | ||
from = to; | ||
while (to < source.length && isWhiteSpace(source, to)) { | ||
// when starts on keyword/number/var end | ||
if (suggestProhitedChar(source, from - 1)) { | ||
continue; | ||
} | ||
// extend a range by white spaces | ||
while (to < source.length - 1 && isWhiteSpace(source, to)) { | ||
to++; | ||
} | ||
// when ends on keyword/number/var start | ||
if (suggestProhitedChar(source, to)) { | ||
if (from === to) { | ||
continue; | ||
} | ||
to--; | ||
} | ||
} | ||
@@ -226,4 +261,5 @@ | ||
} | ||
code.push(`, sp${pointId})`); | ||
code.push(`suggestPoint(sp${pointId}, `); | ||
} else if (node === '/**/') { | ||
code.push(')'); | ||
} | ||
@@ -260,3 +296,3 @@ } else { | ||
'const ' + suggestSets.join(', ') + ';', | ||
'const suggestPoint = (value, set) => set.add(value) && value;' | ||
'const suggestPoint = (set, value) => (set.add(value), value);' | ||
); | ||
@@ -317,4 +353,4 @@ } | ||
ranges.forEach(entry => { | ||
entry.values = [...entry.values]; | ||
ranges.forEach(range => { | ||
range.values = [...range.values]; | ||
}); | ||
@@ -321,0 +357,0 @@ |
@@ -16,3 +16,3 @@ const buildin = require('./buildin'); | ||
filter: buildin.filter, | ||
map: buildin.get, | ||
map: buildin.map, | ||
keys: function(current) { | ||
@@ -149,9 +149,15 @@ return Object.keys(current || {}); | ||
current.forEach(item => { | ||
const key = keyGetter(item); | ||
let keys = keyGetter(item); | ||
if (map.has(key)) { | ||
map.get(key).add(valueGetter(item)); | ||
} else { | ||
map.set(key, new Set([valueGetter(item)])); | ||
if (!Array.isArray(keys)) { | ||
keys = [keys]; | ||
} | ||
keys.forEach(key => { | ||
if (map.has(key)) { | ||
map.get(key).add(valueGetter(item)); | ||
} else { | ||
map.set(key, new Set([valueGetter(item)])); | ||
} | ||
}); | ||
}); | ||
@@ -158,0 +164,0 @@ |
@@ -16,5 +16,13 @@ // temporary file with parser extension | ||
setInput: orig => function(input, yy) { | ||
yy.commentRanges = []; | ||
this.fnOpened = 0; | ||
this.fnOpenedStack = []; | ||
yy.commentRanges = []; | ||
this.prevToken = null; | ||
this.prevYylloc = { | ||
first_line: 1, | ||
last_line: 1, | ||
first_column: 0, | ||
last_column: 0, | ||
range: [0, 0] | ||
}; | ||
@@ -26,69 +34,91 @@ return orig.call(this, input, yy); | ||
// patch lex method | ||
const keywords = [ | ||
'AND', 'OR', 'IN', 'NOTIN', 'HAS', 'HASNO' | ||
]; | ||
const words = [...keywords, 'NOT']; | ||
const operators = [ | ||
'+', '-', '*', '/', '%', | ||
'=', '!=', '~=', '>=', '<=', '<', '>' | ||
]; | ||
const prev = [ | ||
null, ':', ';', | ||
',', '.', '..', | ||
...operators, | ||
...keywords, 'NOT' | ||
]; | ||
const defaultNext = new Set([ | ||
',', '?', ':', ';', 'EOF', | ||
']', ')', '}', | ||
...operators, | ||
...keywords | ||
]); | ||
const tokenPair = prev.reduce( | ||
(map, prevToken) => map.set(prevToken, defaultNext), | ||
new Map() | ||
); | ||
// special cases | ||
tokenPair.set('{', new Set([','])); | ||
tokenPair.set('[', new Set([','])); | ||
tokenPair.set('(', new Set([','])); | ||
patch(tolerantParser.lexer, { | ||
lex: orig => { | ||
let prevToken = null; | ||
let prevYylloc = { | ||
first_line: 1, | ||
last_line: 1, | ||
first_column: 0, | ||
last_column: 0, | ||
range: [0, 0] | ||
}; | ||
const keywords = [ | ||
'AND', 'OR', 'IN', 'NOTIN', 'HAS', 'HASNO', 'NOT' | ||
]; | ||
const operators = [ | ||
'+', '-', '*', '/', '%', | ||
'=', '!=', '~=', '>=', '<=', '<', '>' | ||
]; | ||
const prev = [ | ||
null, ':', ';', | ||
',', '.', '..', | ||
...operators, | ||
...keywords | ||
]; | ||
const defaultNext = new Set([ | ||
',', '?', ':', ';', 'EOF', | ||
']', ')', '}', | ||
...operators, | ||
...keywords | ||
]); | ||
const tokenPair = prev.reduce( | ||
(map, prevToken) => map.set(prevToken, defaultNext), | ||
new Map() | ||
); | ||
// special cases | ||
tokenPair.set('{', new Set([','])); | ||
tokenPair.set('[', new Set([','])); | ||
return function patchedLex() { | ||
this.lex = orig; | ||
lex: origLex => | ||
function patchedLex() { | ||
this.lex = origLex; | ||
const prevInput = this._input; | ||
const nextToken = this.lex(this); | ||
this.lex = patchedLex; | ||
if (tokenPair.has(prevToken) && tokenPair.get(prevToken).has(nextToken)) { | ||
if (tokenPair.has(this.prevToken) && tokenPair.get(this.prevToken).has(nextToken)) { | ||
const yylloc = { | ||
first_line: prevYylloc.last_line, | ||
first_line: this.prevYylloc.last_line, | ||
last_line: this.yylloc.first_line, | ||
first_column: prevYylloc.last_column, | ||
first_column: this.prevYylloc.last_column, | ||
last_column: this.yylloc.first_column, | ||
range: [prevYylloc.range[1], this.yylloc.range[0]] | ||
range: [this.prevYylloc.range[1], this.yylloc.range[0]] | ||
}; | ||
this.unput(this.yytext); | ||
this.pushState('preventPrimitive'); | ||
this.done = false; | ||
this.yytext = '_'; | ||
this.yylloc = prevYylloc = yylloc; | ||
this.pushState('preventPrimitive'); | ||
this.yylloc = this.prevYylloc = yylloc; | ||
return prevToken = 'SYMBOL'; | ||
// position correction for a white space before a keyword | ||
if (prevInput !== this._input && words.includes(nextToken)) { | ||
const prevChIndex = prevInput.length - this._input.length - 1; | ||
switch (prevInput[prevChIndex]) { | ||
case ' ': | ||
case '\t': | ||
yylloc.last_column--; | ||
yylloc.range[1]--; | ||
break; | ||
case '\n': { | ||
const lastN = prevInput.lastIndexOf('\n', prevChIndex - 1); | ||
yylloc.last_line--; | ||
yylloc.last_column = lastN === -1 | ||
? yylloc.last_column - 1 | ||
: prevChIndex - lastN; | ||
yylloc.range[1]--; | ||
break; | ||
} | ||
} | ||
} | ||
return this.prevToken = 'SYMBOL'; | ||
} | ||
prevYylloc = this.yylloc; | ||
if (keywords.includes(nextToken)) { | ||
this.prevYylloc = this.yylloc; | ||
// position correction for a white space after a keyword | ||
if (words.includes(nextToken)) { | ||
switch (this._input[0]) { | ||
case ' ': | ||
case '\t': | ||
prevYylloc = Object.assign({}, prevYylloc, { | ||
last_column: prevYylloc.last_column + 1, | ||
range: [prevYylloc.range[0], prevYylloc.range[1] + 1] | ||
this.prevYylloc = Object.assign({}, this.prevYylloc, { | ||
last_column: this.prevYylloc.last_column + 1, | ||
range: [this.prevYylloc.range[0], this.prevYylloc.range[1] + 1] | ||
}); | ||
@@ -98,6 +128,6 @@ break; | ||
case '\n': | ||
prevYylloc = Object.assign({}, prevYylloc, { | ||
last_line: prevYylloc.last_line + 1, | ||
this.prevYylloc = Object.assign({}, this.prevYylloc, { | ||
last_line: this.prevYylloc.last_line + 1, | ||
last_column: 0, | ||
range: [prevYylloc.range[0], prevYylloc.range[1] + 1] | ||
range: [this.prevYylloc.range[0], this.prevYylloc.range[1] + 1] | ||
}); | ||
@@ -108,8 +138,7 @@ break; | ||
return prevToken = nextToken; | ||
}; | ||
} | ||
return this.prevToken = nextToken; | ||
} | ||
}); | ||
// tolerantParser.lexer.setInput('. < 5', {}); | ||
// tolerantParser.lexer.setInput('\n//test\n\nor', {}); | ||
// while (!tolerantParser.lexer.done) { | ||
@@ -116,0 +145,0 @@ // console.log(tolerantParser.lexer.conditionStack); |
@@ -29,5 +29,5 @@ const { Parser } = require('jison'); | ||
return ( | ||
'"/*s*/",' + | ||
'"/*sp:' + ranges + '*/",' + | ||
(expr[0] === '$' ? expr : '"' + expr + '"') + | ||
',"/*' + ranges + '*/"' | ||
',"/**/"' | ||
); | ||
@@ -55,3 +55,3 @@ } | ||
ws: '\\s+', // required whitespaces | ||
comment: '//.*?(\\r|\\n|$)+', | ||
comment: '//.*?(\\r|\\n|$)', | ||
rx: '/(?:\\\\.|[^/])+/i?' | ||
@@ -105,3 +105,3 @@ }, | ||
// primitives | ||
['\\d+(?:\\.\\d+)?{wb}', switchToPreventPrimitiveState + 'return "NUMBER";'], // 212.321 | ||
['\\d+(?:\\.\\d+)?([eE][-+]?\\d+)?{wb}', switchToPreventPrimitiveState + 'return "NUMBER";'], // 212.321 | ||
['"(?:\\\\.|[^"])*"', switchToPreventPrimitiveState + 'return "STRING";'], // "foo" "with \" escaped" | ||
@@ -188,3 +188,3 @@ ["'(?:\\\\.|[^'])*'", switchToPreventPrimitiveState + 'return "STRING";'], // 'foo' 'with \' escaped' | ||
['$ ;', code`/*key@1*/current;`], // do nothing, but collect stat (suggestions) | ||
['$ SYMBOL ;', code`/*define:@2*/const $$2 = fn.get(/*key@2*/current, "$2");`], | ||
['$ SYMBOL ;', code`/*define:@2*/const $$2 = fn.map(/*key@2*/current, "$2");`], | ||
['$ SYMBOL : e ;', code`/*define:@2*/const $$2 = $4;`] | ||
@@ -207,2 +207,4 @@ ], | ||
['NOT e', code`!fn.bool($2)`], | ||
['- e', code`-$2`], | ||
['+ e', code`+$2`], | ||
['e IN e', code`fn.in($1, /*in-value@1*/$3)`], | ||
@@ -226,3 +228,3 @@ ['e HAS e', code`fn.in($3, /*in-value@3*/$1)`], | ||
['e >= e', code`fn.gte($1, $3)`], | ||
['e ~= e', code`fn.regexp($1, $3)`] | ||
['e ~= e', code`fn.match($1, $3)`] | ||
], | ||
@@ -252,6 +254,6 @@ | ||
['array', code`$1`], | ||
['SYMBOL', code`/*var:@1*/fn.get(/*@1*/current, "$1", 'xxx')`], | ||
['. SYMBOL', code`fn.get(/*@2*/current, "$2")`], | ||
['SYMBOL', code`/*var:@1*/fn.map(/*@1*/current, "$1", 'xxx')`], | ||
['. SYMBOL', code`fn.map(/*@2*/current, "$2")`], | ||
['( e )', code`($2)`], | ||
['.( block )', code`fn.get(current, current => { $2 })`], | ||
['.( block )', code`fn.map(current, current => { $2 })`], | ||
['SYMBOL ( )', code`method.$1(/*@1/@2*/current)`], | ||
@@ -267,10 +269,10 @@ ['SYMBOL ( arguments )', code`method.$1(/*@1*/current, $3)`], | ||
relativePath: [ | ||
['query . SYMBOL', code`fn.get(/*@3*/$1, "$3")`], | ||
['query . SYMBOL', code`fn.map(/*@3*/$1, "$3")`], | ||
['query . SYMBOL ( )', code`method.$3(/*@3/@4*/$1)`], | ||
['query . SYMBOL ( arguments )', code`method.$3(/*@3*/$1, $5)`], | ||
['query .( block )', code`fn.get($1, current => { $3 })`], | ||
['query .( block )', code`fn.map($1, current => { $3 })`], | ||
['query .. SYMBOL', code`fn.recursive(/*@3*/$1, "$3")`], | ||
['query ..( block )', code`fn.recursive($1, current => { $3 })`], | ||
['query .[ block ]', code`fn.filter($1, current => { $3 })`], | ||
['query [ e ]', code`fn.get($1, $3)`] | ||
['query [ e ]', code`fn.map($1, $3)`] | ||
], | ||
@@ -294,6 +296,7 @@ | ||
property: [ | ||
['SYMBOL', code`/*var:@1*/$1: fn.get(/*@1*/current, "$1")`], | ||
['SYMBOL', code`/*var:@1*/$1: fn.map(/*@1*/current, "$1")`], | ||
['$', code`[Symbol()]: /*var:@$*/0`], // do nothing, but collect stat (suggestions) | ||
['$ SYMBOL', code`/*var:@$*/$2: typeof $$2 !== 'undefined' ? $$2 : undefined`], | ||
['SYMBOL : e', code`$1: $3`], | ||
['STRING : e', code`$1: $3`], | ||
['[ e ] : e', code`[$2]: $5`], | ||
@@ -300,0 +303,0 @@ ['...', code`.../*var:@1*//*@1*/current`], |
@@ -0,1 +1,3 @@ | ||
const toString = Object.prototype.toString; | ||
function addToSet(set, value) { | ||
@@ -21,6 +23,11 @@ if (value !== undefined) { | ||
function isRegExp(value) { | ||
return toString.call(value) === '[object RegExp]'; | ||
} | ||
module.exports = { | ||
addToSet, | ||
getPropertyValue, | ||
isPlainObject | ||
isPlainObject, | ||
isRegExp | ||
}; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
171143
2718
292