Skip to content

Commit

Permalink
Merge pull request #149 from ember-tooling/updates
Browse files Browse the repository at this point in the history
Update tree-sitter-cli, injections, etc
  • Loading branch information
NullVoxPopuli authored Aug 20, 2024
2 parents 6b25d26 + c7da170 commit bef3afc
Show file tree
Hide file tree
Showing 42 changed files with 2,177 additions and 2,117 deletions.
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4

[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.{py,pyi}]
indent_style = space
indent_size = 4

[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
indent_size = 8

[Makefile]
indent_style = tab
indent_size = 8
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text eol=lf

src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
push:
branches:
- master
- main
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
- .github/workflows/ci.yml
pull_request:
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
- .github/workflows/ci.yml

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
name: Test parser
runs-on: ${{matrix.os}}
if: >-
!github.event.repository.is_template &&
github.event.head_commit.message != 'Initial commit'
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:
# We don't support rust bundling for now
test-rust: false
# test-rust: ${{runner.os == 'Linux'}}
fuzz:
name: Fuzz scanner
runs-on: ubuntu-latest
if: >-
!github.event.repository.is_template &&
github.event.head_commit.message != 'Initial commit'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for scanner changes
id: scanner-check
shell: sh
run: |-
{
test -f src/scanner.c && ! git diff --quiet HEAD^ -- "$_" &&
printf 'changed=true\n' || printf 'changed=false\n'
} >> "$GITHUB_OUTPUT"
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
if: steps.scanner-check.outputs.changed == 'true'
19 changes: 19 additions & 0 deletions .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Regenerate parser

on:
pull_request:

permissions:
contents: write
pull-requests: write

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
regenerate:
uses: tree-sitter/workflows/.github/workflows/regenerate.yml@main
if: >-
!github.event.repository.is_template &&
github.actor == 'dependabot[bot]'
71 changes: 0 additions & 71 deletions .github/workflows/verify.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Local Building
parser/*.so

# Dependencies
node_modules
Cargo.lock
Expand Down
22 changes: 10 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
[package]
name = "tree-sitter-glimmer"
description = "glimmer grammar for the tree-sitter parsing library"
description = "Glimmer grammar for tree-sitter"
version = "0.0.1"
keywords = ["incremental", "parsing", "glimmer"]
license = "MIT"
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "glimmer"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-javascript"
edition = "2018"
repository = "https://github.com/tree-sitter/tree-sitter-glimmer"
edition = "2021"
autoexamples = false

build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
]
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "0.20"
tree-sitter = ">=0.22.6"

[build-dependencies]
cc = "1.0"
cc = "1.0.87"
109 changes: 109 additions & 0 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bef3afc

Please sign in to comment.