-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- grammar.js | ||
- src/** | ||
- test/** | ||
- bindings/** | ||
- binding.gyp | ||
pull_request: | ||
paths: | ||
- grammar.js | ||
- src/** | ||
- test/** | ||
- bindings/** | ||
- binding.gyp | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Test parser | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-14] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up tree-sitter | ||
uses: tree-sitter/setup-action/cli@v1 | ||
- name: Run tests | ||
uses: tree-sitter/parser-test-action@v2 | ||
with: | ||
test-rust: ${{runner.os == 'Linux'}} | ||
test-node: true | ||
test-python: true | ||
test-go: true | ||
test-swift: ${{runner.os == 'macOS'}} | ||
- name: Parse examples | ||
uses: tree-sitter/parse-action@v4 | ||
with: | ||
files: examples/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- grammar.js | ||
pull_request: | ||
paths: | ||
- grammar.js | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
node-version: [22] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Run ESLint | ||
run: npm run lint |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
const treeSitterGlobals = { | ||
$: "readonly", | ||
token: "readonly", | ||
seq: "readonly", | ||
repeat: "readonly", | ||
repeat1: "readonly", | ||
choice: "readonly", | ||
prec: "readonly", | ||
field: "readonly", | ||
alias: "readonly", | ||
optional: "readonly", | ||
grammar: "readonly", | ||
}; | ||
export default [ | ||
{ | ||
files: ["**/*.js"], | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
}, | ||
}, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...treeSitterGlobals, | ||
}, | ||
}, | ||
}, | ||
pluginJs.configs.recommended, | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(module todos G | ||
(defcap G () true) | ||
(defschema todo | ||
@doc "A todo item" | ||
id:integer | ||
title:string | ||
completed:bool | ||
) | ||
(deftable todo-table:{todo}) | ||
|
||
(defun read-todo () | ||
"Read a todo." | ||
(format "Todo: {}" (keys todo-table)) | ||
) | ||
(defun read-todos () | ||
"Read all todos." | ||
(map (read-todo) (keys todo-table)) | ||
) | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/tree-sitter/tree-sitter-pact | ||
|
||
go 1.23 | ||
|
||
require github.com/tree-sitter/go-tree-sitter v0.23 |