@aiready/core 0.24.4 → 0.24.5
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 +18 -6
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -771,7 +771,9 @@ var init_python_parser = __esm({
|
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
773
|
} else if (child.type === PYTHON_CONSTANTS.NODES.ALIASED_IMPORT) {
|
|
774
|
-
const nameNode = child.childForFieldName(
|
|
774
|
+
const nameNode = child.childForFieldName(
|
|
775
|
+
PYTHON_CONSTANTS.FIELDS.NAME
|
|
776
|
+
);
|
|
775
777
|
if (nameNode) {
|
|
776
778
|
const source = nameNode.text;
|
|
777
779
|
imports.push({
|
|
@@ -792,7 +794,9 @@ var init_python_parser = __esm({
|
|
|
792
794
|
}
|
|
793
795
|
}
|
|
794
796
|
} else if (node.type === PYTHON_CONSTANTS.NODES.IMPORT_FROM_STATEMENT) {
|
|
795
|
-
const moduleNameNode = node.childForFieldName(
|
|
797
|
+
const moduleNameNode = node.childForFieldName(
|
|
798
|
+
PYTHON_CONSTANTS.FIELDS.MODULE_NAME
|
|
799
|
+
);
|
|
796
800
|
if (moduleNameNode) {
|
|
797
801
|
const source = moduleNameNode.text;
|
|
798
802
|
const specifiers = [];
|
|
@@ -800,7 +804,9 @@ var init_python_parser = __esm({
|
|
|
800
804
|
if (child.type === PYTHON_CONSTANTS.NODES.DOTTED_NAME && child !== moduleNameNode) {
|
|
801
805
|
specifiers.push(child.text);
|
|
802
806
|
} else if (child.type === PYTHON_CONSTANTS.NODES.ALIASED_IMPORT) {
|
|
803
|
-
const nameNode = child.childForFieldName(
|
|
807
|
+
const nameNode = child.childForFieldName(
|
|
808
|
+
PYTHON_CONSTANTS.FIELDS.NAME
|
|
809
|
+
);
|
|
804
810
|
if (nameNode) specifiers.push(nameNode.text);
|
|
805
811
|
} else if (child.type === PYTHON_CONSTANTS.NODES.WILDCARD_IMPORT) {
|
|
806
812
|
specifiers.push(PYTHON_CONSTANTS.SPECIAL.WILDCARD);
|
|
@@ -884,7 +890,9 @@ var init_python_parser = __esm({
|
|
|
884
890
|
} else if (node.type === PYTHON_CONSTANTS.NODES.EXPRESSION_STATEMENT) {
|
|
885
891
|
const assignment = node.firstChild;
|
|
886
892
|
if (assignment && assignment.type === PYTHON_CONSTANTS.NODES.ASSIGNMENT) {
|
|
887
|
-
const left = assignment.childForFieldName(
|
|
893
|
+
const left = assignment.childForFieldName(
|
|
894
|
+
PYTHON_CONSTANTS.FIELDS.LEFT
|
|
895
|
+
);
|
|
888
896
|
if (left && left.type === PYTHON_CONSTANTS.NODES.IDENTIFIER) {
|
|
889
897
|
const name = left.text;
|
|
890
898
|
const isInternal = name === PYTHON_CONSTANTS.SPECIAL.DUNDER_ALL || name === PYTHON_CONSTANTS.SPECIAL.DUNDER_VERSION || name === PYTHON_CONSTANTS.SPECIAL.DUNDER_AUTHOR;
|
|
@@ -915,7 +923,9 @@ var init_python_parser = __esm({
|
|
|
915
923
|
* Extract parameter names from a function definition node.
|
|
916
924
|
*/
|
|
917
925
|
extractParameters(node) {
|
|
918
|
-
const paramsNode = node.childForFieldName(
|
|
926
|
+
const paramsNode = node.childForFieldName(
|
|
927
|
+
PYTHON_CONSTANTS.FIELDS.PARAMETERS
|
|
928
|
+
);
|
|
919
929
|
if (!paramsNode) return [];
|
|
920
930
|
return paramsNode.children.filter(
|
|
921
931
|
(c) => c.type === PYTHON_CONSTANTS.NODES.IDENTIFIER || c.type === PYTHON_CONSTANTS.NODES.TYPED_PARAMETER || c.type === PYTHON_CONSTANTS.NODES.DEFAULT_PARAMETER
|
|
@@ -943,7 +953,9 @@ var init_python_parser = __esm({
|
|
|
943
953
|
]
|
|
944
954
|
};
|
|
945
955
|
} catch (error) {
|
|
946
|
-
const wrapper = new Error(
|
|
956
|
+
const wrapper = new Error(
|
|
957
|
+
`Failed to parse Python file ${filePath}: ${error.message}`
|
|
958
|
+
);
|
|
947
959
|
wrapper.cause = error;
|
|
948
960
|
throw wrapper;
|
|
949
961
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
} from "./chunk-UTCRW3N7.mjs";
|
|
59
59
|
import {
|
|
60
60
|
PythonParser
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-WH4ZGRVF.mjs";
|
|
62
62
|
import {
|
|
63
63
|
JavaParser
|
|
64
64
|
} from "./chunk-SWZOT67M.mjs";
|
|
@@ -912,7 +912,7 @@ var ParserFactory = class _ParserFactory {
|
|
|
912
912
|
return new TypeScriptParser2();
|
|
913
913
|
});
|
|
914
914
|
this.registerLazyParser("python" /* Python */, async () => {
|
|
915
|
-
const { PythonParser: PythonParser2 } = await import("./python-parser-
|
|
915
|
+
const { PythonParser: PythonParser2 } = await import("./python-parser-7QISP7LK.mjs");
|
|
916
916
|
return new PythonParser2();
|
|
917
917
|
});
|
|
918
918
|
this.registerLazyParser("java" /* Java */, async () => {
|