@suss/resolution 0.31.1 → 0.32.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
@@ -80,6 +80,7 @@ var ASKING_RELATIONS = [
80
80
  "wanted",
81
81
  "wantedUnder",
82
82
  "wantedSites",
83
+ "wantedEnvSite",
83
84
  "wantedOrigin",
84
85
  "wantedCallOrigin",
85
86
  "wantedExportsOf",
@@ -1994,6 +1995,44 @@ var STATED_RULES = [
1994
1995
  (0, import_datalog4.lit)("callKeywordArg", (0, import_datalog4.variable)("r"), (0, import_datalog4.variable)("n"), (0, import_datalog4.variable)("a"))
1995
1996
  ]
1996
1997
  ),
1998
+ // The expressions that refer to a parameter by binding alone. An
1999
+ // adapter may key a read of the parameter as the parameter itself,
2000
+ // or as its own node linked by binds; both arrive here.
2001
+ (0, import_datalog4.rule)(
2002
+ "refersToParam",
2003
+ [(0, import_datalog4.variable)("p"), (0, import_datalog4.variable)("p")],
2004
+ [(0, import_datalog4.lit)("paramOf", (0, import_datalog4.variable)("f"), (0, import_datalog4.variable)("k"), (0, import_datalog4.variable)("p"))]
2005
+ ),
2006
+ (0, import_datalog4.rule)(
2007
+ "refersToParam",
2008
+ [(0, import_datalog4.variable)("p"), (0, import_datalog4.variable)("p")],
2009
+ [(0, import_datalog4.lit)("paramNamed", (0, import_datalog4.variable)("f"), (0, import_datalog4.variable)("n"), (0, import_datalog4.variable)("p"))]
2010
+ ),
2011
+ (0, import_datalog4.rule)(
2012
+ "refersToParam",
2013
+ [(0, import_datalog4.variable)("x"), (0, import_datalog4.variable)("p")],
2014
+ [(0, import_datalog4.lit)("refersToParam", (0, import_datalog4.variable)("y"), (0, import_datalog4.variable)("p")), (0, import_datalog4.lit)("binds", (0, import_datalog4.variable)("x"), (0, import_datalog4.variable)("y"))]
2015
+ ),
2016
+ // A parameter whose value is an environment variable's name: a read
2017
+ // site takes its name from it, or it is handed on to a parameter that
2018
+ // does. Asked from the site, so the recursion runs callee to caller.
2019
+ (0, import_datalog4.rule)(
2020
+ "paramNamesEnv",
2021
+ [(0, import_datalog4.variable)("p"), (0, import_datalog4.variable)("site")],
2022
+ [
2023
+ (0, import_datalog4.lit)("readsEnvNamed", (0, import_datalog4.variable)("site"), (0, import_datalog4.variable)("x")),
2024
+ (0, import_datalog4.lit)("refersToParam", (0, import_datalog4.variable)("x"), (0, import_datalog4.variable)("p"))
2025
+ ]
2026
+ ),
2027
+ (0, import_datalog4.rule)(
2028
+ "paramNamesEnv",
2029
+ [(0, import_datalog4.variable)("p"), (0, import_datalog4.variable)("site")],
2030
+ [
2031
+ (0, import_datalog4.lit)("refersToParam", (0, import_datalog4.variable)("a"), (0, import_datalog4.variable)("p")),
2032
+ (0, import_datalog4.lit)("passesArgument", (0, import_datalog4.variable)("r"), (0, import_datalog4.variable)("q"), (0, import_datalog4.variable)("a")),
2033
+ (0, import_datalog4.lit)("paramNamesEnv", (0, import_datalog4.variable)("q"), (0, import_datalog4.variable)("site"))
2034
+ ]
2035
+ ),
1997
2036
  // Which module's export a re-exported name forwards to, however
1998
2037
  // many barrels deep the forwarding runs.
