Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Nim (with tests) #633

Open
wants to merge 151 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
ecf6006
initial commit
alaviss Aug 25, 2022
79fa05c
scanner: use less C++11 stuff
alaviss Aug 25, 2022
8a9f74a
add grammar for tuple and tuple deconstruction def
alaviss Aug 25, 2022
60a43cd
add grammar for type sections and type specifications
alaviss Aug 26, 2022
d5872db
use character classes for selective case-insensitivity
alaviss Aug 26, 2022
6d52ab6
switch to indentation relations
alaviss Aug 26, 2022
b2b46ec
remove dynamic precedence on object_type
alaviss Aug 26, 2022
83677ae
turn numeric literals into a single token
alaviss Aug 26, 2022
e3fa443
add basic string literals
alaviss Aug 26, 2022
2b1011b
add long string grammar and tokenize raw strings
alaviss Aug 27, 2022
9dd5a92
supports escaped quotes within raw string
alaviss Aug 27, 2022
42fea5c
long string literals may have the `r` prefix
alaviss Aug 27, 2022
bdd6d3e
add grammar for single-line comments
alaviss Aug 27, 2022
d8ef67d
add missing tests for comments
alaviss Aug 27, 2022
5d869f9
basic support for simple calls
alaviss Aug 27, 2022
1311196
completely define the source layout
alaviss Aug 27, 2022
9a1e38c
add a cummulative status check for required checks
alaviss Aug 27, 2022
20c0878
flatten expression tree and add command call syntax
alaviss Aug 28, 2022
5976424
replace command_call with left associativity (#2)
alaviss Aug 28, 2022
3876cb6
get rid of command_call rule (#3)
alaviss Aug 28, 2022
6026bc5
Add grammars for block-style statements
alaviss Aug 29, 2022
f102c56
correct tuple grammar on singular tuples
alaviss Aug 29, 2022
05fe522
allow for calls with empty arguments list
alaviss Aug 29, 2022
9042bef
add grammar for statements (#7)
alaviss Aug 30, 2022
cf03d90
tokenize interpreted string text
alaviss Aug 30, 2022
ff372c8
simplify lexer and offload more into grammar
alaviss Sep 2, 2022
f9e1155
add block comment grammar
alaviss Sep 2, 2022
5192f32
full rewrite of the grammar
alaviss May 7, 2023
5a41b96
put infix operators as inline within the grammar
alaviss May 7, 2023
485dbe9
Merge pull request #12 from alaviss/infix_inline
alaviss May 7, 2023
91815de
cut down on externals and expose escape sequences
alaviss May 8, 2023
7bd9772
omit terminator for elif/else/except/finally
alaviss May 8, 2023
7d85194
Merge pull request #13 from alaviss/less-externals
alaviss May 8, 2023
522fde1
fix inline conditional declaration
alaviss May 8, 2023
52758b1
Merge pull request #14 from alaviss/cond-decl
alaviss May 8, 2023
b5d6558
rework calls to no longer require conflicts
alaviss May 9, 2023
fcc7f49
Merge pull request #15 from alaviss/call-rework
alaviss May 9, 2023
2617d84
enable inline block termination for other structures
alaviss May 9, 2023
22817f3
Merge pull request #16 from alaviss/inline-block
alaviss May 10, 2023
783fec6
allow more complex calls as expression
alaviss May 9, 2023
e934953
relax layout_empty constraints
alaviss May 9, 2023
112134d
enable full expression support in enums
alaviss May 9, 2023
edea003
resolve var_section and var_type via GLR
alaviss May 9, 2023
a3f9568
support cast with colon_expression
alaviss May 9, 2023
1959c4d
scanner: don't initialize within block comment
alaviss May 10, 2023
234f8be
generate parser on macOS CI
alaviss May 10, 2023
27a16de
Merge pull request #17 from alaviss/for-0.0.2
alaviss May 10, 2023
efb019a
update version number to 0.0.2
alaviss May 10, 2023
25fc629
update readme with current status of 0.0.2
alaviss May 10, 2023
074df32
Merge pull request #20 from alaviss/release-0.0.2
alaviss May 10, 2023
db1a0fe
scanner: unconditional layout termination at pair ends
alaviss May 23, 2023
8882cdb
Merge pull request #21 from alaviss/paired-termination
alaviss May 23, 2023
67b36a7
grammar: add defer block
alaviss May 23, 2023
28f8434
grammar: do block pragmas and pragma precedence fixes
alaviss May 23, 2023
dd09bda
Merge pull request #22 from alaviss/extra-structures
alaviss May 23, 2023
3dda1ff
grammar: redefine proc expression as extension of type
alaviss May 24, 2023
b984d69
grammar: remove modified_type
alaviss May 24, 2023
5163ff4
grammar: inline symbol_declaration_list to tuple
alaviss May 24, 2023
3bc6c1b
grammar: split blank_identifier from identifier
alaviss May 24, 2023
0a76ccf
bring back the parser
alaviss May 24, 2023
925e8ae
bump dependencies and version to 0.0.3
alaviss May 24, 2023
92a21dd
grammar: unify operators as (operator)
alaviss May 28, 2023
bdd375d
queries: add highlighting query
alaviss May 28, 2023
ecbd15e
Merge pull request #23 from alaviss/for-0.0.3
alaviss May 28, 2023
a79aaaf
Bump fsfe/reuse-action from 1 to 2
dependabot[bot] Jul 20, 2023
5b8e725
Merge pull request #26 from alaviss/dependabot/github_actions/fsfe/re…
alaviss Aug 26, 2023
8a8080f
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 4, 2023
92700bb
Merge pull request #27 from alaviss/dependabot/github_actions/actions…
alaviss Sep 10, 2023
96fffbb
made type_expression not anonymous, to make querying for types managable
aMOPel Sep 12, 2023
54cd9cb
Merge pull request #29 from aMOPel/main
alaviss Sep 12, 2023
662a3e9
ci: install using npm clean-install
alaviss Sep 12, 2023
fc43010
added using_section to grammar.js and wrote tests
aMOPel Sep 12, 2023
dff6c60
Merge pull request #31 from aMOPel/pr_using_section
alaviss Sep 12, 2023
928b00e
change long string opening from regex to literal choice
alaviss Sep 13, 2023
9f59660
Merge pull request #34 from alaviss/split-long-string-opening
alaviss Sep 13, 2023
c3486fb
split * and : into two tokens
alaviss Sep 17, 2023
388b53f
Merge pull request #36 from alaviss/fix-starcolon
alaviss Sep 17, 2023
35c0245
bump version to 0.1.0
alaviss Sep 22, 2023
70afe28
allow symbol_declaration_list to harbor a trailing comma
alaviss Sep 22, 2023
7c3d917
Merge pull request #39 from alaviss/fixes/trailing-comma
alaviss Sep 22, 2023
5676fb9
make conditional objects tolerant with incomplete code
alaviss Sep 23, 2023
a8bd63a
scanner: do not emit layout_empty during error recovery
alaviss Sep 23, 2023
ae00f33
Merge pull request #40 from alaviss/better-errors
alaviss Sep 23, 2023
4e357b8
bump version to 0.1.1
alaviss Sep 23, 2023
e0c246a
change short raw string opening from regex to literal choice (#46)
aMOPel Oct 4, 2023
4231a98
allow trailing semicolon in parenthesized
alaviss Oct 5, 2023
1f6b6eb
Merge pull request #48 from alaviss/trailing-paren
alaviss Oct 5, 2023
01a0337
scanner: rewrite in C
alaviss Oct 19, 2023
1e08b05
Merge pull request #50 from alaviss/rwic
alaviss Oct 19, 2023
a43d806
bump version to 0.2.0
alaviss Oct 19, 2023
2aae38c
ci: demote parser mismatch into warnings
alaviss Oct 21, 2023
afe2b4f
Merge pull request #51 from alaviss/ci-warn
alaviss Oct 21, 2023
ec838d1
scanner: cleanup attribute macros
alaviss Oct 21, 2023
3e4a9cb
scanner: general code tuneup
alaviss Oct 21, 2023
6283a0b
scanner: modify TRY_LEX to use an unique variable
alaviss Oct 21, 2023
21cd6a7
Merge pull request #52 from alaviss/scanner-cleanup
alaviss Oct 21, 2023
53c12ea
major behavior changes to layouting
alaviss Oct 21, 2023
9cda851
Merge pull request #53 from alaviss/layout-updates
alaviss Oct 21, 2023
f95c955
grammar: implements string_content
alaviss Oct 21, 2023
4bb3654
grammar: implements comment_content
alaviss Oct 21, 2023
9827287
grammar: specialize string literal types
alaviss Oct 21, 2023
a596990
Merge pull request #54 from alaviss/better-captures
alaviss Oct 21, 2023
5284d8a
update deps and bump version to 0.3.0
alaviss Oct 21, 2023
189b26c
Merge pull request #55 from alaviss/for-0.3.0
alaviss Oct 21, 2023
e456719
make (), [], {} and {.} inhibit layout end
alaviss Oct 21, 2023
3abf350
Merge pull request #56 from alaviss/layout-punctuation
alaviss Oct 22, 2023
7c57005
mark generated files to prevent diffs
alaviss Oct 21, 2023
0c06dd6
Merge pull request #57 from alaviss/generated-attrs
alaviss Oct 22, 2023
63265ff
add a test for hanging dot expression
alaviss Oct 21, 2023
1c74480
Merge pull request #58 from alaviss/test-hanging-dot
alaviss Oct 22, 2023
4626a4d
implement termination rule for if/try
alaviss Oct 21, 2023
6e7f09a
Merge pull request #59 from alaviss/if-try-term
alaviss Oct 22, 2023
084f2f7
re-implement unicode support
alaviss Oct 21, 2023
c4706b9
allow empty tuple field list
alaviss Oct 21, 2023
113e39c
allow empty generic parameter list
alaviss Oct 21, 2023
c9dd5ef
full term rewriting pattern support
alaviss Oct 21, 2023
bbbbf39
Merge pull request #60 from alaviss/improve-grammar
alaviss Oct 22, 2023
79e9cab
make except and finally branches optional
alaviss Oct 22, 2023
7550f55
Merge pull request #62 from alaviss/try-optional-body
alaviss Oct 22, 2023
ef0e927
Bump actions/setup-node from 3 to 4
dependabot[bot] Oct 23, 2023
1f9308c
Merge pull request #63 from alaviss/dependabot/github_actions/actions…
alaviss Nov 1, 2023
6facf32
package.json: update node-gyp and other deps
alaviss Dec 11, 2023
3522946
Merge pull request #70 from alaviss/gyp
alaviss Dec 11, 2023
9810a8e
make sure field name hone in on the interested node
alaviss Dec 10, 2023
ca83811
annotate more structure locations using fields
alaviss Dec 10, 2023
fe53e07
Merge pull request #69 from alaviss/field-names
alaviss Dec 11, 2023
22108ff
scanner: allow end on EOF and use column for flag invalidation
alaviss Dec 11, 2023
cf49750
Merge pull request #71 from alaviss/scanner-eof
alaviss Dec 11, 2023
05bffa0
make type declaration RHS optional
alaviss Dec 11, 2023
740d062
Merge pull request #72 from alaviss/type-opt
alaviss Dec 11, 2023
6a11bc7
bump version to 0.4.0
alaviss Dec 11, 2023
77762e3
Merge pull request #73 from alaviss/bump-0.4.0
alaviss Dec 11, 2023
6d7c079
scanner: add workaround for column at EOF
alaviss Dec 12, 2023
d41fd3e
Merge pull request #74 from alaviss/column-eof
alaviss Dec 12, 2023
37d5f37
add missing consequence field to object declaration
alaviss Dec 14, 2023
0fdb059
Merge pull request #76 from alaviss/field-obj
alaviss Dec 14, 2023
d31594d
add missing alternative field to object variants
alaviss Dec 15, 2023
482e2f4
Merge pull request #79 from alaviss/variant-alt
alaviss Dec 15, 2023
b0f73e4
remove flag and indentation tracking across scans
alaviss Dec 27, 2023
2e0eb2a
allow concept body to be omitted
alaviss Dec 28, 2023
e36916b
grammar: share if alternatives between if and case
alaviss Dec 29, 2023
4e0c321
eslint: disable useless-escape rule
alaviss Dec 29, 2023
b397db6
grammar: factor out for loop body
alaviss Dec 29, 2023
2a58cfa
support old type(x) expression in statement lists
alaviss Dec 30, 2023
38d17e7
update readme for the current project status
alaviss Dec 30, 2023
1e8b9cb
ci: bump upload/download artifact version
alaviss Dec 30, 2023
901306b
bump version to 0.5.0
alaviss Dec 30, 2023
70ceee8
Merge pull request #80 from alaviss/for-0.5.0
alaviss Dec 30, 2023
386cc7d
Add 'vendored_parsers/tree-sitter-nim/' from commit '70ceee835e033acb…
gcr Jan 31, 2024
5748274
Add support for nim, including regression tests.
gcr Jan 31, 2024
f546f5b
Whitespace
gcr Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-newick-src",
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-nim",
src_dir: "vendored_parsers/tree-sitter-nim-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-nix",
src_dir: "vendored_parsers/tree-sitter-nix-src",
Expand Down
3 changes: 3 additions & 0 deletions sample_files/compare.expected
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ a1d520d7a425c9eed529b8b108eaee3e -
sample_files/newick_before.nwk sample_files/newick_after.nwk
0f7bdff87a79f997b850e67d38a1c910 -

sample_files/nim_before.nim sample_files/nim_after.nim
785647f7b0f04721cc87ded35a1088f9 -

sample_files/nix_before.nix sample_files/nix_after.nix
e00b95a4cf3fa3edf994155d8656063f -

Expand Down
5 changes: 5 additions & 0 deletions sample_files/nim_after.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
proc hello(a: string, b: int): string =
for i in 0..3:
echo "hello ", a, b

hello "world", 69
5 changes: 5 additions & 0 deletions sample_files/nim_before.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
proc hello(a: string): string =
echo "hello ", a

when isMainModule:
hello("world")
3 changes: 3 additions & 0 deletions src/parse/guess_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub(crate) enum Language {
Lua,
Make,
Newick,
Nim,
Nix,
ObjC,
OCaml,
Expand Down Expand Up @@ -141,6 +142,7 @@ pub(crate) fn language_name(language: Language) -> &'static str {
Lua => "Lua",
Make => "Make",
Newick => "Newick",
Nim => "Nim",
Nix => "Nix",
ObjC => "Objective-C",
OCaml => "OCaml",
Expand Down Expand Up @@ -320,6 +322,7 @@ pub(crate) fn language_globs(language: Language) -> Vec<glob::Pattern> {
"mkfile",
],
Newick => &["*.nhx", "*.nwk", "*.nh"],
Nim => &["*.nim", "*.nims", "*.nimble"],
Nix => &["*.nix"],
ObjC => &["*.m"],
OCaml => &["*.ml"],
Expand Down
23 changes: 23 additions & 0 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ extern "C" {
fn tree_sitter_lua() -> ts::Language;
fn tree_sitter_make() -> ts::Language;
fn tree_sitter_newick() -> ts::Language;
fn tree_sitter_nim() -> ts::Language;
fn tree_sitter_nix() -> ts::Language;
fn tree_sitter_objc() -> ts::Language;
fn tree_sitter_ocaml() -> ts::Language;
Expand Down Expand Up @@ -725,6 +726,28 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
sub_languages: vec![],
}
}
Nim => {
let language = unsafe { tree_sitter_nim() };
TreeSitterConfig {
language,
atom_nodes: vec![
"string_expression",
"indented_string_expression",
"long_string_expression",
]
.into_iter()
.collect(),
delimiter_tokens: vec![("{", "}"), ("[", "]"), ("(", ")")]
.into_iter()
.collect(),
highlight_query: ts::Query::new(
language,
include_str!("../../vendored_parsers/highlights/nim.scm"),
)
.unwrap(),
sub_languages: vec![],
}
}
Nix => {
let language = unsafe { tree_sitter_nix() };
TreeSitterConfig {
Expand Down
1 change: 1 addition & 0 deletions vendored_parsers/highlights/nim.scm
1 change: 1 addition & 0 deletions vendored_parsers/tree-sitter-nim-src
33 changes: 33 additions & 0 deletions vendored_parsers/tree-sitter-nim/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: None
#
# SPDX-License-Identifier: CC0-1.0

---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignTrailingComments: true
BreakBeforeBraces: Stroustrup
BreakInheritanceList: AfterColon
BreakConstructorInitializers: AfterColon
DeriveLineEnding: false
DerivePointerAlignment: false
IndentAccessModifiers: false
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: AfterHash
IndentExternBlock: NoIndent
InsertBraces: true
PointerAlignment: Left
SeparateDefinitionBlocks: Always
SpaceAfterTemplateKeyword: false
SpacesInContainerLiterals: false
UseCRLF: false
BreakAfterAttributes: Always
AttributeMacros:
- "_nonnull_"
- "_returns_nonnull_"
- "_const_"
- "_pure_"
# vim: set ft=yaml et:
49 changes: 49 additions & 0 deletions vendored_parsers/tree-sitter-nim/.clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: None
#
# SPDX-License-Identifier: CC0-1.0

---
CompileFlags:
Add:
- -Wall
- -Wextra
- -Wpedantic
- -Wimplicit-fallthrough
- -Wwrite-strings
- -Wshadow
- -Wundef
- -Wformat=2
- -Wnull-dereference
- -Wno-gnu-zero-variadic-macro-arguments
- -fno-exceptions
- -xc
- -DTREE_SITTER_INTERNAL_BUILD

Diagnostics:
ClangTidy:
Add:
- android-cloexec-*
- bugprone-*
- cert-*
- cppcoreguidelines-*
- fuchsia-trailing-return
- google-global-names-in-headers
- hicpp-*
- misc-*
- modernize-*
- performance-*
- readability-*
Remove: modernize-use-trailing-return-type
CheckOptions:
cppcoreguidelines-avoid-do-while.IgnoreMacros: true
readability-function-cognitive-complexity.IgnoreMacros: true
readability-implicit-bool-conversion.AllowPointerConditions: true
readability-identifier-naming.ConstantCase: UPPER_CASE
readability-identifier-naming.LocalConstantCase: lower_case
readability-identifier-naming.EnumConstantCase: UPPER_CASE
readability-identifier-naming.FunctionCase: lower_case
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
readability-identifier-naming.VariableCase: lower_case
UnusedIncludes: Strict

# vim: set ft=yaml et:
13 changes: 13 additions & 0 deletions vendored_parsers/tree-sitter-nim/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: None
#
# SPDX-License-Identifier: CC0-1.0

root = true

[*]
end_of_line = lf
insert_final_newline = true

[src/scanner.cc]
# So that MSVC knows it's UTF-8
charset = utf-8-bom
16 changes: 16 additions & 0 deletions vendored_parsers/tree-sitter-nim/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-undef": "off",
"no-useless-escape": "off"
}
}
3 changes: 3 additions & 0 deletions vendored_parsers/tree-sitter-nim/.eslintrc.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: None

SPDX-License-Identifier: CC0-1.0
7 changes: 7 additions & 0 deletions vendored_parsers/tree-sitter-nim/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: None
#
# SPDX-License-Identifier: CC0-1.0

src/parser.c -diff linguist-generated=true
Cargo.lock linguist-generated=true
package-lock.json linguist-generated=true
5 changes: 5 additions & 0 deletions vendored_parsers/tree-sitter-nim/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2023 leorize <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0

github: alaviss
11 changes: 11 additions & 0 deletions vendored_parsers/tree-sitter-nim/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2022 leorize <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0

version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
109 changes: 109 additions & 0 deletions vendored_parsers/tree-sitter-nim/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Copyright 2022 Leorize <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0

name: CI

on: [push, pull_request]

jobs:
generate:
name: Generate parser
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "npm"
node-version: "16"

- run: npm ci
- run: npm run build

- name: Upload built parser to artifacts
uses: actions/upload-artifact@v4
with:
name: parser
path: src/parser.c

compare-parser:
needs: [generate]
name: Check if generated parser is the same as the PR's
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download generated parser
uses: actions/download-artifact@v4
with:
name: parser
path: src/
- name: Check for differences with git
run: |
if ! git diff --exit-code src/parser.c; then
echo "::warning file=grammar.js,line=1,title=The generated parser is different from the commit's::Currently this is just a reminder for the repo owner to double check the PR"
fi

tests:
needs: [generate]
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Run test suite on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16"
cache: "npm"
- name: Download generated parser
uses: actions/download-artifact@v4
with:
name: parser
path: src/
- run: npm ci
- name: Run test suite
run: npm test
shell: bash
- name: Test parsing sample Nim files
run: npm exec -- tree-sitter parse -s -t -q 'samples/**/*.nim'
shell: bash

rust:
needs: [generate]
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Run rust test build on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Download generated parser
uses: actions/download-artifact@v4
with:
name: parser
path: src/
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run test build
uses: actions-rs/cargo@v1
with:
command: build

success:
needs:
- compare-parser
- generate
- tests
- rust
if: always()
runs-on: ubuntu-latest
name: "All checks passed"
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
name: "Previous jobs failed"
run: |
echo "::error::One of the previous jobs failed"
exit 1
16 changes: 16 additions & 0 deletions vendored_parsers/tree-sitter-nim/.github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC0-1.0

name: REUSE Compliance Check

on: [push, pull_request]

jobs:
test:
name: REUSE Compilance Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2
13 changes: 13 additions & 0 deletions vendored_parsers/tree-sitter-nim/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: None

# Node artifacts
node_modules/
build/

# Rust stuff
debug/
target/

# C stuff
.cache/
9 changes: 9 additions & 0 deletions vendored_parsers/tree-sitter-nim/.neoconf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"lspconfig": {
"tsserver": {
"typescript.format.enable": false,
"diagnostics.ignoredCodes": [80001],
"completions.completeFunctionCalls": true
}
}
}
Loading
Loading