Comparing version 0.27.0 to 0.28.0
@@ -9,2 +9,7 @@ # Changelog | ||
## 0.28.0 | ||
* `FEAT`: support `FunctionDefinition` | ||
* `DEPS`: bump to `lezer-feel@0.8.8` | ||
## 0.27.0 | ||
@@ -14,3 +19,3 @@ | ||
* `FEAT`: support incremental context definition | ||
* `DEPS`: bump to `lezer-feel@0.7.0` | ||
* `DEPS`: bump to `lezer-feel@0.8.0` | ||
@@ -17,0 +22,0 @@ ### Breaking Changes |
@@ -655,2 +655,22 @@ import { parser, trackVariables, normalizeContext } from 'lezer-feel'; | ||
}; | ||
case 'FunctionBody': return args[0]; | ||
case 'FormalParameters': return args; | ||
case 'FormalParameter': return args[0]; | ||
case 'ParameterName': return args.join(' '); | ||
case 'FunctionDefinition': return function (context) { | ||
var parameterNames = args[2]; | ||
var fnBody = args[4]; | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fnContext = parameterNames.reduce(function (context, name, idx) { | ||
// support positional parameters | ||
context[name] = args[idx]; | ||
return context; | ||
}, __assign({}, context)); | ||
return fnBody(fnContext); | ||
}; | ||
}; | ||
case 'ContextEntry': return function (context) { | ||
@@ -657,0 +677,0 @@ var key = typeof args[0] === 'function' ? args[0](context) : args[0]; |
@@ -659,2 +659,22 @@ 'use strict'; | ||
}; | ||
case 'FunctionBody': return args[0]; | ||
case 'FormalParameters': return args; | ||
case 'FormalParameter': return args[0]; | ||
case 'ParameterName': return args.join(' '); | ||
case 'FunctionDefinition': return function (context) { | ||
var parameterNames = args[2]; | ||
var fnBody = args[4]; | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fnContext = parameterNames.reduce(function (context, name, idx) { | ||
// support positional parameters | ||
context[name] = args[idx]; | ||
return context; | ||
}, __assign({}, context)); | ||
return fnBody(fnContext); | ||
}; | ||
}; | ||
case 'ContextEntry': return function (context) { | ||
@@ -661,0 +681,0 @@ var key = typeof args[0] === 'function' ? args[0](context) : args[0]; |
{ | ||
"name": "feelin", | ||
"version": "0.27.0", | ||
"version": "0.28.0", | ||
"description": "A FEEL parser and interpreter", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.js", | ||
"@lezer/lr": "^1.2.0", | ||
"lezer-feel": "^0.8.6" | ||
"lezer-feel": "^0.8.8" | ||
}, | ||
@@ -60,3 +60,6 @@ "repository": { | ||
"tck:test": "mocha test/tck/*.js" | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
} |
Sorry, the diff of this file is too big to display
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
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
420715
7796
Updatedlezer-feel@^0.8.8