@hyperfixi/core 2.2.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -11
- package/dist/bundle-generator/index.js +25 -4
- package/dist/bundle-generator/index.mjs +25 -4
- package/dist/chunks/{bridge-BELRwj7r.js → bridge-Clbh_xAj.js} +2 -2
- package/dist/chunks/browser-modular-DIOxQqhV.js +2 -0
- package/dist/chunks/{index-lsDi6izr.js → index-DcxoRUBe.js} +2 -2
- package/dist/commands/index.js +36 -6
- package/dist/commands/index.mjs +36 -6
- package/dist/core/base-expression-evaluator.d.ts +4 -0
- package/dist/expressions/index.js +10 -0
- package/dist/expressions/index.mjs +10 -0
- package/dist/hyperfixi-classic-i18n.js +1 -1
- package/dist/hyperfixi-hx.js +1 -1
- package/dist/hyperfixi-hybrid-complete.js +1 -1
- package/dist/hyperfixi-minimal.js +1 -1
- package/dist/hyperfixi-multilingual.js +1 -1
- package/dist/hyperfixi-standard.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.js +175 -79
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +175 -79
- package/dist/lokascript-browser-classic-i18n.js +1 -1
- package/dist/lokascript-browser-minimal.js +1 -1
- package/dist/lokascript-browser-standard.js +1 -1
- package/dist/lokascript-browser.js +1 -1
- package/dist/lokascript-hybrid-complete.js +1 -1
- package/dist/lokascript-hybrid-hx.js +1 -1
- package/dist/lokascript-multilingual.js +1 -1
- package/dist/parser/full-parser.js +119 -70
- package/dist/parser/full-parser.mjs +119 -70
- package/dist/parser/hybrid/index.js +7 -0
- package/dist/parser/hybrid/index.mjs +7 -0
- package/dist/parser/hybrid/parser-core.js +7 -0
- package/dist/parser/hybrid/parser-core.mjs +7 -0
- package/dist/parser/hybrid/tokenizer.js +7 -0
- package/dist/parser/hybrid/tokenizer.mjs +7 -0
- package/dist/parser/hybrid-parser.js +7 -0
- package/dist/parser/hybrid-parser.mjs +7 -0
- package/dist/registry/index.js +10 -0
- package/dist/registry/index.mjs +10 -0
- package/package.json +1 -1
- package/dist/chunks/browser-modular-B7Bb-ABs.js +0 -2
package/dist/registry/index.mjs
CHANGED
|
@@ -1645,6 +1645,8 @@ class BaseExpressionEvaluator {
|
|
|
1645
1645
|
return this.evaluateIdSelector(node, context);
|
|
1646
1646
|
case 'attributeAccess':
|
|
1647
1647
|
return this.evaluateAttributeAccess(node, context);
|
|
1648
|
+
case 'asExpression':
|
|
1649
|
+
return this.evaluateAsExpression(node, context);
|
|
1648
1650
|
default:
|
|
1649
1651
|
throw new Error(`Unsupported AST node type for evaluation: ${node.type}`);
|
|
1650
1652
|
}
|
|
@@ -1930,6 +1932,14 @@ class BaseExpressionEvaluator {
|
|
|
1930
1932
|
}
|
|
1931
1933
|
return `@${node.attributeName}`;
|
|
1932
1934
|
}
|
|
1935
|
+
async evaluateAsExpression(node, context) {
|
|
1936
|
+
const value = await this.evaluate(node.expression, context);
|
|
1937
|
+
const asExpr = this.expressionRegistry.get('as');
|
|
1938
|
+
if (asExpr) {
|
|
1939
|
+
return asExpr.evaluate(context, value, node.targetType);
|
|
1940
|
+
}
|
|
1941
|
+
throw new Error(`Conversion type 'as' not registered`);
|
|
1942
|
+
}
|
|
1933
1943
|
getAvailableExpressions() {
|
|
1934
1944
|
return Array.from(this.expressionRegistry.keys());
|
|
1935
1945
|
}
|