aboutsummaryrefslogtreecommitdiff
path: root/src/tools/xref.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/xref.sh')
-rwxr-xr-xsrc/tools/xref.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/xref.sh b/src/tools/xref.sh
new file mode 100755
index 0000000..b014dae
--- /dev/null
+++ b/src/tools/xref.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# cross-reference of the compiler's global state: who writes each global, who only reads it.
+# a shell wrapper around src/tools/xref.js (node). run `src/tools/xref.sh --help` for the options.
+# needs build/bin/zclsp (make): exact scoping comes from the language server's references.
+set -e
+here=$(cd "$(dirname "$0")" && pwd)
+if ! command -v node >/dev/null 2>&1; then
+ case "$1" in
+ --help|-h)
+ echo "usage: src/tools/xref.sh [--check|--update] [--server PATH] [--compiler-dir DIR] [--baseline FILE] [--out DIR] [--jobs N]"
+ echo "(node is required to run it)"
+ exit 0 ;;
+ esac
+ echo "xref: node is required" >&2
+ exit 3
+fi
+exec node "$here/xref.js" "$@"