@generaltranslation/python-extractor 0.0.1-alpha.0 → 0.1.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.
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@generaltranslation/python-extractor",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.1.1",
4
4
  "description": "Python source code extraction for General Translation",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "tree-sitter-python": "^0.25.0",
49
49
  "web-tree-sitter": "^0.26.6",
50
- "generaltranslation": "8.1.14"
50
+ "generaltranslation": "8.1.15"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsc",