Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
414 commits
Select commit Hold shift + click to select a range
86e8d44
wip: added _rhs_expression allowing expr function_definition with opt…
PrestonKnopp Feb 7, 2023
6f615af
added external rules to parse inline body's (ie blocks)
PrestonKnopp Feb 8, 2023
2de19e7
tree-sitter generate
PrestonKnopp Feb 8, 2023
1e96cd4
point to why $.annotations is used in $._simple_statement
PrestonKnopp Feb 8, 2023
b1f0b90
tree-sitter generate
PrestonKnopp Feb 8, 2023
ebf71f9
rm unused `keyword_identifier` rule
PrestonKnopp Feb 8, 2023
749db9e
fix mixed quotes parsing for get_node and node_path
PrestonKnopp Feb 8, 2023
c820595
add parameters and argument_list can have trailing comma
PrestonKnopp Feb 8, 2023
395baa0
replace signal_argument_list with parameters
PrestonKnopp Feb 8, 2023
9fd1e94
rename *_argument_list to *_arguments
PrestonKnopp Feb 8, 2023
025d8e2
replace export_arguments with arguments
PrestonKnopp Feb 8, 2023
be07f90
format
PrestonKnopp Feb 8, 2023
20bd8e0
tree-sitter generate
PrestonKnopp Feb 8, 2023
3947a98
minor version bump
PrestonKnopp Feb 8, 2023
fbfaa61
update test workflow to only run when grammar.js or corpus has changed
PrestonKnopp Feb 8, 2023
2c91ebe
add registry-url to node-setup so npm can actually publish
PrestonKnopp Feb 8, 2023
fbbe22c
minor version bump
PrestonKnopp Feb 8, 2023
5728960
allow setget to have only one of {set,get}_body
PrestonKnopp Feb 10, 2023
02a8990
tree-sitter generate
PrestonKnopp Feb 10, 2023
0edc485
fix #12 exported variables fail to parse if they have onready
PrestonKnopp Feb 10, 2023
e6ebc33
tree-sitter generate
PrestonKnopp Feb 10, 2023
31b2be6
fix #7 get_node str path with '.'; use @Arrow-x solution from #8
PrestonKnopp Feb 10, 2023
a56a6fc
tree-sitter generate
PrestonKnopp Feb 10, 2023
6d3ec91
Revert "wip: added _rhs_expression allowing expr function_definition …
PrestonKnopp Feb 14, 2023
f766dff
add basic_blocks.gd example
PrestonKnopp Feb 14, 2023
3c9e26a
add failed to parse basic blocks test to corpus/issues
PrestonKnopp Feb 14, 2023
0779837
tree-sitter generate
PrestonKnopp Feb 14, 2023
31ebb7c
regen package-lock.json
PrestonKnopp Feb 14, 2023
d13931f
anonymize $.annotations as $._annotations
PrestonKnopp Feb 17, 2023
5e2741b
Revert "added external rules to parse inline body's (ie blocks)"
PrestonKnopp Feb 17, 2023
9238c72
add supertypes
PrestonKnopp Feb 17, 2023
550da0b
add fields to most rules
PrestonKnopp Feb 18, 2023
41f2189
replace $.class_name_icon_path with $.string
PrestonKnopp Feb 18, 2023
9a9de1f
remove $.return_type
PrestonKnopp Feb 18, 2023
71dfa62
rewrite $._parameters to not not have the trailCommaSep1()
PrestonKnopp Feb 18, 2023
780e9eb
add $._parameters to supertypes
PrestonKnopp Feb 18, 2023
cb04ea6
fixed $.pattern_pair lhs only allowing strings
PrestonKnopp Feb 18, 2023
aac1e5b
change field names for pair rules to key and value
PrestonKnopp Feb 18, 2023
29b6b3e
commit test changes
PrestonKnopp Feb 18, 2023
bc9eeb1
tree-sitter generate
PrestonKnopp Feb 18, 2023
92dc4d4
wip: added _rhs_expression allowing expr function_definition with opt…
PrestonKnopp Feb 18, 2023
1bf83db
update scanner.cc from tree-sitter-python
PrestonKnopp Feb 18, 2023
49b138c
wip: lambdas with a _lambda_body_end external token
PrestonKnopp Feb 20, 2023
dcd1eb0
add lambdas rule and impl external body_end rule
PrestonKnopp Feb 23, 2023
473dcad
add test for issue: var is declared after a lambda
PrestonKnopp Feb 23, 2023
59c1296
fixed return_statement return lambdas (_rhs_expression)
PrestonKnopp Feb 23, 2023
f9ca629
tree-sitter generate
PrestonKnopp Feb 23, 2023
a254369
guard against BODY_END tokens overriding valid tokens
PrestonKnopp Feb 24, 2023
63342fb
add info on breakage when looking for ':' at BODY_END
PrestonKnopp Feb 24, 2023
8acf2a3
mv match_statement from _simple_statement to _compound_statement
PrestonKnopp Feb 28, 2023
2c62c5f
add await_expression
PrestonKnopp Feb 28, 2023
b01dad4
tree-sitter generate
PrestonKnopp Feb 28, 2023
288280a
add gd2 ^"node/path" syntax to $.node_path
PrestonKnopp Feb 28, 2023
6401ca2
add $.string_name rule
PrestonKnopp Feb 28, 2023
da874f2
tree-sitter generate
PrestonKnopp Feb 28, 2023
a4b57cc
minor version bump
PrestonKnopp Feb 28, 2023
297a7ad
feat: rewrite the scanner in C
amaanq Jun 19, 2023
4467e11
chore: update manifests
amaanq Jun 19, 2023
3fd70bf
Merge pull request #15 from amaanq/rewrite-it-in-c
PrestonKnopp Jun 20, 2023
dedf757
patch version bump
PrestonKnopp Jun 20, 2023
198eaff
chore: fix clang-tidy warnings
amaanq Jun 20, 2023
03f20b9
Merge pull request #16 from amaanq/clang-tidy
PrestonKnopp Jun 20, 2023
6862432
fix(#17): use `_Static_assert` instead of `static_assert`
PrestonKnopp Feb 19, 2024
645d761
patch version bump
PrestonKnopp Feb 19, 2024
d97deef
chore: rm todos from readme, i've never updated them.
PrestonKnopp Feb 19, 2024
ce0bba8
add some how to's to readme
PrestonKnopp Feb 19, 2024
898f8d4
add latest godot commit "synced" to readme
PrestonKnopp Feb 20, 2024
4dcc4b4
add test for godot issue 73273; lambda assignment after if
PrestonKnopp Feb 20, 2024
6adbacd
add static var; _variable_statement
PrestonKnopp Feb 21, 2024
81eb548
add static typed for loop; for_statement
PrestonKnopp Feb 21, 2024
107165a
allow setget getter to have empty parens; get_body
PrestonKnopp Feb 21, 2024
4075d4f
add new pattern_guard rule to pattern_section; pattern_guard, pattern…
PrestonKnopp Feb 21, 2024
2aaa690
add "is not" operator; binary_operator
PrestonKnopp Feb 21, 2024
bbad67c
tree-sitter generate
PrestonKnopp Feb 21, 2024
73fd7c5
minor version bump
PrestonKnopp Feb 21, 2024
8ed33ef
wip(#18): modify type rule to support typed arrays
PrestonKnopp Feb 22, 2024
5aeba16
wip(#18): replace instances of (type) in corpus
PrestonKnopp Feb 22, 2024
797c9e2
wip(#18): replace dotted_type with $.type; extends_statement now acce…
PrestonKnopp Feb 22, 2024
d03ee8c
wip(#18): replace instances of dotted_type with type or string in corpus
PrestonKnopp Feb 22, 2024
2a37287
fix(#18): tree-sitter generate
PrestonKnopp Feb 22, 2024
b5dea4d
2.0.0
PrestonKnopp Feb 22, 2024
82d664b
SPM support (#19)
mattmassicotte Mar 31, 2024
1f1e782
Update README.md
PrestonKnopp Mar 31, 2024
1d94599
chore: update deps
PrestonKnopp Apr 2, 2024
2d2cbdf
chore: npm run format
PrestonKnopp Apr 2, 2024
edb25be
tree-sitter generate
PrestonKnopp Apr 2, 2024
8947b5c
fix(#3): quick temporary fix for type args to generic constructors
PrestonKnopp Apr 2, 2024
639b7bd
tree-sitter generate
PrestonKnopp Apr 2, 2024
2ffb90d
rm package-lock.json from .gitignore
PrestonKnopp Apr 2, 2024
95e5313
Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows …
dependabot[bot] Nov 17, 2024
8eba3d7
binary_operator "as" now accepts "$._primary_expression" on rhs
PrestonKnopp Nov 17, 2024
d13890a
fix(#21): merge "$.comparison_operator" into "$.binary_operator" and …
PrestonKnopp Nov 17, 2024
d5c3091
tree-sitter generate
PrestonKnopp Nov 17, 2024
bf39f1b
3.0.0
PrestonKnopp Nov 17, 2024
fac036d
fix(#4, #5): Fix dictionary parsing
nikitalita Dec 6, 2024
b601349
tree-sitter generate
nikitalita Dec 6, 2024
8572dec
remove `objPair`, make arguments use `pair` instead
nikitalita Dec 7, 2024
5d3209f
tree-sitter generate
nikitalita Dec 7, 2024
74105cc
Merge pull request #6 from nikitalita/fix-dicts
PrestonKnopp Dec 8, 2024
f2c2004
add .git{ignore,attributes}
PrestonKnopp Jan 1, 2025
fc6e84b
applied tree-sitter init --update
PrestonKnopp Jan 1, 2025
2fed8a1
add package-lock.json
PrestonKnopp Jan 1, 2025
2896782
chore: tree-sitter generate
PrestonKnopp Jan 1, 2025
22dca00
update github workflows
PrestonKnopp Jan 1, 2025
73035fc
major version bump
PrestonKnopp Jan 1, 2025
2ac8058
rm macos-14 for arm in build_publish workflow
PrestonKnopp Jan 1, 2025
75ce61d
patch version bump
PrestonKnopp Jan 1, 2025
572d5bd
build_publish upload artifact action requires unique names
PrestonKnopp Jan 1, 2025
9326963
patch version bump
PrestonKnopp Jan 1, 2025
8207adc
disable windows in build_publish workflow
PrestonKnopp Jan 1, 2025
48b4933
patch version update
PrestonKnopp Jan 1, 2025
bf876a8
tree-sitter init --update
PrestonKnopp Jan 2, 2025
04b7273
update github workflows
PrestonKnopp Jan 2, 2025
479bfc1
minor version bump
PrestonKnopp Jan 2, 2025
09df97b
property paths can contain the : character, e.g. for tilesets
ianmcorvidae Jan 2, 2025
941955d
Merge pull request #8 from ianmcorvidae/resource-path-colons
PrestonKnopp Jan 3, 2025
91c55fd
minor version bump v0.6.1
PrestonKnopp Jan 28, 2025
33d37a5
fix(#28): Variable statements with setassigns but no getassigns
to-json Apr 29, 2025
b56686a
mv corpus to test dir
PrestonKnopp May 1, 2025
907beca
fix(#27): add ** and **= operators
PrestonKnopp May 1, 2025
6b08e2d
extract match_statement tests to own file
PrestonKnopp Apr 30, 2025
0cad478
wip(#26): rm $.underscore. use $.identifier
PrestonKnopp May 1, 2025
0f3fb65
fix(#26): $.match_statement's $.pattern_section parses expressions
PrestonKnopp May 1, 2025
25dadb2
chore: format grammar.js
PrestonKnopp May 1, 2025
24a95b7
mv corpus to test dir
PrestonKnopp May 2, 2025
99417ca
fix(#9, #3): parse generic type arguments
PrestonKnopp May 3, 2025
8faa839
explicitly cast signed int to unsigned
PrestonKnopp May 14, 2025
da9a9ec
avoid deref scanner if failed to allocate
PrestonKnopp May 14, 2025
fc56b99
update deps
PrestonKnopp May 14, 2025
81c2677
update github workflows
PrestonKnopp May 14, 2025
9ccedb9
remove binding.gyp from format script
PrestonKnopp May 14, 2025
fbdc5ef
add ts convenience npm script
PrestonKnopp May 14, 2025
7d64580
include dev, opt, peer deps in github test worflow
PrestonKnopp May 14, 2025
c9e1290
explicitly i tree-sitter in workflow
PrestonKnopp May 14, 2025
27c7456
you cant run tree-sitter --version before tree-sitter has been installed
PrestonKnopp May 14, 2025
e0b3a1e
separate npm install commands from version commands in workflow
PrestonKnopp May 14, 2025
7ac08f6
describe when to commit tree sitter generated files
PrestonKnopp May 14, 2025
ef0c61b
major version bump
PrestonKnopp May 14, 2025
1cabdd8
update prebuildify targets
PrestonKnopp May 14, 2025
afb9021
chore: npm pkg fix
PrestonKnopp May 14, 2025
29e4862
hopefully fix publish workflow
PrestonKnopp May 14, 2025
e964ce9
patch version bump
PrestonKnopp May 14, 2025
024d435
update deps
PrestonKnopp May 14, 2025
daa6c2d
update test workflow
PrestonKnopp May 14, 2025
8974457
add build_publish workflow
PrestonKnopp May 14, 2025
a1a7295
minor version bump
PrestonKnopp May 14, 2025
33b18b0
Handle parsing of StringNames
nikitalita May 26, 2025
90471da
Merge pull request #13 from nikitalita/fix-string-names
PrestonKnopp May 27, 2025
2ed3ef9
add nim bindings
PrestonKnopp May 28, 2025
9bbb540
add nim bindings
PrestonKnopp May 28, 2025
642aa8e
Add support for scanning region and endregion tokens
NathanLovato Jul 1, 2025
00db5e7
Fix tests not passing due to "missed dedent" token
NathanLovato Jul 1, 2025
e8c8ef1
Add tests for region and endregion markers
NathanLovato Jul 1, 2025
2cb5720
Regions: simplify scanner logic, try capturing and hiding the end reg…
NathanLovato Jul 5, 2025
4862bc2
Try another approach to ignore the end region label
NathanLovato Jul 5, 2025
de545c1
Update region tests to match token name changes
NathanLovato Jul 5, 2025
62451d2
Merge branch 'gdquest/add-region-support'
PrestonKnopp Jul 15, 2025
a1bfa39
chore: tree-sitter generate
PrestonKnopp Jul 15, 2025
e103ce2
chore: npm run format
PrestonKnopp Jul 15, 2025
cfe20d1
fix(#35): set get assign on one line
PrestonKnopp Jul 15, 2025
6551d92
add missing field("name", $.name)
PrestonKnopp May 29, 2025
fa22a4d
add the following fields:
PrestonKnopp Jun 28, 2025
cb02ea2
use "_return_type" rule
PrestonKnopp Jun 28, 2025
34c67ed
attribute_subscript should accept _expression not just _primary_expre…
PrestonKnopp Jun 28, 2025
2207e64
breaking: subscript and attribute_subscript accepts multiple argument…
PrestonKnopp Jun 28, 2025
4154d12
add field "arguments" to
PrestonKnopp Jun 28, 2025
f0def43
breaking: rename export_variable_statement field "export_arguments" -…
PrestonKnopp Jun 28, 2025
c06ff14
breaking: rename constructor_definition field "constructor_arguments"…
PrestonKnopp Jun 28, 2025
916e393
chore: tree-sitter generate
PrestonKnopp Jun 28, 2025
28b8439
chore: format
PrestonKnopp Jun 28, 2025
887bf66
parse annotations before keywords on function_definition
PrestonKnopp Jun 29, 2025
cf18b77
add "parameters" field to signal
PrestonKnopp Jun 29, 2025
13cad59
add "op" field to augmented_assignment
PrestonKnopp Jun 29, 2025
e944fa6
breaking: rename pair field "key" -> "left"
PrestonKnopp Jun 29, 2025
7c6cd8c
Fix: correct \U escape sequence length from 8 to 6 in grammar.js
asrrehel Jul 17, 2025
2b2e76d
chore: npm run format
PrestonKnopp Jul 17, 2025
c370d71
major version bump v6.0.0
PrestonKnopp Jul 17, 2025
8d30b8d
Refactor string grammar and enhance node_path/string_name parsing (#37)
asrrehel Jul 24, 2025
92815a0
Support Godot 4.5 @abstract annotation
TranquilMarmot Aug 8, 2025
da2a43b
Update prettier instead of adding .prettierrc
TranquilMarmot Aug 8, 2025
1e2591e
Ensure that inline comments at the end of a function body get parsed …
NathanLovato Sep 3, 2025
ad582ac
fix(#39): unanonymize body of [sg]et_body
PrestonKnopp Sep 9, 2025
54cf089
Serialize and deserialize the new has_inline_comment field
NathanLovato Sep 9, 2025
d28f24a
Merge pull request #41 from NathanLovato/gdquest/comments-function-en…
PrestonKnopp Sep 10, 2025
0d4ad9b
Add support for the not in variant of the in operator, make is not a …
NathanLovato Sep 15, 2025
f69bb34
Merge pull request #44 from NathanLovato/nathan/add-not-in-support
PrestonKnopp Sep 15, 2025
e8f2cb8
chore: npm run genTest
PrestonKnopp Sep 15, 2025
bcfe5e6
Change comment parsing to be handled by grammar.js, simplify scanner.c
NathanLovato Sep 16, 2025
30ba509
Add line continuation marks as anonymous nodes in the scene tree to b…
NathanLovato Sep 17, 2025
f18f8b2
Merge pull request #47 from NathanLovato/nathan/backslashes
PrestonKnopp Sep 17, 2025
db15116
add line continuations tests
PrestonKnopp Sep 17, 2025
daa5aee
chore: npm run genTest
PrestonKnopp Sep 17, 2025
e7393a9
chore: npm run format
PrestonKnopp Sep 17, 2025
f4e841b
Fix line continuation parsing, follow tree-sitter-python and make it …
NathanLovato Sep 17, 2025
9e5e2bf
Merge pull request #48 from NathanLovato/nathan/line-continuation-fix
PrestonKnopp Sep 18, 2025
9686853
chore: npm run genTest
PrestonKnopp Sep 18, 2025
f48327f
Fix Go binding to include external scanner
squarepear Sep 22, 2025
b5fff61
Add temporary new test document with all patterns to test for recent …
NathanLovato Sep 21, 2025
41e9519
Remove the "tool" statement from Godot 3, update tests
NathanLovato Sep 21, 2025
97598e9
Fix match statement parsing issues (no condition expression or annota…
NathanLovato Sep 21, 2025
21de3f9
Add support for typed inference in parameters
NathanLovato Sep 22, 2025
4d5b299
tests: Add new match statement tests to the match test corpus
NathanLovato Sep 22, 2025
892ba00
tests: Add a new file for function tests
NathanLovato Sep 22, 2025
27a5fe7
Update region tests to use the C# tree sitter parser approach of regi…
NathanLovato Sep 22, 2025
7b63228
Rewrite region parsing to generate region_start and region_end tokens
NathanLovato Sep 22, 2025
598d483
Merge pull request #59 from squarepear/fix-go-scanner-include
PrestonKnopp Sep 24, 2025
8ee1214
build(deps-dev): bump tar-fs from 2.1.2 to 2.1.4
dependabot[bot] Sep 24, 2025
08c7f57
Bump tar-fs from 2.1.2 to 2.1.4
dependabot[bot] Sep 24, 2025
24c04eb
rm abstract_function_declaration, function_definition now has optiona…
PrestonKnopp Sep 25, 2025
9aea1d6
Merge branch 'tranquil/abstract'
PrestonKnopp Sep 25, 2025
4fed019
Merge branch 'nathan/comment-parsing-simplification'
PrestonKnopp Sep 25, 2025
ff6d874
chore: npm run genTest
PrestonKnopp Sep 25, 2025
5731c94
Add newline after annotations to annotations in match patterns, add r…
NathanLovato Sep 26, 2025
9667d7d
Allow declarations on the same line as class definitions, add grammar…
NathanLovato Sep 21, 2025
ab89dc7
Make class grammar follow body grammar more closely, remove prec.righ…
NathanLovato Sep 26, 2025
d9e403b
Merge branch 'nathan/new-issues' into gdquest/inner_class_body
NathanLovato Sep 26, 2025
69ff342
Add missing pass statement in class member list, update failing tests
NathanLovato Sep 26, 2025
fa4a9bc
Merge pull request #58 from NathanLovato/gdquest/inner_class_body
PrestonKnopp Sep 26, 2025
96e5155
chore: npm run genTest
PrestonKnopp Sep 26, 2025
f73c99d
Merge pull request #60 from PrestonKnopp/dependabot/npm_and_yarn/tar-…
PrestonKnopp Sep 26, 2025
85dbae7
fix(#61): parse extends_statement in class_name_statement
PrestonKnopp Sep 27, 2025
e0b4f29
chore: npm run genTest
PrestonKnopp Sep 27, 2025
e2be098
fix #56: allow dictionaries to accept list of keys and pairs for patt…
PrestonKnopp Sep 27, 2025
bc3bfb6
chore: npm run genTest
PrestonKnopp Sep 27, 2025
302c189
Merge pull request #15 from PrestonKnopp/dependabot/npm_and_yarn/tar-…
PrestonKnopp Sep 27, 2025
6589d29
fix #57: support multiline strings without line continuations
PrestonKnopp Sep 27, 2025
8827918
fix regression for function_definition optional body causing return_t…
PrestonKnopp Sep 28, 2025
55d1b51
chore: npm run genTest
PrestonKnopp Sep 28, 2025
c6c60a0
Add support for not followed by await expression
NathanLovato Sep 28, 2025
2ada1c6
Merge pull request #64 from NathanLovato/gdquest/not-await
PrestonKnopp Sep 28, 2025
e6d2772
Fix trailing comments after final statement in a function
TranquilMarmot Sep 29, 2025
5ab50bb
Fix failing test
TranquilMarmot Sep 29, 2025
8a4e5ac
Spaces -> tabs in test
TranquilMarmot Sep 29, 2025
efde6a5
Extract skip_whitespace function
TranquilMarmot Sep 30, 2025
d78faf2
Move valid_symbols[DEDENT] check to the outer if condition
TranquilMarmot Sep 30, 2025
8270e02
Merge pull request #66 from TranquilMarmot/fix-trailin-comments
PrestonKnopp Oct 1, 2025
ff2c8c1
chore: npm run genTest
PrestonKnopp Oct 1, 2025
cd5d7b3
fix #67: allow multiple ';' separating _simple_statements
PrestonKnopp Oct 1, 2025
a8b2572
related #67: allow multiple ';' separating _simple_class_members
PrestonKnopp Oct 1, 2025
2af0dfb
chore: npm run genTest
PrestonKnopp Oct 1, 2025
ec2c830
cleanup class_body and body
PrestonKnopp Oct 1, 2025
d6c71f4
add variadic_parameter; closes #68
PrestonKnopp Oct 1, 2025
0b9f60e
chore: npm run genTest
PrestonKnopp Oct 1, 2025
de69afd
Fix de-dented comment breaking function parsing
TranquilMarmot Oct 4, 2025
afba325
Simplify handling of dedenting with comments
TranquilMarmot Oct 4, 2025
839cd92
Merge pull request #71 from TranquilMarmot/fix-comment-dedent
PrestonKnopp Oct 6, 2025
7b26247
Add 'vendored_parsers/tree-sitter-gdscript/' from commit '839cd921c8a…
sockeye-d Oct 13, 2025
6301ddf
Add tree-sitter-gdscript
sockeye-d Oct 13, 2025
9d2a419
Add 'vendored_parsers/tree-sitter-godot-resource/' from commit '302c1…
sockeye-d Oct 13, 2025
dbfe571
Add tree-sitter-godot-resource
sockeye-d Oct 13, 2025
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
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-elvish-src",
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-gdscript",
src_dir: "vendored_parsers/tree-sitter-gdscript-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-godot-resource",
src_dir: "vendored_parsers/tree-sitter-godot-resource-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-hack",
src_dir: "vendored_parsers/tree-sitter-hack-src",
Expand Down
6 changes: 6 additions & 0 deletions src/parse/guess_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ pub(crate) enum Language {
EmacsLisp,
Erlang,
FSharp,
GDScript,
Gleam,
Go,
GodotResource,
Hack,
Hare,
Haskell,
Expand Down Expand Up @@ -137,8 +139,10 @@ pub(crate) fn language_name(language: Language) -> &'static str {
EmacsLisp => "Emacs Lisp",
Erlang => "Erlang",
FSharp => "F#",
GDScript => "GDScript",
Gleam => "Gleam",
Go => "Go",
GodotResource => "Godot Resource",
Hack => "Hack",
Hare => "Hare",
Haskell => "Haskell",
Expand Down Expand Up @@ -280,8 +284,10 @@ pub(crate) fn language_globs(language: Language) -> Vec<glob::Pattern> {
"rebar.lock",
],
FSharp => &["*.fs", "*.fsx", "*.fsi"],
GDScript => &["*.gd"],
Gleam => &["*.gleam"],
Go => &["*.go"],
GodotResource => &["*.tscn", "*.tres", "project.godot"],
Hack => &["*.hack", "*.hck", "*.hhi"],
Hare => &["*.ha"],
Haskell => &["*.hs"],
Expand Down
24 changes: 24 additions & 0 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ extern "C" {
fn tree_sitter_commonlisp() -> ts::Language;
fn tree_sitter_elisp() -> ts::Language;
fn tree_sitter_elvish() -> ts::Language;
fn tree_sitter_gdscript() -> ts::Language;
fn tree_sitter_godot_resource() -> ts::Language;
fn tree_sitter_hare() -> ts::Language;
fn tree_sitter_hack() -> ts::Language;
fn tree_sitter_janet_simple() -> ts::Language;
Expand Down Expand Up @@ -389,6 +391,17 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
sub_languages: vec![],
}
}
GDScript => {
let language = unsafe { tree_sitter_gdscript() };

TreeSitterConfig {
language: language.clone(),
atom_nodes: vec![].into_iter().collect(),
delimiter_tokens: vec![("{", "}"), ("[", "]"), ("(", ")")],
highlight_query: ts::Query::new(&language, "").unwrap(),
sub_languages: vec![],
}
}
Gleam => {
let language_fn = tree_sitter_gleam::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);
Expand Down Expand Up @@ -418,6 +431,17 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
sub_languages: vec![],
}
}
GodotResource => {
let language = unsafe { tree_sitter_godot_resource() };

TreeSitterConfig {
language: language.clone(),
atom_nodes: vec![].into_iter().collect(),
delimiter_tokens: vec![("{", "}"), ("[", "]"), ("(", ")")],
highlight_query: ts::Query::new(&language, "").unwrap(),
sub_languages: vec![],
}
}
Hack => {
let language = unsafe { tree_sitter_hack() };
TreeSitterConfig {
Expand Down
1 change: 1 addition & 0 deletions vendored_parsers/tree-sitter-gdscript-src
46 changes: 46 additions & 0 deletions vendored_parsers/tree-sitter-gdscript/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
root = true

[*]
charset = utf-8

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

[*.js]
indent_style = space
indent_size = 2

[*.scm]
indent_style = space
indent_size = 2

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

[*.rs]
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

[parser.c]
indent_size = 2

[{alloc,array,parser}.h]
indent_size = 2
37 changes: 37 additions & 0 deletions vendored_parsers/tree-sitter-gdscript/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
* text=auto eol=lf

# Generated source files
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

# C bindings
bindings/c/* linguist-generated
CMakeLists.txt linguist-generated
Makefile linguist-generated

# Rust bindings
bindings/rust/* linguist-generated
Cargo.toml linguist-generated
Cargo.lock linguist-generated

# Node.js bindings
bindings/node/* linguist-generated
binding.gyp linguist-generated
package.json linguist-generated
package-lock.json linguist-generated

# Python bindings
bindings/python/** linguist-generated
setup.py linguist-generated
pyproject.toml linguist-generated

# Go bindings
bindings/go/* linguist-generated
go.mod linguist-generated
go.sum linguist-generated

# Swift bindings
bindings/swift/** linguist-generated
Package.swift linguist-generated
Package.resolved linguist-generated
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow will
# - test tree sitter grammar
# - upload build native binaries as an artifact for each major platform
# - download artifacts for each major platform and bundle them to be published
# to npm
# when a new version tag is pushed to the master branch.
name: Test Build Publish

on:
push:
tags: [v*]

jobs:

build_native_binaries:
strategy:
matrix:
# Use macos-14 for arm, however the artifact upload name conflicts with
# macos-latest. There's probably a way to crossbuild for arm with
# prebuildify.
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
# Why is npm only occassionally installing peer dependencies?
# I cannot get consistent peer dependency installs with the same command runs.
# Should I always explicitly run npm i tree-sitter? The general consensus is yes.
# But then, why does it install peer deps sometimes?
- run: |
node --version
npm --version
- run: npm ci --include=peer --include=optional --include=dev
- run: npm i tree-sitter
- run: npm run versions
- run: npm test
- run: npm run prebuild
# upload-artifact@v4 requires each artifact name to be unique.
- uses: actions/upload-artifact@v4
with:
name: prebuilds-${{ matrix.os }}
path: prebuilds
retention-days: 1


publish_npm:
needs: build_native_binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
# https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
# https://github.com/actions/setup-node/issues/342
# This is required to publish to npm.
registry-url: 'https://registry.npmjs.org'
- run: |
node --version
npm --version
- run: npm ci
# Download all artifacts and merge into prebuilds dir.
- uses: actions/download-artifact@v4
with:
path: prebuilds
pattern: prebuilds-*
merge-multiple: true
- run: ls -R prebuilds
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions vendored_parsers/tree-sitter-gdscript/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test

on:
push:
paths:
- 'grammar.js'
- 'corpus/**'
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: |
node --version
npm --version
- run: npm ci --include=dev --include=optional --include=peer
- run: npm test
41 changes: 41 additions & 0 deletions vendored_parsers/tree-sitter-gdscript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Rust artifacts
target/

# Node artifacts
build/
prebuilds/
node_modules/

# Swift artifacts
.build/

# Go artifacts
_obj/

# Python artifacts
.venv/
dist/
*.egg-info
*.whl

# C artifacts
*.a
*.so
*.so.*
*.dylib
*.dll
*.pc
parser.exp
parser.lib
parser.obj
scanner.obj

# Grammar volatiles
*.wasm
*.obj
*.o

# Archives
*.tar.gz
*.tgz
*.zip
8 changes: 8 additions & 0 deletions vendored_parsers/tree-sitter-gdscript/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
corpus
examples
build
script
parser.exp
parser.lib
parser.obj
scanner.obj
58 changes: 58 additions & 0 deletions vendored_parsers/tree-sitter-gdscript/CMakeLists.txt

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

Loading
Loading