@suss/adapter-python 0.5.0 → 0.5.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/dist/index.cjs CHANGED
@@ -994,12 +994,26 @@ function argsOf(call) {
994
994
  function calleeText(call) {
995
995
  return field(call, "function")?.text ?? call.text;
996
996
  }
997
+ function withoutChainLinks(calls) {
998
+ const isLink = /* @__PURE__ */ new Set();
999
+ for (const call of calls) {
1000
+ const callee = field(call, "function");
1001
+ if (callee === null || callee.type !== "attribute") {
1002
+ continue;
1003
+ }
1004
+ const object2 = field(callee, "object");
1005
+ if (object2 !== null && object2.type === "call") {
1006
+ isLink.add(object2.id);
1007
+ }
1008
+ }
1009
+ return calls.filter((call) => !isLink.has(call.id));
1010
+ }
997
1011
  function invocationEffects(definitionNode) {
998
1012
  const body = field(definitionNode, "body");
999
1013
  if (body === null) {
1000
1014
  return [];
1001
1015
  }
1002
- const calls = bodyCalls(body);
1016
+ const calls = withoutChainLinks(bodyCalls(body));
1003
1017
  if (calls.length === 0) {
1004
1018
  return [];
1005
1019
  }
package/dist/index.js CHANGED
@@ -950,12 +950,26 @@ function argsOf(call) {
950
950
  function calleeText(call) {
951
951
  return field(call, "function")?.text ?? call.text;
952
952
  }
953
+ function withoutChainLinks(calls) {
954
+ const isLink = /* @__PURE__ */ new Set();
955
+ for (const call of calls) {
956
+ const callee = field(call, "function");
957
+ if (callee === null || callee.type !== "attribute") {
958
+ continue;
959
+ }
960
+ const object2 = field(callee, "object");
961
+ if (object2 !== null && object2.type === "call") {
962
+ isLink.add(object2.id);
963
+ }
964
+ }
965
+ return calls.filter((call) => !isLink.has(call.id));
966
+ }
953
967
  function invocationEffects(definitionNode) {
954
968
  const body = field(definitionNode, "body");
955
969
  if (body === null) {
956
970
  return [];
957
971
  }
958
- const calls = bodyCalls(body);
972
+ const calls = withoutChainLinks(bodyCalls(body));
959
973
  if (calls.length === 0) {
960
974
  return [];
961
975
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/adapter-python",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "Python language adapter for suss — parses source with tree-sitter (WASM), resolves names with a lexical binder, and emits raw extractions for the suss pipeline.",
6
6
  "keywords": [
@@ -47,9 +47,9 @@
47
47
  "typecheck": "tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
- "@suss/behavioral-ir": "0.5.0",
51
- "@suss/datalog": "0.5.0",
52
- "@suss/extractor": "0.5.0",
50
+ "@suss/behavioral-ir": "0.5.1",
51
+ "@suss/datalog": "0.5.1",
52
+ "@suss/extractor": "0.5.1",
53
53
  "web-tree-sitter": "^0.26.11"
54
54
  },
55
55
  "devDependencies": {