diff options
Diffstat (limited to 'admin/notes/tree-sitter/build-module')
-rw-r--r-- | admin/notes/tree-sitter/build-module/README | 17 | ||||
-rwxr-xr-x | admin/notes/tree-sitter/build-module/batch.sh | 27 | ||||
-rwxr-xr-x | admin/notes/tree-sitter/build-module/build.sh | 86 |
3 files changed, 0 insertions, 130 deletions
diff --git a/admin/notes/tree-sitter/build-module/README b/admin/notes/tree-sitter/build-module/README deleted file mode 100644 index 2fcb9778dae..00000000000 --- a/admin/notes/tree-sitter/build-module/README +++ /dev/null @@ -1,17 +0,0 @@ -To build the language definition for a particular language, run - - ./build.sh <language> - -eg, - - ./build.sh html - -The dynamic module will be in /dist directory - -To build all modules at once, run - - ./batch.sh - -This gives you C, JSON, Go, HTML, Javascript, CSS, Python, Typescript -(tsx), C# (csharp), C++ (cpp), Rust. More can be added to batch.sh -unless it's directory structure is not standard.
\ No newline at end of file diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree-sitter/build-module/batch.sh deleted file mode 100755 index 58272c74549..00000000000 --- a/admin/notes/tree-sitter/build-module/batch.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -languages=( - 'bash' - 'c' - 'cmake' - 'cpp' - 'css' - 'c-sharp' - 'dockerfile' - 'go' - 'go-mod' - 'html' - 'javascript' - 'json' - 'python' - 'rust' - 'toml' - 'tsx' - 'typescript' - 'yaml' -) - -for language in "${languages[@]}" -do - ./build.sh $language -done diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh deleted file mode 100755 index 9dc674237ca..00000000000 --- a/admin/notes/tree-sitter/build-module/build.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -lang=$1 -topdir="$PWD" - -case $(uname) in - "Darwin") - soext="dylib" - ;; - *"MINGW"*) - soext="dll" - ;; - *) - soext="so" - ;; -esac - -echo "Building ${lang}" - -### Retrieve sources - -org="tree-sitter" -repo="tree-sitter-${lang}" -sourcedir="tree-sitter-${lang}/src" -grammardir="tree-sitter-${lang}" - -case "${lang}" in - "dockerfile") - org="camdencheek" - ;; - "cmake") - org="uyha" - ;; - "go-mod") - # The parser is called "gomod". - lang="gomod" - org="camdencheek" - ;; - "typescript") - sourcedir="tree-sitter-typescript/typescript/src" - grammardir="tree-sitter-typescript/typescript" - ;; - "tsx") - repo="tree-sitter-typescript" - sourcedir="tree-sitter-typescript/tsx/src" - grammardir="tree-sitter-typescript/tsx" - ;; - "yaml") - org="ikatyang" - ;; -esac - -git clone "https://github.com/${org}/${repo}.git" \ - --depth 1 --quiet -cp "${grammardir}"/grammar.js "${sourcedir}" -# We have to go into the source directory to compile, because some -# C files refer to files like "../../common/scanner.h". -cd "${sourcedir}" - -### Build - -cc -fPIC -c -I. parser.c -# Compile scanner.c. -if test -f scanner.c -then - cc -fPIC -c -I. scanner.c -fi -# Compile scanner.cc. -if test -f scanner.cc -then - c++ -fPIC -I. -c scanner.cc -fi -# Link. -if test -f scanner.cc -then - c++ -fPIC -shared *.o -o "libtree-sitter-${lang}.${soext}" -else - cc -fPIC -shared *.o -o "libtree-sitter-${lang}.${soext}" -fi - -### Copy out - -mkdir -p "${topdir}/dist" -cp "libtree-sitter-${lang}.${soext}" "${topdir}/dist" -cd "${topdir}" -rm -rf "${repo}" |