mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
Kotoba cannot FFI libtree-sitter. This adds lib/binding_kotoba as a host-facing node/tree/cursor API plus EDN node-types and a vendored CST fixture that compiles to Wasm with kotoba v0.7.2. Co-authored-by: Jun Kawasaki <04.feasts_minded@icloud.com>
14 lines
601 B
Bash
Executable file
14 lines
601 B
Bash
Executable file
#!/bin/sh
|
|
# Concatenate tree_sitter.kotoba with a guest file. Kotoba admits one ns per
|
|
# unit and has no require, so examples/tests are guests appended to the library.
|
|
set -eu
|
|
root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
|
|
out=${1:?"usage: bundle.sh <output.kotoba> <guest.kotoba>"}
|
|
guest=${2:?"usage: bundle.sh <output.kotoba> <guest.kotoba>"}
|
|
extra=$(grep -E '^\(defn ' "$guest" | sed -E 's/^\(defn ([^ ]+).*/\1/' | tr '\n' ' ' | sed 's/[[:space:]]*$//')
|
|
{
|
|
sed -E "s/\\(:export \\[/(:export [${extra} /" "$root/src/tree_sitter.kotoba"
|
|
printf '\n;; ---- guest ----\n'
|
|
cat "$guest"
|
|
} >"$out"
|