HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //home/ubuntu/neovim/.deps/build/src/treesitter/script/generate-bindings
#!/bin/bash

output_path=lib/binding_rust/bindings.rs
header_path=lib/include/tree_sitter/api.h
no_derive_copy=(
  TSInput
  TSLanguage
  TSLogger
  TSLookaheadIterator
  TSParser
  TSTree
  TSQuery
  TSQueryCursor
  TSQueryCapture
  TSQueryMatch
  TSQueryPredicateStep
)
no_copy=$(IFS='|'; echo "${no_derive_copy[*]}")

file_version=$(head -n1 "$output_path" | cut -d' ' -f6)
tool_version=$(bindgen --version | cut -d' ' -f2)
higher_version=$(printf '%s\n' "$file_version" "$tool_version" | sort -V | tail -n1)

if [[ "$higher_version" != "$tool_version" ]]; then
  printf 'Latest used bindgen version was %s\n' "$file_version" >&2
  printf 'Currently installed bindgen CLI version is %s\n\n' "$tool_version" >&2
  # shellcheck disable=SC2016
  printf 'You must upgrade bindgen CLI first with `cargo install bindgen-cli`\n' >&2
  exit 1
fi

bindgen                                        \
  --no-layout-tests                            \
  --allowlist-type '^TS.*'                     \
  --allowlist-function '^ts_.*'                \
  --allowlist-var '^TREE_SITTER.*'             \
  --blocklist-type '^__.*'                     \
  --no-prepend-enum-name                       \
  --no-copy "$no_copy"                         \
  "$header_path"                               \
  --                                           \
  -D TREE_SITTER_FEATURE_WASM                  \
  > "$output_path"