Skip to content

Commit

Permalink
ref: add cobol
Browse files Browse the repository at this point in the history
And use pipe for separation
  • Loading branch information
stackmystack committed Jul 8, 2024
1 parent ac6c26e commit b7eccf4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
19 changes: 12 additions & 7 deletions lang
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ case "$OSTYPE" in
;;
esac

sep='|'
# Define:
#
# 1. the output extension
Expand All @@ -49,7 +50,7 @@ fi
shift

if [ $# -eq 0 ] || [ "$1" = "all" ]; then
langs=$(cut -d ':' -f 1 ref)
langs=$(cut -d $sep -f 1 ref)
else
langs="$@"
fi
Expand Down Expand Up @@ -122,24 +123,28 @@ compile() {
$cli build --output $out
}

for lang in $langs
do
for lang in $langs; do
cd $root
GET=tree-sitter-$lang

mkdir -p "lib"

checkout=$(sed -n -e "/^$lang:/{s///;p;q;}" ref)
if [ -d $lang ]
then
info=$(sed -n -e "/^$lang$sep/{s///;p;q;}" ref)
checkout=$(echo $info | cut -d"$sep" -f1)
repo=$(echo $info | cut -d"$sep" -f2)
if [ "$checkout" == "$repo" ]; then
repo="https://github.com/tree-sitter/$GET"
fi

if [ -d $lang ]; then
cd "$lang"
git reset --hard HEAD
else
echo "> $lang: cloning"
mkdir "$lang"
cd "$lang"
git init
git remote add origin "https://github.com/tree-sitter/$GET"
git remote add origin $repo
fi

git fetch origin --depth 1 "$checkout"
Expand Down
23 changes: 12 additions & 11 deletions ref
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
bash:7331995b19b8f8aba2d5e26deb51d2195c18bc94
c:212a80f86452bb1316324fa0db730cf52f29e05a
embedded-template:203f7bd3c1bbfbd98fc19add4b8fcb213c059205
html:949b78051835564bca937565241e5e337d838502
java:953abfc8bb3eb2f578e1f461edba4a9885f974b8
javascript:4928d3d18019a848906855476fde2dc8be030217
json:3fef30de8aee74600f25ec2e319b62a1a870d51e
php:575a0801f430c8672db70b73493c033a9dcfc328
python:82f5c9937fe4300b4bec3ee0e788d642c77aab2c
ruby:788a63ca1b7619288980aaafd37d890ee2469421
rust:9c84af007b0f144954adb26b3f336495cbb320a7
bash|7331995b19b8f8aba2d5e26deb51d2195c18bc94
c|212a80f86452bb1316324fa0db730cf52f29e05a
cobol|c7a36d749e7f1db021588259f2b1b765e59d0c12|https://github.com/yutaro-sakamoto/tree-sitter-cobol
embedded-template|203f7bd3c1bbfbd98fc19add4b8fcb213c059205
html|949b78051835564bca937565241e5e337d838502
java|953abfc8bb3eb2f578e1f461edba4a9885f974b8
javascript|4928d3d18019a848906855476fde2dc8be030217
json|3fef30de8aee74600f25ec2e319b62a1a870d51e
php|575a0801f430c8672db70b73493c033a9dcfc328
python|82f5c9937fe4300b4bec3ee0e788d642c77aab2c
ruby|788a63ca1b7619288980aaafd37d890ee2469421
rust|9c84af007b0f144954adb26b3f336495cbb320a7

0 comments on commit b7eccf4

Please sign in to comment.