Skip to content

Commit dd3798a

Browse files
Initial commit
0 parents  commit dd3798a

File tree

139 files changed

+1117234
-0
lines changed

Some content is hidden

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

139 files changed

+1117234
-0
lines changed

.commitlintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// This file is to enforce conventional commits
2+
module.exports = {
3+
'extends': ['@commitlint/config-conventional']
4+
}

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
env: {
3+
commonjs: true,
4+
es2021: true,
5+
},
6+
extends: ['google', 'plugin:md/prettier', 'plugin:prettier/recommended'],
7+
overrides: [],
8+
plugins: ['prettier'],
9+
parserOptions: {
10+
ecmaVersion: 'latest',
11+
sourceType: 'module',
12+
},
13+
rules: {
14+
'prettier/prettier': 'error',
15+
'max-len': [
16+
'error',
17+
{
18+
code: 120,
19+
ignoreComments: true,
20+
ignoreUrls: true,
21+
ignoreStrings: true,
22+
},
23+
],
24+
},
25+
};

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Files to be excluded from publishing
2+
3+
html/* export-ignore
4+
scripts/* export-ignore
5+
test/* export-ignore
6+
7+

.github/workflow-templates/basic.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Gitea Actions Demo
2+
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
3+
on:
4+
push:
5+
branches: [ $default-branch ]
6+
pull_request:
7+
branches: [ $default-branch ]
8+
9+
jobs:
10+
Explore-Gitea-Actions:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
14+
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
15+
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
16+
- name: Check out repository code
17+
uses: actions/checkout@v4
18+
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
19+
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
20+
- name: List files in the repository
21+
run: |
22+
ls ${{ gitea.workspace }}
23+
- run: echo "🍏 This job's status is ${{ job.status }}."

.github/workflow-templates/metal.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Gitea Actions Demo
2+
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
3+
on: [push]
4+
5+
jobs:
6+
Explore-Gitea-Actions:
7+
# Use rdp_metal to make sure the action picks a runner that is on the rdp node, not a docker image
8+
runs-on: rdp_metal
9+
steps:
10+
- run: pwd
11+
- run: ls -la
12+
- run: echo "🍏 This job's status is ${{ job.status }}."

.github/workflows/ci.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: ci
2+
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
- name: Install Node and NPM
16+
uses: actions/setup-node@v4
17+
- name: Install dependencies
18+
run: npm ci --include=dev # We need devDependencies for npx tree-sitter
19+
- name: "Generate parser.c's"
20+
run: "npm run gen"
21+
- name: "Build parsers"
22+
run: "npm run build"
23+
test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check out repository code
27+
uses: actions/checkout@v4
28+
- name: Install Node and NPM
29+
uses: actions/setup-node@v4
30+
- name: Install dependencies
31+
run: npm ci --include=dev # We need devDependencies for npx tree-sitter
32+
- name: "Test expr"
33+
if: success() || failure()
34+
run: "npm run test --workspace=expr"
35+
- name: "Test core"
36+
if: success() || failure()
37+
run: "npm run test --workspace=core"
38+
- name: "Test html"
39+
if: success() || failure()
40+
run: "npm run test --workspace=html"
41+
- name: "Test udl"
42+
if: success() || failure()
43+
run: "npm run test --workspace=udl"
44+
benchmark:
45+
name: Benchmark
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Check out repository code
49+
uses: actions/checkout@v4
50+
- name: Install Node and NPM
51+
uses: actions/setup-node@v4
52+
- name: Install dependencies
53+
run: npm ci --include=dev # We need devDependencies for npx tree-sitter
54+
- name: Configure tree sitter cli for parsing
55+
run: npx tree-sitter init-config
56+
- name: Benchmark UDL
57+
run: ./benches/x.sh 1> "../${{ runner.os }}-benchmark.json"
58+
working-directory: ./udl
59+
# Download previous benchmark result from cache (if exists)
60+
- name: Download previous benchmark data
61+
if: success() || failure()
62+
uses: actions/cache/restore@v4
63+
with:
64+
path: ./cache
65+
key: ${{ runner.os }}-benchmark
66+
# Run `github-action-benchmark` action
67+
- name: Store benchmark result
68+
uses: benchmark-action/github-action-benchmark@v1
69+
if: success() || failure()
70+
with:
71+
# What benchmark tool the output.txt came from
72+
tool: 'customSmallerIsBetter'
73+
github-token: ${{ secrets.KERNEL_BOT_TOKEN }}
74+
#gh-repository: http://rdp.iscinternal.com:3000/KernelRuntime/tree-sitter-objectscript
75+
comment-always: true
76+
#gh-pages-branch: 'main'
77+
#benchmark-data-dir-path: docs/dev/bench
78+
# Where the output from the benchmark tool is stored
79+
output-file-path: "${{ runner.os }}-benchmark.json"
80+
# Where the previous data file is stored
81+
external-data-json-path: "./cache/${{ runner.os }}-benchmark.json"
82+
# Upload the updated cache
83+
- name: Move new bench mark to cache folder
84+
run: mkdir -p .cache && mv ${{ runner.os }}-benchmark.json cache/
85+
- name: Upload updated benchmarks
86+
uses: actions/cache/save@v4
87+
if: success() || failure() # TODO: Remove this after 1 run?
88+
with:
89+
path: |
90+
cache/${{ runner.os }}-benchmark.json
91+
key: ${{ runner.os }}-benchmark

.github/workflows/playground.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: playground
2+
run-name: ${{ gitea.actor }} build and run tree-sitter-objectscript on rdp.iscinternal.com 🚀
3+
on: [push]
4+
5+
jobs:
6+
RDP-Playground:
7+
# MUST Use rdp_metal to make sure the action picks a runner that is on the rdp node, not a docker image
8+
# You should NOT use this in general for CI. Prefer the runner daemon on docker
9+
# See ci.yaml for our main workflow
10+
runs-on: rdp_metal
11+
steps:
12+
- run: printenv
13+
- run: id
14+
- name: Check out repository code
15+
uses: actions/checkout@v4
16+
- run: npm install
17+
- run: npm run gen --workspace=udl
18+
- run: npm run build-wasm --workspace=udl
19+
- run: systemctl --user stop ts-playground.service
20+
- run: mkdir -p /home/act_runner/ts-playground
21+
- run: mkdir -p /home/act_runner/ts-playground/src
22+
- run: cp udl/tree-sitter-objectscript_udl.wasm /home/act_runner/ts-playground
23+
- run: cp udl/src/grammar.json /home/act_runner/ts-playground/src
24+
- run: systemctl --user start ts-playground.service

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
*.dylib.*
30+
*.dll
31+
*.pc
32+
33+
# Example dirs
34+
/examples/*/
35+
36+
# Grammar volatiles
37+
*.wasm
38+
*.obj
39+
*.o

.prettierrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
singleQuote: true,
3+
};

Cargo.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[package]
2+
name = "tree-sitter-objectscript"
3+
description = "ObjectScript grammar for tree-sitter"
4+
version = "1.0.0"
5+
keywords = ["incremental", "parsing", "ObjectScript"]
6+
categories = ["parsing", "text-editors"]
7+
repository = "https://github.com/intersystems/tree-sitter-objectscript"
8+
edition = "2018"
9+
license = "MIT"
10+
11+
build = "bindings/rust/build.rs"
12+
include = [
13+
"bindings/rust/*",
14+
"grammar.js",
15+
"queries/*",
16+
"src/*",
17+
]
18+
19+
[lib]
20+
path = "bindings/rust/lib.rs"
21+
22+
[dependencies]
23+
tree-sitter = "~0.20.3"
24+
25+
[build-dependencies]
26+
cc = "1.0"

0 commit comments

Comments
 (0)