MaibornWolff / metric-gardener

BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Add support for Perl #190

Open ResistantBear opened 6 months ago

ResistantBear commented 6 months ago

Add support for the Perl programming language.

clemens-mw commented 5 months ago

Tree-sitter has no official library supporting Perl. However, there are two other options: https://github.com/ganezdragon/tree-sitter-perl https://github.com/tree-sitter-perl

Should we try to use them?

clemens-mw commented 5 months ago

Opened issues to ask if they plan puiblishing their packages to the npm repository: https://github.com/ganezdragon/tree-sitter-perl/issues/42 https://github.com/tree-sitter-perl/tree-sitter-perl/issues/165

rabbiveesh commented 5 months ago

Obviously my opinion is biased, but i would recommend using the tree-sitter-perl/tree-sitter-perl over ganezdragon's parser, b/c it's significantly more correct (there's a reason i started a new parser from scratch)

clemens-mw commented 4 months ago

there are two branches for the two libraries: feat/190/perl-support-using-hacktoberfest-lib feat/190/perl-support-using-ganezdragon-lib

both of them are not working properly

rabbiveesh commented 4 months ago

Is there any way I can help with the hacktoberfest branch? I maintain the parser

clemens-mw commented 4 months ago

This would be great! I did not continue working on the branch, because I was waiting for it to be published to the npm registry (https://github.com/tree-sitter-perl/tree-sitter-perl/issues/165)

I managed to install your parser from the GitHub repository, but that is rather ugly: https://github.com/MaibornWolff/metric-gardener/commit/5adde4470140376cd64129c40918d4bd8354a148 It would be great if you could publish it to the npm registry so that we can use it in our project just like the parsers for the other languages (and the special handling for Perl is not needed in the prepare script).

Also, if I run the tests now, they fail with the following error: tree-sitter-perl/build/Release/tree_sitter_perl_binding.node: undefined symbol: tree_sitter_perl_external_scanner_create If you could solve this issue, so that the tests run (but fail because actual values don't match the expected ones), that would be perfect

Feel free to open pull requests if you wish to contribute to our repository directly :)

Thanks a lot!!