Skip to content

Commit 104c25d

Browse files
committed
feat: Initial commit
0 parents  commit 104c25d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+47852
-0
lines changed

.editorconfig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{json,toml,yml,gyp}]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[*.js]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.rs]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.{c,cc,h}]
22+
indent_style = space
23+
indent_size = 4
24+
25+
[*.{py,pyi}]
26+
indent_style = space
27+
indent_size = 4
28+
29+
[*.swift]
30+
indent_style = space
31+
indent_size = 4
32+
33+
[*.go]
34+
indent_style = tab
35+
indent_size = 8
36+
37+
[Makefile]
38+
indent_style = tab
39+
indent_size = 8

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text eol=lf
2+
3+
src/*.json linguist-generated
4+
src/parser.c linguist-generated
5+
src/tree_sitter/* linguist-generated
6+
7+
bindings/** linguist-generated
8+
binding.gyp linguist-generated
9+
setup.py linguist-generated
10+
Makefile linguist-generated
11+
Package.swift linguist-generated

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "ci"

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
- src/**
9+
- test/**
10+
- bindings/**
11+
- binding.gyp
12+
pull_request:
13+
paths:
14+
- grammar.js
15+
- src/**
16+
- test/**
17+
- bindings/**
18+
- binding.gyp
19+
20+
concurrency:
21+
group: ${{github.workflow}}-${{github.ref}}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
test:
26+
name: Test parser
27+
runs-on: ${{matrix.os}}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ubuntu-latest, windows-latest, macos-14]
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
- name: Set up tree-sitter
36+
uses: tree-sitter/setup-action/cli@v1
37+
- name: Set up examples
38+
run: |-
39+
git clone https://github.com/sass/sass-spec examples/sass-spec --single-branch --depth=1 --filter=blob:none
40+
- name: Run tests
41+
uses: tree-sitter/parser-test-action@v2
42+
with:
43+
test-rust: ${{runner.os == 'Linux'}}
44+
- name: Parse examples
45+
id: examples
46+
continue-on-error: true
47+
uses: tree-sitter/parse-action@v4
48+
with:
49+
files: examples/**/*.scss
50+
- uses: actions/upload-artifact@v4
51+
if: steps.examples.outputs.failures != ''
52+
with:
53+
name: failures-${{matrix.os}}
54+
path: ${{steps.examples.outputs.failures}}

.github/workflows/fuzz.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Fuzz Parser
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- src/scanner.c
8+
pull_request:
9+
paths:
10+
- src/scanner.c
11+
12+
jobs:
13+
fuzz:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Run fuzzer
19+
uses: tree-sitter/fuzz-action@v4
20+
with:
21+
tree-sitter-version: v0.22.2

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
pull_request:
9+
paths:
10+
- grammar.js
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: npm
22+
node-version: ${{vars.NODE_VERSION}}
23+
- name: Install modules
24+
run: npm ci --legacy-peer-deps
25+
- name: Run ESLint
26+
run: npm run lint

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
concurrency:
8+
group: ${{github.workflow}}-${{github.ref}}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
npm:
13+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
14+
secrets:
15+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
16+
crates:
17+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
18+
secrets:
19+
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
20+
pypi:
21+
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
22+
secrets:
23+
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Rust artifacts
2+
Cargo.lock
3+
target/
4+
5+
# Node artifacts
6+
build/
7+
prebuilds/
8+
node_modules/
9+
*.tgz
10+
11+
# Swift artifacts
12+
.build/
13+
14+
# Go artifacts
15+
go.sum
16+
_obj/
17+
18+
# Python artifacts
19+
.venv/
20+
dist/
21+
*.egg-info
22+
*.whl
23+
24+
# C artifacts
25+
*.a
26+
*.so
27+
*.so.*
28+
*.dylib
29+
*.dll
30+
*.pc
31+
32+
# Example dirs
33+
/examples/*/
34+
35+
# Grammar volatiles
36+
*.wasm
37+
*.obj
38+
*.o

Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[package]
2+
name = "tree-sitter-scss"
3+
description = "SCSS grammar for tree-sitter"
4+
version = "1.0.0"
5+
authors = ["Amaan Qureshi <amaanq12@gmail.com>"]
6+
license = "MIT"
7+
keywords = ["incremental", "parsing", "tree-sitter", "scss"]
8+
categories = ["parsing", "text-editors"]
9+
repository = "https://github.com/tree-sitter-grammars/tree-sitter-scss"
10+
edition = "2021"
11+
autoexamples = false
12+
13+
build = "bindings/rust/build.rs"
14+
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
15+
16+
[lib]
17+
path = "bindings/rust/lib.rs"
18+
19+
[dependencies]
20+
tree-sitter = ">=0.21.0"
21+
22+
[build-dependencies]
23+
cc = "1.0.92"

Makefile

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)