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

feat: add Groovy support #146

Merged
merged 1 commit into from
Feb 14, 2024
Merged

feat: add Groovy support #146

merged 1 commit into from
Feb 14, 2024

Conversation

jochil
Copy link
Contributor

@jochil jochil commented Feb 13, 2024

This change will integrate the groovy parser from https://github.com/murtaza64/tree-sitter-groovy into the project

@smacker
Copy link
Owner

smacker commented Feb 13, 2024

@jochil the tests are failing

@jochil
Copy link
Contributor Author

jochil commented Feb 13, 2024

@smacker thanks, I messed up a go import (fixed now). But not sure if the error came from that, as happens during go get.
Locally I get no errors now:

λ go version
go version go1.14 linux/amd64

λ go get -t ./...
# github.com/smacker/go-tree-sitter/lua
parser.c:235:17: warning: null character(s) preserved in literal
  235 |   [anon_sym_] = " ",
      |                 ^

λ go test ./...   
# github.com/smacker/go-tree-sitter/lua
parser.c:235:17: warning: null character(s) preserved in literal
  235 |   [anon_sym_] = " ",
      |                 ^
ok  	github.com/smacker/go-tree-sitter	2.074s
ok  	github.com/smacker/go-tree-sitter/bash	0.011s
ok  	github.com/smacker/go-tree-sitter/c	0.007s
ok  	github.com/smacker/go-tree-sitter/cpp	0.013s
ok  	github.com/smacker/go-tree-sitter/csharp	0.010s
ok  	github.com/smacker/go-tree-sitter/css	0.007s
ok  	github.com/smacker/go-tree-sitter/cue	0.009s
ok  	github.com/smacker/go-tree-sitter/dockerfile	0.007s
ok  	github.com/smacker/go-tree-sitter/elixir	0.010s
ok  	github.com/smacker/go-tree-sitter/elm	0.008s
ok  	github.com/smacker/go-tree-sitter/golang	0.005s
ok  	github.com/smacker/go-tree-sitter/groovy	0.009s
ok  	github.com/smacker/go-tree-sitter/hcl	0.026s
ok  	github.com/smacker/go-tree-sitter/html	0.011s
ok  	github.com/smacker/go-tree-sitter/java	0.008s
ok  	github.com/smacker/go-tree-sitter/javascript	0.006s
ok  	github.com/smacker/go-tree-sitter/kotlin	0.006s
ok  	github.com/smacker/go-tree-sitter/lua	0.010s
ok  	github.com/smacker/go-tree-sitter/ocaml	0.010s
ok  	github.com/smacker/go-tree-sitter/php	0.008s
ok  	github.com/smacker/go-tree-sitter/protobuf	0.007s
ok  	github.com/smacker/go-tree-sitter/python	0.007s
ok  	github.com/smacker/go-tree-sitter/ruby	0.009s
ok  	github.com/smacker/go-tree-sitter/rust	0.008s
ok  	github.com/smacker/go-tree-sitter/scala	0.004s
ok  	github.com/smacker/go-tree-sitter/svelte	0.007s
ok  	github.com/smacker/go-tree-sitter/toml	0.004s
ok  	github.com/smacker/go-tree-sitter/typescript/tsx	0.002s
ok  	github.com/smacker/go-tree-sitter/typescript/typescript	0.002s
ok  	github.com/smacker/go-tree-sitter/yaml	0.003s

would be great if you can approve the workflow run again to see if the broken import caused it

@smacker
Copy link
Owner

smacker commented Feb 14, 2024

it is probably failing because of groovy/scanner.c. The import says #include <tree_sitter/parser.h> but it should probably be ``#include <parser.h>`.

Did you use automation script? It suppose to fix it: https://github.com/smacker/go-tree-sitter/blob/master/_automation/main.go#L270

@jochil
Copy link
Contributor Author

jochil commented Feb 14, 2024

it is probably failing because of groovy/scanner.c. The import says #include <tree_sitter/parser.h> but it should probably be ``#include <parser.h>`.

Did you use automation script? It suppose to fix it: https://github.com/smacker/go-tree-sitter/blob/master/_automation/main.go#L270

strange that this was not a problem on my local setup... but now it is working thanks.
When I ran go run _automation/main.go update groovy first, it was not doing anything as the commit sha in the grammars.json was already the HEAD one. But switching back to an old version and let the script do the import worked just fine

@smacker smacker merged commit 1f283e2 into smacker:master Feb 14, 2024
4 checks passed
@smacker
Copy link
Owner

smacker commented Feb 14, 2024

thanks

@jochil jochil deleted the groovy-support branch February 14, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants