Skip to content

Commit

Permalink
Add CI check that tree-sitter files are up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 3, 2024
1 parent 7145bf1 commit 3ef38f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- run: git tag pre-updates
- run: npm install
- name: Create generated files
run: |
npm run gen
git diff pre-updates --no-patch --exit-code; exitcode=$?
if [ "$exitcode" -ne 0 ]; then
echo '::error::Generated files are out of date!'
echo '::error::run `npm run gen` and commit the changes'
exit "$exitcode"
fi
- run: npm test
# FIXME: also parse tests/*.just

2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = grammar({
),

// boolean : ':=' ('true' | 'false')
boolean: (_) => choice("true", "false"),
boolean: (_) => choice("true", "false", "a"),

// expression : 'if' condition '{' expression '}' 'else' '{' expression '}'
// | value '/' expression
Expand Down

0 comments on commit 3ef38f2

Please sign in to comment.