@suss/resolution 0.4.0 → 0.5.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/index.cjs CHANGED
@@ -258,21 +258,22 @@ var RESOLUTION_RULES = [
258
258
  ]
259
259
  ),
260
260
  // Which calls a function, found by the name the call is written as
261
- // rather than by resolving every callee in the project. Asking what
262
- // reaches a parameter means looking for call sites, and looking for
263
- // them the other way round costs a whole-project resolution.
261
+ // rather than by resolving every callee in the project. A caller knows
262
+ // the function and wants its call sites, so both of these start from
263
+ // the function. Starting from `call` instead asks what every call in
264
+ // the project imports, which was 72% of everything derived.
264
265
  (0, import_datalog.rule)(
265
266
  "callsFunction",
266
267
  [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")],
267
- [(0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")), (0, import_datalog.lit)("binds", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f"))]
268
+ [(0, import_datalog.lit)("binds", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f")), (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c"))]
268
269
  ),
269
270
  (0, import_datalog.rule)(
270
271
  "callsFunction",
271
272
  [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")],
272
273
  [
273
- (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
274
+ (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("f")),
274
275
  (0, import_datalog.lit)("imports", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")),
275
- (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("f"))
276
+ (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c"))
276
277
  ]
277
278
  ),
278
279
  // A function whose return is itself a call arrives at the same object
package/dist/index.js CHANGED
@@ -228,21 +228,22 @@ var RESOLUTION_RULES = [
228
228
  ]
229
229
  ),
230
230
  // Which calls a function, found by the name the call is written as
231
- // rather than by resolving every callee in the project. Asking what
232
- // reaches a parameter means looking for call sites, and looking for
233
- // them the other way round costs a whole-project resolution.
231
+ // rather than by resolving every callee in the project. A caller knows
232
+ // the function and wants its call sites, so both of these start from
233
+ // the function. Starting from `call` instead asks what every call in
234
+ // the project imports, which was 72% of everything derived.
234
235
  rule(
235
236
  "callsFunction",
236
237
  [v("r"), v("f")],
237
- [lit("call", v("r"), v("c")), lit("binds", v("c"), v("f"))]
238
+ [lit("binds", v("c"), v("f")), lit("call", v("r"), v("c"))]
238
239
  ),
239
240
  rule(
240
241
  "callsFunction",
241
242
  [v("r"), v("f")],
242
243
  [
243
- lit("call", v("r"), v("c")),
244
+ lit("moduleExport", v("m"), v("n"), v("f")),
244
245
  lit("imports", v("c"), v("m"), v("n")),
245
- lit("moduleExport", v("m"), v("n"), v("f"))
246
+ lit("call", v("r"), v("c"))
246
247
  ]
247
248
  ),
248
249
  // A function whose return is itself a call arrives at the same object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/resolution",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Language-neutral rules for following a value to the function it comes down to.",
6
6
  "keywords": [
@@ -53,6 +53,6 @@
53
53
  "access": "public"
54
54
  },
55
55
  "dependencies": {
56
- "@suss/datalog": "0.4.0"
56
+ "@suss/datalog": "0.5.0"
57
57
  }
58
58
  }