Skip to content

Commit

Permalink
Switch the default ABI on with-generated-files
Browse files Browse the repository at this point in the history
Fixes #352
  • Loading branch information
alex-pinkus committed Feb 18, 2024
1 parent dabbcf9 commit bd81fff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/write-generated-grammar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ git reset HEAD@{1}
npm install
npm run test-ci

# Now that we know the parser works, build for ABI 14 (but don't use this as the default because
# it's not compatible everywhere).
# Now that we know the parser works generate grammar files explicitly for each relatively recent ABI. Although there are
# no known use cases that still depend on ABI 13, it does no harm to keep it around in case such a use case exists.
npx tree-sitter generate --abi 13
mv src/parser.c src/parser_abi13.c
npx tree-sitter generate --abi 14
mv src/parser.c src/parser_abi14.c
mv src/parser_abi13.c src/parser.c
# Leave the ABI 14 parser in place as the default, since it gives significant speed improvements over ABI 13.
cp src/parser.c src/parser_abi14.c

# Commit specific generated files, attributing the changes to the primary maintainer of this
# grammar. Notably, we do not commit the `.o` files generated during the build, just the source.
Expand Down

0 comments on commit bd81fff

Please sign in to comment.