#!/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" "$@"