1999
2038
  (0, import_datalog4.rule)(
@@ -2530,6 +2569,13 @@ var RESOLUTION_QUESTIONS = [
2530
2569
  [(0, import_datalog4.variable)("f"), (0, import_datalog4.variable)("c")],
2531
2570
  [(0, import_datalog4.lit)("wanted", (0, import_datalog4.variable)("f")), (0, import_datalog4.lit)("returnsCall", (0, import_datalog4.variable)("f"), (0, import_datalog4.variable)("c"))]
2532
2571
  ),
2572
+ // Seeded with the read sites, a handful per project, so one question
2573
+ // gives every parameter a reader at a call could meet.
2574
+ (0, import_datalog4.rule)(
2575
+ "wantedParamNamesEnv",
2576
+ [(0, import_datalog4.variable)("p"), (0, import_datalog4.variable)("site")],
2577
+ [(0, import_datalog4.lit)("wantedEnvSite", (0, import_datalog4.variable)("site")), (0, import_datalog4.lit)("paramNamesEnv", (0, import_datalog4.variable)("p"), (0, import_datalog4.variable)("site"))]
2578
+ ),
2533
2579
  (0, import_datalog4.rule)(
2534
2580
  "wantedComesFrom",
2535
2581
  [(0, import_datalog4.variable)("x"), (0, import_datalog4.variable)("m"), (0, import_datalog4.variable)("n")],
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ var ASKING_RELATIONS = [
13
13
  "wanted",
14
14
  "wantedUnder",
15
15
  "wantedSites",
16
+ "wantedEnvSite",
16
17
  "wantedOrigin",
17
18
  "wantedCallOrigin",
18
19
  "wantedExportsOf",
@@ -1927,6 +1928,44 @@ var STATED_RULES = [
1927
1928
  lit("callKeywordArg", v("r"), v("n"), v("a"))
1928
1929
  ]
1929
1930
  ),
1931
+ // The expressions that refer to a parameter by binding alone. An
1932
+ // adapter may key a read of the parameter as the parameter itself,
1933
+ // or as its own node linked by binds; both arrive here.
1934
+ rule(
1935
+ "refersToParam",
1936
+ [v("p"), v("p")],
1937
+ [lit("paramOf", v("f"), v("k"), v("p"))]
1938
+ ),
1939
+ rule(
1940
+ "refersToParam",
1941
+ [v("p"), v("p")],
1942
+ [lit("paramNamed", v("f"), v("n"), v("p"))]
1943
+ ),
1944
+ rule(
1945
+ "refersToParam",
1946
+ [v("x"), v("p")],
1947
+ [lit("refersToParam", v("y"), v("p")), lit("binds", v("x"), v("y"))]
1948
+ ),
1949
+ // A parameter whose value is an environment variable's name: a read
1950
+ // site takes its name from it, or it is handed on to a parameter that
1951
+ // does. Asked from the site, so the recursion runs callee to caller.
1952
+ rule(
1953
+ "paramNamesEnv",
1954
+ [v("p"), v("site")],
1955
+ [
1956
+ lit("readsEnvNamed", v("site"), v("x")),
1957
+ lit("refersToParam", v("x"), v("p"))
1958
+ ]
1959
+ ),
1960
+ rule(
1961
+ "paramNamesEnv",
1962
+ [v("p"), v("site")],
1963
+ [
1964
+ lit("refersToParam", v("a"), v("p")),
1965
+ lit("passesArgument", v("r"), v("q"), v("a")),
1966
+ lit("paramNamesEnv", v("q"), v("site"))
1967
+ ]
1968
+ ),
1930
1969
  // Which module's export a re-exported name forwards to, however
1931
1970
  // many barrels deep the forwarding runs.
1932
1971
  rule(
@@ -2463,6 +2502,13 @@ var RESOLUTION_QUESTIONS = [
2463
2502
  [v("f"), v("c")],
2464
2503
  [lit("wanted", v("f")), lit("returnsCall", v("f"), v("c"))]
2465
2504
  ),
2505
+ // Seeded with the read sites, a handful per project, so one question
2506
+ // gives every parameter a reader at a call could meet.
2507
+ rule(
2508
+ "wantedParamNamesEnv",
2509
+ [v("p"), v("site")],
2510
+ [lit("wantedEnvSite", v("site")), lit("paramNamesEnv", v("p"), v("site"))]
2511
+ ),
2466
2512
  rule(
2467
2513
  "wantedComesFrom",
2468
2514
  [v("x"), v("m"), v("n")],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/resolution",
3
- "version": "0.31.1",
3
+ "version": "0.32.0",
4
4
  "type": "module",
5
5
  "description": "The rules suss uses to follow a name in TypeScript, Python or Ruby to the function it comes down to.",
6
6
  "keywords": [
@@ -56,6 +56,6 @@
56
56
  "access": "public"
57
57
  },
58
58
  "dependencies": {
59
- "@suss/datalog": "0.31.1"
59
+ "@suss/datalog": "0.32.0"
60
60
  }
61
61
  }