@generaltranslation/python-extractor 0.0.1-alpha.0 → 0.1.0
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/extractCalls.js
CHANGED
|
@@ -65,7 +65,9 @@ async function processCall(callNode, imports, filePath, calls, errors, _warnings
|
|
|
65
65
|
containsStaticCalls(firstArg, imports)) ||
|
|
66
66
|
(firstArg.type === 'binary_operator' &&
|
|
67
67
|
containsStaticCalls(firstArg, imports)) ||
|
|
68
|
-
(firstArg.type === 'call' && containsStaticCalls(firstArg, imports))
|
|
68
|
+
(firstArg.type === 'call' && containsStaticCalls(firstArg, imports)) ||
|
|
69
|
+
(firstArg.type === 'parenthesized_expression' &&
|
|
70
|
+
containsStaticCalls(firstArg, imports));
|
|
69
71
|
if (hasStaticHelpers) {
|
|
70
72
|
// Compound expression path: parse into StringNode tree
|
|
71
73
|
const rootNode = callNode.tree?.rootNode;
|
|
@@ -34,6 +34,16 @@ function hasStaticCallRecursive(node, names) {
|
|
|
34
34
|
* binary + concatenation, and standalone declare_static calls.
|
|
35
35
|
*/
|
|
36
36
|
export async function parseStringExpression(node, ctx) {
|
|
37
|
+
// Parenthesized expression: unwrap and recurse
|
|
38
|
+
if (node.type === 'parenthesized_expression') {
|
|
39
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
40
|
+
const child = node.child(i);
|
|
41
|
+
if (child && child.type !== '(' && child.type !== ')') {
|
|
42
|
+
return parseStringExpression(child, ctx);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
37
47
|
// Plain string (no f-string)
|
|
38
48
|
if (node.type === 'string' && !isFString(node)) {
|
|
39
49
|
const content = extractStringContent(node);
|