c-next 0.2.7 → 0.2.8
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/dist/index.js +12 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/transpiler/output/codegen/generators/expressions/CallExprGenerator.ts +20 -0
- package/src/transpiler/output/codegen/generators/expressions/PostfixExpressionGenerator.ts +4 -0
- package/src/transpiler/output/codegen/generators/expressions/__tests__/CallExprGenerator.test.ts +60 -0
- package/src/transpiler/output/codegen/helpers/ParameterDereferenceResolver.ts +8 -4
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { hideBin } from "yargs/helpers";
|
|
|
10
10
|
// package.json
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "c-next",
|
|
13
|
-
version: "0.2.
|
|
13
|
+
version: "0.2.8",
|
|
14
14
|
description: "A safer C for embedded systems development. Transpiles to clean, readable C.",
|
|
15
15
|
packageManager: "npm@11.9.0",
|
|
16
16
|
type: "module",
|
|
@@ -115127,6 +115127,17 @@ var _parameterExpectsAddressOf = (paramType, argType, orchestrator) => {
|
|
|
115127
115127
|
return paramBaseType === argType;
|
|
115128
115128
|
};
|
|
115129
115129
|
var _generateCFunctionArg = (e, targetParam, input, orchestrator) => {
|
|
115130
|
+
const argIdentifier = orchestrator.getSimpleIdentifier(e);
|
|
115131
|
+
const paramInfo = argIdentifier ? CodeGenState.currentParameters.get(argIdentifier) : void 0;
|
|
115132
|
+
const isCallbackPromotedParam = paramInfo?.forcePointerSemantics ?? false;
|
|
115133
|
+
if (targetParam?.baseType?.endsWith("*") && isCallbackPromotedParam) {
|
|
115134
|
+
return wrapWithCppEnumCast(
|
|
115135
|
+
argIdentifier,
|
|
115136
|
+
e,
|
|
115137
|
+
targetParam?.baseType,
|
|
115138
|
+
orchestrator
|
|
115139
|
+
);
|
|
115140
|
+
}
|
|
115130
115141
|
let argCode = orchestrator.generateExpression(e);
|
|
115131
115142
|
if (!targetParam?.baseType?.endsWith("*")) {
|
|
115132
115143
|
return wrapWithCppEnumCast(argCode, e, targetParam?.baseType, orchestrator);
|