Comparing version 1.0.0-beta.9 to 1.0.0-beta.10
{ | ||
"name": "jora", | ||
"version": "1.0.0-beta.9", | ||
"version": "1.0.0-beta.10", | ||
"description": "JavaScript object query engine", | ||
@@ -53,3 +53,3 @@ "author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)", | ||
"@discoveryjs/cli": "^2.6.0", | ||
"@discoveryjs/discovery": "^1.0.0-beta.78", | ||
"@discoveryjs/discovery": "^1.0.0-beta.79", | ||
"@lahmatiy/jison": "^0.4.18-remastered.7", | ||
@@ -56,0 +56,0 @@ "c8": "^8.0.1", |
193
README.md
@@ -43,5 +43,4 @@ # Jora | ||
- [Install & import](#install--import) | ||
- [API](#api) | ||
- [Quick demo](#quick-demo) | ||
- [API](#api) | ||
- [Query introspection](#query-introspection) | ||
@@ -108,2 +107,3 @@ <!-- /TOC --> | ||
- [Functions](https://discoveryjs.github.io/jora/#article:jora-syntax-functions) | ||
- [Methods](https://discoveryjs.github.io/jora/#article:jora-syntax-methods) | ||
@@ -118,5 +118,5 @@ - [Built-in methods](https://discoveryjs.github.io/jora/#article:jora-syntax-methods-builtin) | ||
- [Filtering](https://discoveryjs.github.io/jora/#article:jora-syntax-filter): `.[…]` and `filter()` method | ||
- [Mapping](https://discoveryjs.github.io/jora/#article:jora-syntax-map): `.(…)` and `map()` method | ||
- [Recursive mapping](https://discoveryjs.github.io/jora/#article:jora-syntax-recursive-map): `..(…)` | ||
- [Filtering](https://discoveryjs.github.io/jora/#article:jora-syntax-filter): `.[…]` and `filter()` method | ||
@@ -196,2 +196,16 @@ ### Variables | ||
### API | ||
```js | ||
import jora from 'jora'; | ||
// create a query | ||
const query = jora('foo.bar'); | ||
// perform a query | ||
const result = query(data, context); | ||
``` | ||
See the details in [Jora library API](https://discoveryjs.github.io/jora/#article:api) | ||
### Quick demo | ||
@@ -261,173 +275,2 @@ | ||
### API | ||
```js | ||
import jora from 'jora'; | ||
// create a query | ||
const query = jora('foo.bar'); | ||
// or with custom methods | ||
const queryWithCustomMethods = jora.setup({ | ||
myMethod(current) { /* do something and return a new value */ } | ||
}); | ||
// perform a query | ||
const result = query(data, context); | ||
const result = queryWithCustomMethods('foo.myMethod()')(data, context); | ||
``` | ||
Options: | ||
- methods | ||
Type: `Object` | ||
Default: `undefined` | ||
Additional methods for using in query passed as an object, where a key is a method name and a value is a function to perform an action. It can override build-in methods. | ||
- debug | ||
Type: `Boolean` or `function(name, value)` | ||
Default: `false` | ||
Enables debug output. When set a function, this function will recieve a section name and its value. | ||
- tolerant | ||
Type: `Boolean` | ||
Default: `false` | ||
Enables tolerant parsing mode. This mode supresses parsing errors when possible. | ||
- stat | ||
Type: `Boolean` | ||
Default: `false` | ||
Enables stat mode. When mode is enabled a query stat interface is returning instead of resulting data. | ||
### Query introspection | ||
To introspect a query, it should be compiled in "stat" (statistic) mode by passing a `stat` option. In this case a result of the query evaluation will be a special API with encapsulated state instead of a value: | ||
```js | ||
import jora from 'jora'; | ||
const query = jora('...query...', { stat: true }); | ||
const statApi = query(data); | ||
// { stat() { ... }, suggestion() { ... }, ... } | ||
``` | ||
The returned API allows fetching the values which are passed through a location in a query (the `stat()` method) as well as a list of suggestions for a location (the `suggestion()` method): | ||
```js | ||
import jora from 'jora'; | ||
const query = jora('.[foo=""]', { stat: true }); | ||
const statApi = query([{ id: 1, foo: "hello" }, { id: 2, foo: "world" }]); | ||
statApi.stat(3); | ||
// [ | ||
// { | ||
// context: 'path', | ||
// from: 2, | ||
// to: 5, | ||
// text: 'foo', | ||
// values: Set(2) { [Object], [Object] }, | ||
// related: null | ||
// } | ||
// ] | ||
statApi.suggestion(3); // .[f|oo=""] | ||
// [ | ||
// { | ||
// type: 'property', | ||
// from: 2, | ||
// to: 5, | ||
// text: 'foo', | ||
// suggestions: [ 'id', 'foo' ] | ||
// } | ||
// ] | ||
statApi.suggestion(7); // .[foo="|"] | ||
// [ | ||
// { | ||
// type: 'value', | ||
// from: 6, | ||
// to: 8, | ||
// text: '""', | ||
// suggestions: [ 'hello', 'world' ] | ||
// } | ||
// ] | ||
``` | ||
That's an effective way to use stat mode together with `tolerant` mode for incomplete queries: | ||
```js | ||
import jora from 'jora'; | ||
const query = jora('.[foo=]', { | ||
stat: true, | ||
tolerant: true // without the tolerant option a query compilation | ||
// will raise a parse error: | ||
// .[foo=] | ||
// ------^ | ||
}); | ||
const statApi = query([{ id: 1, foo: "hello" }, { id: 2, foo: "world" }]); | ||
statApi.suggestion(6); // .[foo=|] | ||
// [ | ||
// { | ||
// type: 'value', | ||
// from: 6, | ||
// to: 6, | ||
// text: '', | ||
// suggestions: [ 'hello', 'world' ] | ||
// }, | ||
// { | ||
// type: 'property', | ||
// from: 6, | ||
// to: 6, | ||
// text: '', | ||
// suggestions: [ 'id', 'foo' ] | ||
// } | ||
// ] | ||
``` | ||
#### Methods | ||
- `stat(pos: number, includeEmpty?: boolean)` | ||
Returns an array of ranges with all the values which are passed through `pos` during performing a query. | ||
Output format: | ||
```ts | ||
suggestion(): Array<{ | ||
context: 'path' | 'key' | 'value' | 'in-value' | 'value-subset' | 'var', | ||
from: number, | ||
to: number, | ||
text: string, | ||
values: Set<any>, | ||
related: Set<any> | null | ||
}> | null | ||
``` | ||
- `suggestion(pos: number, options?)` | ||
Returns suggesion values grouped by a type or `null` if there is no any suggestions. The following options are supported (all are optional): | ||
- `limit` (default: `Infinity`) – a max number of the values that should be returned for each value type (`"property"`, `"value"` or `"variable"`) | ||
- `sort` (default: `false`) – a comparator function (should take 2 arguments and return a negative number, `0` or a positive number) for value list sorting, makes sence when `limit` is used | ||
- `filter` (default: `function`) – a filter function factory (`pattern => value => <expr>`) to discard values from the result when returns a falsy value (default is equivalent to `patttern => value => String(value).toLowerCase().includes(pattern)`) | ||
Output format: | ||
```ts | ||
suggestion(): Array<{ | ||
type: 'property' | 'value' | 'variable', | ||
from: number, | ||
to: number, | ||
text: string, | ||
suggestions: Array<string | number> | ||
}> | null | ||
``` | ||
See more examples in [Complex Jora query examples](https://discoveryjs.github.io/jora/#article:jora-syntax-complex-examples) |
@@ -7,3 +7,3 @@ import { version } from './version.js'; | ||
import stringify from './lang/stringify.js'; | ||
import compile from './lang/compile.js'; | ||
import { compile, compileMethod } from './lang/compile.js'; | ||
import buildin from './lang/compile-buildin.js'; | ||
@@ -19,15 +19,17 @@ import methods from './methods.js'; | ||
function defineDictFunction(dict, name, fn, queryMethods, queryAssertions) { | ||
if (typeof fn === 'string') { | ||
function defineDictFunction(dict, name, value, queryMethods, queryAssertions) { | ||
if (typeof value === 'string') { | ||
Object.defineProperty(dict, name, { | ||
configurable: true, | ||
get() { | ||
const compiledFn = compileFunction(fn)(buildin, queryMethods, queryAssertions); | ||
const value = current => compiledFn(current, null); | ||
Object.defineProperty(dict, name, { value }); | ||
return value; | ||
const compiledFn = compileFunction(value, 'method')(buildin, queryMethods, queryAssertions); | ||
const fn = compiledFn; | ||
Object.defineProperty(dict, name, { enumerable: true, value: fn }); | ||
return fn; | ||
} | ||
}); | ||
} else { | ||
dict[name] = fn; | ||
} else if (typeof value === 'function') { | ||
Object.defineProperty(dict, name, { enumerable: true, value }); | ||
} | ||
@@ -47,3 +49,3 @@ } | ||
for (const [name, fn] of Object.entries(customMethods || {})) { | ||
for (const [name, value] of Object.entries(customMethods || {})) { | ||
if (hasOwn(methods, name)) { | ||
@@ -53,6 +55,6 @@ throw new Error(`Builtin method "${name}" can\'t be overridden`); | ||
defineDictFunction(queryMethods, name, fn, queryMethods, queryAssertions); | ||
defineDictFunction(queryMethods, name, value, queryMethods, queryAssertions); | ||
} | ||
for (const [name, fn] of Object.entries(customAssertions || {})) { | ||
for (const [name, value] of Object.entries(customAssertions || {})) { | ||
if (hasOwn(assertions, name)) { | ||
@@ -62,3 +64,3 @@ throw new Error(`Builtin assertion "${name}" can\'t be overridden`); | ||
defineDictFunction(queryAssertions, name, fn, queryMethods, queryAssertions); | ||
defineDictFunction(queryAssertions, name, value, queryMethods, queryAssertions); | ||
} | ||
@@ -79,3 +81,3 @@ | ||
function compileFunction(source, statMode, tolerantMode, debug) { | ||
function compileFunction(source, kind, statMode, tolerantMode, debug) { | ||
debug = typeof debug === 'function' ? debug : Boolean(debug) ? defaultDebugHandler : false; | ||
@@ -131,3 +133,5 @@ | ||
const fn = compile(parseResult.ast, tolerantMode, suggestions); | ||
const fn = kind === 'method' | ||
? compileMethod(parseResult.ast, tolerantMode, suggestions) | ||
: compile(parseResult.ast, tolerantMode, suggestions); | ||
@@ -159,3 +163,3 @@ if (debug) { | ||
} else { | ||
fn = compileFunction(source, statMode, tolerantMode, options.debug); | ||
fn = compileFunction(source, 'query', statMode, tolerantMode, options.debug); | ||
cache.set(source, fn); | ||
@@ -180,7 +184,7 @@ } | ||
return function query(source, options) { | ||
options = options || {}; | ||
return function query(source, queryOptions) { | ||
queryOptions = queryOptions || {}; | ||
const statMode = Boolean(options.stat); | ||
const tolerantMode = Boolean(options.tolerant); | ||
const statMode = Boolean(queryOptions.stat); | ||
const tolerantMode = Boolean(queryOptions.tolerant); | ||
const cache = statMode | ||
@@ -193,3 +197,3 @@ ? (tolerantMode ? cacheTollerantStat : cacheStrictStat) | ||
if (cache.has(source) && !options.debug) { | ||
if (cache.has(source) && !queryOptions.debug) { | ||
fn = cache.get(source); | ||
@@ -199,5 +203,6 @@ } else { | ||
source, | ||
'query', | ||
statMode, | ||
tolerantMode, | ||
options.debug | ||
queryOptions.debug | ||
)( | ||
@@ -230,4 +235,5 @@ buildin, | ||
stringify, | ||
compile | ||
compile, | ||
compileMethod | ||
} | ||
}); |
@@ -138,3 +138,3 @@ import { cmp, cmpAnalytical, cmpNatural, cmpNaturalAnalytical } from '../utils/compare.js'; | ||
for (let i = 0; i < current.length; i++) { | ||
if (ref(current[i], i)) { | ||
if (isTruthy(ref(current[i], i))) { | ||
return current[i]; | ||
@@ -147,3 +147,3 @@ } | ||
if (hasOwn(current, key)) { | ||
if (ref(current[key], key)) { | ||
if (isTruthy(ref(current[key], key))) { | ||
return current[key]; | ||
@@ -150,0 +150,0 @@ } |
@@ -5,3 +5,10 @@ import { hasOwn } from '../utils/misc.js'; | ||
export default function compile(ast, tolerant = false, suggestions = null) { | ||
export function compile(ast, tolerant, suggestions) { | ||
return compileInternal(ast, 'query', tolerant, suggestions); | ||
} | ||
export function compileMethod(ast, tolerant, suggestions) { | ||
return compileInternal(ast, 'method', tolerant, suggestions); | ||
} | ||
function compileInternal(ast, kind, tolerant = false, suggestions = null) { | ||
function newStatPoint(values) { | ||
@@ -51,3 +58,3 @@ const spName = 's' + spNames.length; | ||
function createScope(fn, defCurrent) { | ||
function createScope(fn, defCurrent, $ref = '$') { | ||
const prevScope = ctx.scope; | ||
@@ -60,3 +67,4 @@ const scopeStart = buffer.length; | ||
ctx.scope.captureCurrent = []; | ||
ctx.scope.arg1 = prevScope.arg1 || false; | ||
ctx.scope.arg1 = prevScope.arg1 || kind === 'method'; | ||
ctx.scope.$ref = $ref; | ||
@@ -70,3 +78,3 @@ fn(); | ||
); | ||
const stat = 'stat(' + spName + ',$)'; | ||
const stat = 'stat(' + spName + ',' + ctx.scope.$ref + ')'; | ||
@@ -129,5 +137,25 @@ if (ctx.scope.firstCurrent) { | ||
const buffer = [ | ||
'((data,context)=>{', | ||
'const $=data;', | ||
{ toString() { | ||
if (kind === 'query') { | ||
return [ | ||
'((data,context)=>{', | ||
...ctx.usedMethods.size || ctx.usedAssertions.size ? [ | ||
'const method = (name,...args)=>m[name].apply(mctx,args);', | ||
'const assertion = (name,...args)=>a[name].apply(mctx,args);', | ||
'const mctx = Object.freeze({context,method,assertion});' | ||
] : [] | ||
].join('\n') + '\n'; | ||
} | ||
if (kind === 'method') { | ||
return [ | ||
'(function(data){', | ||
'const mctx = this;', | ||
'const context = mctx.context;' | ||
].join('\n') + '\n'; | ||
} | ||
throw new Error('Unknown kind: ' + kind); | ||
} }, | ||
{ toString() { | ||
return allocatedVars.length > 0 ? 'let ' + allocatedVars + ';\n' : ''; | ||
@@ -162,2 +190,3 @@ } }, | ||
usedMethods: new Map(), | ||
suggestions: suggestions !== null, | ||
buildinFn(name) { | ||
@@ -211,3 +240,4 @@ usedBuildinMethods.add(name); | ||
return '(' + sp + ',' + scopeStart; | ||
} | ||
}, | ||
'data' | ||
); | ||
@@ -257,2 +287,3 @@ | ||
',\nstats: [' + normalizedSuggestRanges.map(s => '[' + s + ']') + ']' + | ||
',\nmethods: m' + | ||
',\nassertions: a' + | ||
@@ -259,0 +290,0 @@ '\n}'); |
@@ -51,3 +51,3 @@ export function suggest(node, ctx) { | ||
ctx.put('('); | ||
ctx.put('.call(mctx,'); | ||
ctx.nodeOrCurrent(); | ||
@@ -54,0 +54,0 @@ ctx.put(')'); |
@@ -18,3 +18,4 @@ export function suggest(node, ctx) { | ||
return scopeStart + sp + ';'; | ||
} | ||
}, | ||
ctx.scope.$ref | ||
); | ||
@@ -21,0 +22,0 @@ } else if (node.body && node.body.type === 'Object') { |
@@ -7,3 +7,3 @@ export function suggest(node, ctx) { | ||
export function compile(node, ctx) { | ||
ctx.put('$'); | ||
ctx.put(ctx.scope.$ref); | ||
} | ||
@@ -10,0 +10,0 @@ export function walk() { } |
export function compile(node, ctx) { | ||
ctx.createScope( | ||
() => { | ||
const args = node.arguments.map(arg => '$' + arg.name); | ||
ctx.scope.arg1 = true; | ||
ctx.put('function($){return '); | ||
ctx.scope.$ref = args[0] || '$'; | ||
for (const arg of node.arguments) { | ||
ctx.scope.push(arg.name); | ||
} | ||
ctx.put('function('); | ||
ctx.put(String(args) || '$'); | ||
ctx.put('){return '); | ||
ctx.node(node.body); | ||
@@ -18,10 +27,4 @@ ctx.put('}'); | ||
export function stringify(node, ctx) { | ||
if (node.legacy) { | ||
ctx.put('<'); | ||
ctx.node(node.body); | ||
ctx.put('>'); | ||
} else { | ||
ctx.put('=>'); | ||
ctx.node(node.body); | ||
} | ||
ctx.put('=>'); | ||
ctx.node(node.body); | ||
} |
@@ -7,2 +7,3 @@ export function suggest(node, ctx) { | ||
export function compile(node, ctx, relatedNode) { | ||
const dictMethod = node.reference.type === 'Identifier'; | ||
// default mode: method(relatedNode, ...args...) | ||
@@ -14,3 +15,3 @@ // tolerant mode: (typeof method === 'function' ? method(relatedNode, ...args...) : undefined) | ||
if (node.reference.type === 'Identifier') { | ||
if (dictMethod) { | ||
if (ctx.usedMethods.has(node.reference.name)) { | ||
@@ -30,3 +31,3 @@ ctx.usedMethods.get(node.reference.name).push(node.reference.range); | ||
if (node.reference.type === 'Identifier') { | ||
if (dictMethod) { | ||
ctx.put('m.'); | ||
@@ -38,3 +39,3 @@ } | ||
ctx.put('('); | ||
ctx.put(dictMethod ? '.call(mctx,' : '('); | ||
ctx.nodeOrCurrent(relatedNode); | ||
@@ -41,0 +42,0 @@ |
@@ -31,2 +31,3 @@ import { GetProperty, Identifier } from '../build.js'; | ||
case 'Current': | ||
ctx.put('...null'); | ||
return; | ||
@@ -33,0 +34,0 @@ |
@@ -14,3 +14,3 @@ export function compile(node, ctx) { | ||
ctx.put('('); | ||
ctx.node(node.left); | ||
ctx.nodeOrCurrent(node.left); | ||
ctx.put(')'); | ||
@@ -17,0 +17,0 @@ } |
@@ -5,5 +5,5 @@ export function suggest(node, ctx) { | ||
export function compile(node, ctx) { | ||
ctx.put('$'); | ||
ctx.put(ctx.scope.$ref); | ||
} | ||
export function walk() {} | ||
export function stringify() {} |
@@ -58,5 +58,5 @@ /* parser generated by jison 0.4.18-remastered.7 */ | ||
break;} | ||
case 2:{this.popState(); return 37; | ||
case 2:{this.popState(); return 40; | ||
break;} | ||
case 3:{this.popState(); return 41; | ||
case 3:{this.popState(); return 44; | ||
break;} | ||
@@ -95,15 +95,15 @@ case 4:{this.done = false; | ||
break;} | ||
case 10:{return 62; | ||
case 10:{return 21; | ||
break;} | ||
case 11:{yy.pps(); return 63; | ||
case 11:{yy.pps(); return 22; | ||
break;} | ||
case 12:{return 58; | ||
case 12:{return 61; | ||
break;} | ||
case 13:{yy.pps(); return 60; | ||
case 13:{yy.pps(); return 63; | ||
break;} | ||
case 14:{return 82; | ||
case 14:{return 84; | ||
break;} | ||
case 15:{if (this.bracketStack[this.bracketStack.length - 1] !== 'TPL_END') { | ||
yy.pps(); | ||
return 83; | ||
return 85; | ||
} | ||
@@ -115,37 +115,37 @@ | ||
case 16:{yy_.yytext = this.toLiteral(yy_.yytext); // eslint-disable-line no-unused-vars | ||
return 54; | ||
return 57; | ||
break;} | ||
case 17:{return 33; | ||
case 17:{return 36; | ||
break;} | ||
case 18:{return 34; | ||
case 18:{return 37; | ||
break;} | ||
case 19:{return 27; | ||
case 19:{return 30; | ||
break;} | ||
case 20:{return 32; | ||
case 20:{return 35; | ||
break;} | ||
case 21:{return 30; | ||
case 21:{return 33; | ||
break;} | ||
case 22:{return 29; | ||
case 22:{return 32; | ||
break;} | ||
case 23:{return 31; | ||
case 23:{return 34; | ||
break;} | ||
case 24:{return 23; | ||
case 24:{return 25; | ||
break;} | ||
case 25:{return 24; | ||
case 25:{return 26; | ||
break;} | ||
case 26:{return 93; | ||
case 26:{return 95; | ||
break;} | ||
case 27:{yy_.yytext = this.ident(yy_.yytext.slice(0, -1)); return 69; | ||
case 27:{yy_.yytext = this.ident(yy_.yytext.slice(0, -1)); return 70; | ||
break;} | ||
case 28:{yy_.yytext = this.ident(yy_.yytext.slice(1, -1)); return 71; | ||
case 28:{yy_.yytext = this.ident(yy_.yytext.slice(1, -1)); return 72; | ||
break;} | ||
case 29:{yy.pps(); yy_.yytext = Number(yy_.yytext); return 52; | ||
case 29:{yy.pps(); yy_.yytext = Number(yy_.yytext); return 55; | ||
break;} | ||
case 30:{yy.pps(); yy_.yytext = parseInt(yy_.yytext, 16); return 52; | ||
case 30:{yy.pps(); yy_.yytext = parseInt(yy_.yytext, 16); return 55; | ||
break;} | ||
case 31:{yy.pps(); yy_.yytext = this.toStringLiteral(yy_.yytext); return 51; | ||
case 31:{yy.pps(); yy_.yytext = this.toStringLiteral(yy_.yytext); return 54; | ||
break;} | ||
case 32:{yy.pps(); yy_.yytext = this.toStringLiteral(yy_.yytext); return 51; | ||
case 32:{yy.pps(); yy_.yytext = this.toStringLiteral(yy_.yytext); return 54; | ||
break;} | ||
case 33:{yy.pps(); yy_.yytext = this.toRegExp(yy_.yytext); return 53; | ||
case 33:{yy.pps(); yy_.yytext = this.toRegExp(yy_.yytext); return 56; | ||
break;} | ||
@@ -156,7 +156,7 @@ case 34:{yy.pps(); yy_.yytext = this.ident(yy_.yytext); return 14; | ||
break;} | ||
case 36:{yy.pps(); return 48; | ||
case 36:{yy.pps(); return 51; | ||
break;} | ||
case 37:{yy.pps(); return 49; | ||
case 37:{yy.pps(); return 52; | ||
break;} | ||
case 38:{yy.pps(); return 50; | ||
case 38:{yy.pps(); return 53; | ||
break;} | ||
@@ -167,33 +167,33 @@ case 39:{yy.pps(); return 9; | ||
break;} | ||
case 41:{return 39; | ||
case 41:{return 42; | ||
break;} | ||
case 42:{return 40; | ||
case 42:{return 43; | ||
break;} | ||
case 43:{return 45; | ||
case 43:{return 48; | ||
break;} | ||
case 44:{return 44; | ||
case 44:{return 47; | ||
break;} | ||
case 45:{return 42; | ||
case 45:{return 45; | ||
break;} | ||
case 46:{return 41; | ||
case 46:{return 44; | ||
break;} | ||
case 47:{return 43; | ||
case 47:{return 46; | ||
break;} | ||
case 48:{return 68; | ||
case 48:{return 69; | ||
break;} | ||
case 49:{return 65; | ||
case 49:{return 66; | ||
break;} | ||
case 50:{return 66; | ||
case 50:{return 67; | ||
break;} | ||
case 51:{return 87; | ||
case 51:{return 89; | ||
break;} | ||
case 52:{yy.pps(); yy.pks(); return 67; | ||
case 52:{yy.pps(); yy.pks(); return 68; | ||
break;} | ||
case 53:{yy.pps(); yy.pks(); return 64; | ||
case 53:{yy.pps(); yy.pks(); return 65; | ||
break;} | ||
case 54:{return 35; | ||
case 54:{return 38; | ||
break;} | ||
case 55:{return 17; | ||
break;} | ||
case 56:{return 72; | ||
case 56:{return 73; | ||
break;} | ||
@@ -204,13 +204,13 @@ case 57:{return 11; | ||
break;} | ||
case 59:{return 25; | ||
case 59:{return 27; | ||
break;} | ||
case 60:{return 26; | ||
case 60:{return 28; | ||
break;} | ||
case 61:{return 36; | ||
case 61:{return 39; | ||
break;} | ||
case 62:{return 37; | ||
case 62:{return 40; | ||
break;} | ||
case 63:{return 38; | ||
case 63:{return 41; | ||
break;} | ||
case 64:{return 22; | ||
case 64:{return 29; | ||
break;} | ||
@@ -552,5 +552,5 @@ case 65:{this.parseError(`Bad input on line ${yy_.yylloc.first_line} column ${yy_.yylloc.first_column}\n` + this.showPosition(), { | ||
lexer, | ||
symbols_: {"error":2,"root":3,"block":4,"EOF":5,"definitions":6,"e":7,"def":8,"$":9,";":10,":":11,"$ident":12,"ident":13,"IDENT":14,"$IDENT":15,"condConsequent":16,"?":17,"condAlternate":18,"query":19,"FUNCTION":20,"compareFunction":21,"|":22,"NOT":23,"NO":24,"-":25,"+":26,"IS":27,"assertion":28,"IN":29,"HAS":30,"NOTIN":31,"HASNO":32,"AND":33,"OR":34,"??":35,"*":36,"/":37,"%":38,"=":39,"!=":40,"<":41,"<=":42,">":43,">=":44,"~=":45,"queryRoot":46,"relativePath":47,"@":48,"#":49,"$$":50,"STRING":51,"NUMBER":52,"REGEXP":53,"LITERAL":54,"template":55,"object":56,"array":57,"[":58,"sliceNotation":59,"]":60,"method()":61,"(":62,")":63,".":64,".(":65,".[":66,"..":67,"..(":68,"METHOD(":69,"arguments":70,"$METHOD(":71,",":72,"templateString":73,"templateStart":74,"templateTail":75,"templateEnd":76,"templateContinue":77,"TEMPLATE":78,"TPL_START":79,"TPL_CONTINUE":80,"TPL_END":81,"{":82,"}":83,"objectEntries":84,"objectEntry":85,"objectEntryKeyLiteral":86,"...":87,"arrayElements":88,"arrayElement":89,"assertionTerm":90,"assertionList":91,"compareExpr":92,"ORDER":93,"sliceNotationComponent":94,"$accept":0,"$end":1}, | ||
terminals_: {2:"error",5:"EOF",9:"$",10:";",11:":",14:"IDENT",15:"$IDENT",17:"?",20:"FUNCTION",22:"|",23:"NOT",24:"NO",25:"-",26:"+",27:"IS",29:"IN",30:"HAS",31:"NOTIN",32:"HASNO",33:"AND",34:"OR",35:"??",36:"*",37:"/",38:"%",39:"=",40:"!=",41:"<",42:"<=",43:">",44:">=",45:"~=",48:"@",49:"#",50:"$$",51:"STRING",52:"NUMBER",53:"REGEXP",54:"LITERAL",58:"[",60:"]",62:"(",63:")",64:".",65:".(",66:".[",67:"..",68:"..(",69:"METHOD(",71:"$METHOD(",72:",",78:"TEMPLATE",79:"TPL_START",80:"TPL_CONTINUE",81:"TPL_END",82:"{",83:"}",87:"...",93:"ORDER"}, | ||
productions_: [0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,1],[7,3],[7,4],[7,2],[7,2],[7,2],[7,2],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,3],[46,2],[46,2],[46,1],[46,1],[46,3],[46,4],[46,2],[46,2],[46,3],[46,3],[46,2],[46,2],[46,3],[47,3],[47,4],[47,4],[47,3],[47,3],[47,4],[47,4],[47,3],[47,3],[47,4],[61,2],[61,3],[61,2],[61,3],[70,1],[70,3],[55,1],[55,2],[75,1],[75,2],[75,2],[75,3],[73,1],[74,1],[77,1],[76,1],[56,2],[56,3],[56,4],[56,3],[56,4],[56,5],[84,1],[84,3],[86,1],[86,1],[86,1],[85,1],[85,1],[85,1],[85,1],[85,3],[85,3],[85,3],[85,5],[85,1],[85,2],[88,1],[88,3],[89,1],[89,1],[89,2],[57,2],[57,3],[57,4],[28,1],[28,2],[28,3],[28,4],[90,1],[90,1],[90,1],[90,1],[91,1],[91,3],[91,3],[21,1],[21,3],[92,2],[59,1],[59,2],[59,2],[59,3],[94,1],[94,2]], | ||
symbols_: {"error":2,"root":3,"block":4,"EOF":5,"definitions":6,"e":7,"def":8,"$":9,";":10,":":11,"$ident":12,"ident":13,"IDENT":14,"$IDENT":15,"condConsequent":16,"?":17,"condAlternate":18,"query":19,"=>":20,"(":21,")":22,"functionArgs":23,"compareFunction":24,"NOT":25,"NO":26,"-":27,"+":28,"|":29,"IS":30,"assertion":31,"IN":32,"HAS":33,"NOTIN":34,"HASNO":35,"AND":36,"OR":37,"??":38,"*":39,"/":40,"%":41,"=":42,"!=":43,"<":44,"<=":45,">":46,">=":47,"~=":48,"queryRoot":49,"relativePath":50,"@":51,"#":52,"$$":53,"STRING":54,"NUMBER":55,"REGEXP":56,"LITERAL":57,"template":58,"object":59,"array":60,"[":61,"sliceNotation":62,"]":63,"method()":64,".":65,".(":66,".[":67,"..":68,"..(":69,"METHOD(":70,"arguments":71,"$METHOD(":72,",":73,"functionArg":74,"templateString":75,"templateStart":76,"templateTail":77,"templateEnd":78,"templateContinue":79,"TEMPLATE":80,"TPL_START":81,"TPL_CONTINUE":82,"TPL_END":83,"{":84,"}":85,"objectEntries":86,"objectEntry":87,"objectEntryKeyLiteral":88,"...":89,"arrayElements":90,"arrayElement":91,"assertionTerm":92,"assertionList":93,"compareExpr":94,"ORDER":95,"sliceNotationComponent":96,"$accept":0,"$end":1}, | ||
terminals_: {2:"error",5:"EOF",9:"$",10:";",11:":",14:"IDENT",15:"$IDENT",17:"?",20:"=>",21:"(",22:")",25:"NOT",26:"NO",27:"-",28:"+",29:"|",30:"IS",32:"IN",33:"HAS",34:"NOTIN",35:"HASNO",36:"AND",37:"OR",38:"??",39:"*",40:"/",41:"%",42:"=",43:"!=",44:"<",45:"<=",46:">",47:">=",48:"~=",51:"@",52:"#",53:"$$",54:"STRING",55:"NUMBER",56:"REGEXP",57:"LITERAL",61:"[",63:"]",65:".",66:".(",67:".[",68:"..",69:"..(",70:"METHOD(",72:"$METHOD(",73:",",80:"TEMPLATE",81:"TPL_START",82:"TPL_CONTINUE",83:"TPL_END",84:"{",85:"}",89:"...",95:"ORDER"}, | ||
productions_: [0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,1],[7,2],[7,2],[7,2],[7,2],[7,3],[7,4],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,3],[49,2],[49,2],[49,1],[49,1],[49,3],[49,4],[49,2],[49,2],[49,3],[49,3],[49,2],[49,2],[49,3],[49,2],[49,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[64,2],[64,3],[64,2],[64,3],[71,1],[71,3],[74,1],[23,1],[23,3],[58,1],[58,2],[77,1],[77,2],[77,2],[77,3],[75,1],[76,1],[79,1],[78,1],[59,2],[59,3],[59,4],[59,3],[59,4],[59,5],[86,1],[86,3],[88,1],[88,1],[88,1],[87,1],[87,1],[87,1],[87,1],[87,3],[87,3],[87,3],[87,5],[87,1],[87,2],[90,1],[90,3],[91,1],[91,1],[91,2],[60,2],[60,3],[60,4],[31,1],[31,2],[31,3],[31,4],[92,1],[92,1],[92,1],[92,1],[93,1],[93,3],[93,3],[24,1],[24,3],[94,2],[62,1],[62,2],[62,2],[62,3],[96,1],[96,2]], | ||
table: (function unpackTable(tables) { | ||
@@ -639,4 +639,4 @@ function unpackSubtable(table) { | ||
return result; | ||
})("ABCDEFGHIHHHHJJ<OK>LMNKKOPQRPQKSTUKVVKWXEFOM<TH>NKYPQRPQZKKHaabbFHFHcKdefgBhBiBKKjBkB<FK>UlBmBKKnBcKKnBKKoBS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C<iBH><lBS><mBxE>FFF<PU><mB1B><mB3B><WY><WZ><jBa><jBb><iBI><iBK><mBhE>yE~D~D8D8D2E2E|D|D<mBgC><mBkE><mBoE><mBpE><mBqE><mBrE><mBhC><cR><mBmC><mBnC><mBqC><mBrC><mB~C><mB|C><mBmD><flD><mBnD>tDt[ DyDyDzDzD]0D0D1D1D6D6D<DvD><DwD><DxD><QO><mB3C>7C7C<mB5C><QW><mBc><ad><ae><af><agB><VhB><UiB><WjB><jBkB><jBlB><mBmB><mBnB><mBoB><dpB><dqB><hBrB><hBsB><hBtB><hBuB><dvB><mBwB><mBtC><mBwC><mBxC><mB0C><mB1C><mBwE><mB|B><mBiE>zE0E3E3EgEg<mBEl><DEs>E<QQ><mBkC><mBoC><mBpC><mBsC><mBgD><mBhD><mBoD><mBqD>7D7D<mB4C><mB6C><QX><mBuC><mBvC><mByC><mBzC><mB2C><iBJ><iBL><mBjE>9D9D~D~D1<mBEm>E<mBlC><mBiD><mBpD>uDu <mBrD>4D4D2D2D3D3D8C8C<mBnE><DtE><DuE><mBsD>4D4D5D5D=BB"), | ||
defaultActions: {49:[2,1],185:[2,147],225:[2,149]}, | ||
})("ABCDEFGHIJKHHHHLL<NM>NOPMMQRSQRTMUVWMXXMYZEFTO<TH>PMaQRSQRbMMHcdefgBhBHi[ BiBjBj]BFHFHkBMlBmBnBoBpBqBMMrBsB<GM>WMMt[!BkBMMt]BuBfMMvBUMYMwBxByBzBzB0B0BH1<DB2>BuBMd3BMduBfM<E4B>5B6 <DB7>B8B8<EB9>B8BMM~<C!>BbHc|BMeMgChChCMMiCjCmBkClCMsBmCnCuBMMMuBMUMMoCMwBHHHpCqCTMHMuB<FM>bHgBgBMFFMoBlCjCmCMOOMMyByB0BMoCrCsCsCtC3BbMnCnCHMHsCsC=A1[ V[!C[\"lmkCpqC]]]<FA>[#[$[%[&['UqqWJkq]K]C][([)FgCCAAE];]]A];Ag;AwU[*ClmkOpqC]<FA>[+[,U[-qqWJnqK]]C(A]w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CiCjCkClCmCnCoCpC-rCzC#B-rCnI4H5H<CyDxD1DwDvD0D>qI9HtB1DxEyEzEvErIwExH<D-rC>sI<C-rC><CzC#B><C-rC>=FDDDEEE<jBG><gBT><mBN><lBY><kB4B><kB6B><mB0B><mB1B><mB3E><mB2B><mB3B><mB5B><mB7B><mB8B><mB9B><mB~B><mB|B><mBgC><mBhC><lBS><mBlC><mBmC>FFF<mBlD><cP><mBM><mBrD><gBsD>BCCC<jBH><lBS><mB5E>FFF<PU><mB4B><mB6B>jDjDNNNiD<bN>iDN<WZ><Wa><jBb><jBc><jBI><jBK><mBpE>6EmEmEkEkE~E~EnEnE<mBjC><mBsE><mBwE><mBxE><mByE><mBzE><mBN><mBkC><cR><mBpC><mBqC><mBtC><mBuC><RwC><mBmD><mBnD><mBuD><gBtD><mBvD>1D1[ D6D6D7D7D]8D8D9D9DiEiE<D3D><D4D><D5D><RO><mB8C>gDgD<mB~C><Rd><mBf><agB><ahB><aiB><ajB><VkB><UlB><WmB><jBnB><jBoB><mBpB><mBqB><mBrB><dsB><dtB><hBuB><hBvB><hBwB><hBxB><dyB><mBzB><mByC><mB1C><mB2C><mB5C><mB6C><PV><mBnC><mB4E><mBiC><mBqE>7E8E|E|EoEo<mBEt><DE0>E<RQ><mBrC><mBsC><mBvC><RxC><mBoD><mBpD><mBwD><mByD>jEjE<mB9C><mB|C><Re><mBzC><mB0C><mB3C><mB4C><mB7C><PW>kDkDiDiD<mBoC><jBJ><jBL><mBrE>lElEmEmE9<mBEu>E<mBqD><mBxD>2D2 <mBzD>gEgE~D~D|D|DhDhD<PX><mBvE><D1E><D2E><mB0D>gEgEhEhE=BB"), | ||
defaultActions: {50:[2,1],200:[2,155],245:[2,157]}, | ||
performAction(yytext,yyleng,yylineno,yy,yystate /* action[1] */,$$ /* vstack */,_$ /* lstack */) { | ||
@@ -662,3 +662,3 @@ /* this == yyval */ | ||
break; | ||
case 6: case 91: case 93: case 109: case 124: case 140: case 143: | ||
case 6: case 96: case 99: case 101: case 117: case 132: case 148: case 151: | ||
this.$ = [$$[$0]] | ||
@@ -681,234 +681,246 @@ break; | ||
break; | ||
case 12: case 13: case 136: case 137: | ||
case 12: case 13: case 98: case 144: case 145: | ||
this.$ = {type:"Identifier",name:$$[$0],range:this._$.range} | ||
break; | ||
case 14: case 16: case 151: | ||
case 14: case 16: case 159: | ||
this.$ = $$[$0] | ||
break; | ||
case 15: case 17: case 18: case 150: | ||
case 15: case 17: case 18: case 158: | ||
this.$ = null | ||
break; | ||
case 19: case 49: case 50: case 61: case 62: case 126: | ||
case 19: case 52: case 53: case 64: case 65: case 134: | ||
break; | ||
case 20: | ||
case 20: case 22: | ||
this.$ = {type:"Function",arguments:[],body:$$[$0],range:this._$.range} | ||
break; | ||
case 21: | ||
this.$ = {type:"Function",arguments:[{type:"Identifier",name:$$[$0-2]}],body:$$[$0],range:this._$.range} | ||
break; | ||
case 23: | ||
this.$ = {type:"Function",arguments:$$[$0-3],body:$$[$0],range:this._$.range} | ||
break; | ||
case 24: | ||
this.$ = {type:"CompareFunction",compares:$$[$0],range:this._$.range} | ||
break; | ||
case 22: | ||
case 25: case 26: case 27: case 28: case 67: | ||
this.$ = {type:"Prefix",operator:$$[$0-1],argument:$$[$0],range:this._$.range} | ||
break; | ||
case 29: | ||
this.$ = {type:"Pipeline",left:$$[$0-2],right:$$[$0],range:this._$.range} | ||
break; | ||
case 23: | ||
case 30: | ||
this.$ = {type:"Pipeline",left:$$[$0-3],right:{type:"Block",definitions:$$[$0-1],body:$$[$0]},range:this._$.range} | ||
break; | ||
case 24: case 25: case 26: case 27: case 64: | ||
this.$ = {type:"Prefix",operator:$$[$0-1],argument:$$[$0],range:this._$.range} | ||
break; | ||
case 28: | ||
case 31: | ||
this.$ = {type:"Postfix",operator:$$[$0],argument:$$[$0-2],range:this._$.range} | ||
break; | ||
case 29: case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: | ||
case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: case 50: | ||
this.$ = {type:"Binary",operator:$$[$0-1],left:$$[$0-2],right:$$[$0],range:this._$.range} | ||
break; | ||
case 48: | ||
case 51: | ||
this.$ = {type:"Conditional",test:$$[$0-2],consequent:$$[$0-1],alternate:$$[$0],range:this._$.range} | ||
break; | ||
case 51: | ||
case 54: | ||
this.$ = {type:"Data",range:this._$.range} | ||
break; | ||
case 52: | ||
case 55: | ||
this.$ = {type:"Context",range:this._$.range} | ||
break; | ||
case 53: | ||
case 56: | ||
this.$ = {type:"Current",range:this._$.range} | ||
break; | ||
case 54: | ||
case 57: | ||
this.$ = {type:"Arg1",range:this._$.range} | ||
break; | ||
case 55: | ||
case 58: | ||
this.$ = {type:"Reference",name:$$[$0],range:this._$.range} | ||
break; | ||
case 56: case 57: case 58: case 59: case 99: case 100: case 101: case 102: case 111: case 112: case 113: | ||
case 59: case 60: case 61: case 62: case 107: case 108: case 109: case 110: case 119: case 120: case 121: | ||
this.$ = {type:"Literal",value:$$[$0],range:this._$.range} | ||
break; | ||
case 60: | ||
case 63: | ||
this.$ = {type:"Template",values:$$[$0],range:this._$.range} | ||
break; | ||
case 63: | ||
case 66: | ||
this.$ = {type:"SliceNotation",value:null,arguments:$$[$0-1],range:this._$.range} | ||
break; | ||
case 65: | ||
case 68: | ||
this.$ = {type:"Conditional",test:null,consequent:$$[$0-1],alternate:$$[$0],range:this._$.range} | ||
break; | ||
case 66: case 70: | ||
case 69: case 73: | ||
this.$ = {type:"GetProperty",value:null,property:$$[$0],range:this._$.range} | ||
break; | ||
case 67: case 71: | ||
case 70: case 74: | ||
this.$ = {type:"MethodCall",value:null,method:$$[$0],range:this._$.range} | ||
break; | ||
case 68: | ||
case 71: | ||
this.$ = {type:"Parentheses",body:$$[$0-1],range:this._$.range} | ||
break; | ||
case 69: | ||
case 72: | ||
this.$ = {type:"Parentheses",body:{type:"Block",definitions:$$[$0-2],body:$$[$0-1]},range:this._$.range} | ||
break; | ||
case 72: | ||
case 75: | ||
this.$ = {type:"Map",value:null,query:$$[$0-1],range:this._$.range} | ||
break; | ||
case 73: | ||
case 76: | ||
this.$ = {type:"Filter",value:null,query:$$[$0-1],range:this._$.range} | ||
break; | ||
case 74: | ||
case 77: | ||
this.$ = {type:"MapRecursive",value:null,query:{type:"GetProperty",value:null,property:$$[$0]},range:this._$.range} | ||
break; | ||
case 75: | ||
case 78: | ||
this.$ = {type:"MapRecursive",value:null,query:{type:"MethodCall",value:null,method:$$[$0]},range:this._$.range} | ||
break; | ||
case 76: | ||
case 79: | ||
this.$ = {type:"MapRecursive",value:null,query:$$[$0-1],range:this._$.range} | ||
break; | ||
case 77: | ||
case 80: | ||
this.$ = {type:"Pipeline",left:null,right:$$[$0],range:this._$.range} | ||
break; | ||
case 81: | ||
this.$ = {type:"Pipeline",left:null,right:{type:"Block",definitions:$$[$0-1],body:$$[$0]},range:this._$.range} | ||
break; | ||
case 82: | ||
this.$ = {type:"Pick",value:$$[$0-2],getter:null,range:this._$.range} | ||
break; | ||
case 78: | ||
case 83: | ||
this.$ = {type:"Pick",value:$$[$0-3],getter:$$[$0-1],range:this._$.range} | ||
break; | ||
case 79: | ||
case 84: | ||
this.$ = {type:"SliceNotation",value:$$[$0-3],arguments:$$[$0-1],range:this._$.range} | ||
break; | ||
case 80: | ||
case 85: | ||
this.$ = {type:"GetProperty",value:$$[$0-2],property:$$[$0],range:this._$.range} | ||
break; | ||
case 81: | ||
case 86: | ||
this.$ = {type:"MethodCall",value:$$[$0-2],method:$$[$0],range:this._$.range} | ||
break; | ||
case 82: | ||
case 87: | ||
this.$ = {type:"Map",value:$$[$0-3],query:$$[$0-1],range:this._$.range} | ||
break; | ||
case 83: | ||
case 88: | ||
this.$ = {type:"Filter",value:$$[$0-3],query:$$[$0-1],range:this._$.range} | ||
break; | ||
case 84: | ||
case 89: | ||
this.$ = {type:"MapRecursive",value:$$[$0-2],query:{type:"GetProperty",value:null,property:$$[$0]},range:this._$.range} | ||
break; | ||
case 85: | ||
case 90: | ||
this.$ = {type:"MapRecursive",value:$$[$0-2],query:{type:"MethodCall",value:null,method:$$[$0]},range:this._$.range} | ||
break; | ||
case 86: | ||
case 91: | ||
this.$ = {type:"MapRecursive",value:$$[$0-3],query:$$[$0-1],range:this._$.range} | ||
break; | ||
case 87: | ||
case 92: | ||
this.$ = {type:"Method",reference:{type:"Identifier",name:$$[$0-1],range:[_$[$0-1].range[0],_$[$0-1].range[1]-1]},arguments:[],range:this._$.range} | ||
break; | ||
case 88: | ||
case 93: | ||
this.$ = {type:"Method",reference:{type:"Identifier",name:$$[$0-2],range:[_$[$0-2].range[0],_$[$0-2].range[1]-1]},arguments:$$[$0-1],range:this._$.range} | ||
break; | ||
case 89: | ||
case 94: | ||
this.$ = {type:"Method",reference:{type:"Reference",name:{type:"Identifier",name:$$[$0-1],range:[_$[$0-1].range[0],_$[$0-1].range[1]-1]},range:[_$[$0-1].range[0],_$[$0-1].range[1]-1]},arguments:[],range:this._$.range} | ||
break; | ||
case 90: | ||
case 95: | ||
this.$ = {type:"Method",reference:{type:"Reference",name:{type:"Identifier",name:$$[$0-2],range:[_$[$0-2].range[0],_$[$0-2].range[1]-1]},range:[_$[$0-2].range[0],_$[$0-2].range[1]-1]},arguments:$$[$0-1],range:this._$.range} | ||
break; | ||
case 92: case 110: case 125: case 144: | ||
case 97: case 100: case 118: case 133: case 152: | ||
$$[$0-2].push($$[$0]) | ||
break; | ||
case 94: | ||
case 102: | ||
this.$=[$$[$0-1], ...$$[$0]] | ||
break; | ||
case 95: case 146: | ||
case 103: case 154: | ||
this.$ = [null,$$[$0]] | ||
break; | ||
case 96: case 148: | ||
case 104: case 156: | ||
this.$ = [$$[$0-1],$$[$0]] | ||
break; | ||
case 97: | ||
case 105: | ||
this.$=[null, $$[$0-1], ...$$[$0]] | ||
break; | ||
case 98: | ||
case 106: | ||
this.$=[$$[$0-2], $$[$0-1], ...$$[$0]] | ||
break; | ||
case 103: case 106: | ||
case 111: case 114: | ||
this.$ = {type:"Object",properties:[],range:this._$.range} | ||
break; | ||
case 104: | ||
case 112: | ||
this.$ = {type:"Object",properties:$$[$0-1],range:this._$.range} | ||
break; | ||
case 105: | ||
case 113: | ||
this.$ = {type:"Object",properties:$$[$0-2],range:this._$.range} | ||
break; | ||
case 107: | ||
case 115: | ||
this.$ = {type:"Block",definitions:$$[$0-2],body:{type:"Object",properties:$$[$0-1]},range:this._$.range} | ||
break; | ||
case 108: | ||
case 116: | ||
this.$ = {type:"Block",definitions:$$[$0-3],body:{type:"Object",properties:$$[$0-2]},range:this._$.range} | ||
break; | ||
case 114: | ||
case 122: | ||
this.$ = {type:"ObjectEntry",key:{type:"Current"},value:null,range:this._$.range} | ||
break; | ||
case 115: | ||
case 123: | ||
this.$ = {type:"ObjectEntry",key:{type:"Reference",name:$$[$0]},value:null,range:this._$.range} | ||
break; | ||
case 116: case 117: | ||
case 124: case 125: | ||
this.$ = {type:"ObjectEntry",key:$$[$0],value:null,range:this._$.range} | ||
break; | ||
case 118: case 119: | ||
case 126: case 127: | ||
this.$ = {type:"ObjectEntry",key:$$[$0-2],value:$$[$0],range:this._$.range} | ||
break; | ||
case 120: | ||
case 128: | ||
this.$ = {type:"ObjectEntry",key:{type:"Identifier",name:"$" + $$[$0-2].name},value:$$[$0],range:this._$.range} | ||
break; | ||
case 121: | ||
case 129: | ||
this.$ = {type:"ObjectEntry",key:$$[$0-3],value:$$[$0],range:this._$.range} | ||
break; | ||
case 122: | ||
case 130: | ||
this.$ = {type:"Spread",query:null,array:false,range:this._$.range} | ||
break; | ||
case 123: | ||
case 131: | ||
this.$ = {type:"Spread",query:$$[$0],array:false,range:this._$.range} | ||
break; | ||
case 127: | ||
case 135: | ||
this.$ = {type:"Spread",query:null,array:true,range:this._$.range} | ||
break; | ||
case 128: | ||
case 136: | ||
this.$ = {type:"Spread",query:$$[$0],array:true,range:this._$.range} | ||
break; | ||
case 129: | ||
case 137: | ||
this.$ = {type:"Array",elements:[],range:this._$.range} | ||
break; | ||
case 130: | ||
case 138: | ||
this.$ = {type:"Array",elements:$$[$0-1],range:this._$.range} | ||
break; | ||
case 131: | ||
case 139: | ||
this.$ = {type:"Array",elements:$$[$0-2],range:this._$.range} | ||
break; | ||
case 132: | ||
case 140: | ||
this.$ = {type:"Assertion",negation:false,assertion:$$[$0],range:this._$.range} | ||
break; | ||
case 133: | ||
case 141: | ||
this.$ = {type:"Assertion",negation:true,assertion:$$[$0],range:this._$.range} | ||
break; | ||
case 134: | ||
case 142: | ||
this.$ = {type:"Assertion",negation:false,assertion:$$[$0-1],range:this._$.range} | ||
break; | ||
case 135: | ||
case 143: | ||
this.$ = {type:"Assertion",negation:true,assertion:$$[$0-1],range:this._$.range} | ||
break; | ||
case 138: | ||
case 146: | ||
this.$ = {type:"Method",reference:{type:"Reference",name:$$[$0]},arguments:[],range:this._$.range} | ||
break; | ||
case 139: | ||
case 147: | ||
this.$ = {type:"Identifier",name:String($$[$0]),range:this._$.range} | ||
break; | ||
case 141: case 142: | ||
case 149: case 150: | ||
$$[$0-2].push($$[$0-1], $$[$0]) | ||
break; | ||
case 145: | ||
case 153: | ||
this.$ = {type:"Compare",query:$$[$0-1],order:$$[$0],range:this._$.range} | ||
break; | ||
case 147: | ||
case 155: | ||
this.$ = [null,$$[$0-1],$$[$0]] | ||
break; | ||
case 149: | ||
case 157: | ||
this.$ = [$$[$0-2],$$[$0-1],$$[$0]] | ||
@@ -1188,3 +1200,2 @@ break; | ||
['$IDENT', ['$ident']], | ||
['FUNCTION', ["'=>'"]], | ||
['NOT', ["'not'"]], | ||
@@ -1442,3 +1453,3 @@ ['NO', ["'no'"]], | ||
'[', '.[', | ||
'FUNCTION', | ||
'=>', | ||
...operators, | ||
@@ -1445,0 +1456,0 @@ ...keywords, |
@@ -1,1 +0,1 @@ | ||
export const version = '1.0.0-beta.9'; | ||
export const version = '1.0.0-beta.10'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
1063711
10476
272