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

Test tree-sitter c++ parser #1996

Merged
merged 1 commit into from
Nov 10, 2020
Merged

Test tree-sitter c++ parser #1996

merged 1 commit into from
Nov 10, 2020

Conversation

aryx
Copy link
Collaborator

@aryx aryx commented Nov 10, 2020

This will help #1952

test plan:
pad@yrax:~/work/lang-cpp/Cataclysm-DDA$ yy -lang cpp -test_parse_tree_sitter .

  • /home/pad/semgrep/build/default/cli/Main.exe -lang cpp -test_parse_tree_sitter .
    11 / 852/OVERLOAD/work/lang-cpp/Cataclysm-DDA/src/activity_actor.cpp: exn = Tree_sitter_run.Tree_sitter_error.Error(
    )
    ...

NB total files = 852; NB total lines = 474254; perfect = 662; pbs = 190; timeout = 0; =========> 77%
nb good = 174878, nb passed = 0 =========> 0.000000%
nb good = 174878, nb bad = 299376 =========> 36.874333%

For comparison, the C++/C/cpp parser in pfff is doing:
NB total files = 852; NB total lines = 473336; perfect = 110; pbs = 742; timeout = 0; =========> 12%
nb good = 160267, nb passed = 187 =========> 0.116680%
nb good = 160267, nb bad = 313069 =========> 33.859035%
pad@yrax:~/work/lang-cpp/Cataclysm-DDA$

This will help #1952

test plan:
pad@yrax:~/work/lang-cpp/Cataclysm-DDA$ yy -lang cpp -test_parse_tree_sitter .
+ /home/pad/semgrep/_build/default/cli/Main.exe -lang cpp -test_parse_tree_sitter .
11 / 852/OVERLOAD/work/lang-cpp/Cataclysm-DDA/src/activity_actor.cpp: exn = Tree_sitter_run.Tree_sitter_error.Error(_)
...

NB total files = 852; NB total lines = 474254; perfect = 662; pbs = 190; timeout = 0; =========> 77%
nb good = 174878,  nb passed = 0 =========> 0.000000%
nb good = 174878,  nb bad = 299376 =========> 36.874333%

For comparison, the C++/C/cpp parser in pfff is doing:
NB total files = 852; NB total lines = 473336; perfect = 110; pbs = 742; timeout = 0; =========> 12%
nb good = 160267,  nb passed = 187 =========> 0.116680%
nb good = 160267,  nb bad = 313069 =========> 33.859035%
pad@yrax:~/work/lang-cpp/Cataclysm-DDA$
@aryx aryx requested a review from mjambon November 10, 2020 09:30
@aryx
Copy link
Collaborator Author

aryx commented Nov 10, 2020

@mjambon I tried to use lang-stat in ocaml-tree-sitter but I didn't manage to compile in the ocaml-tree-sitter/lang/ directory.
Got some errors about git repositories and kotlin.

@aryx
Copy link
Collaborator Author

aryx commented Nov 10, 2020

ah sorry, it works now! I forgot 'make update' to get the kotlin submodule.

Now I get an error about npx though.
Generate parser in .
/bin/sh: 4: npx: not found

I tried make setup, but got some permissions errors. I had to chown pad /usr/local/lib and /usr/local/bin. and rm /usr/loca/bin/npx with a sudo.

@aryx aryx merged commit 1777183 into develop Nov 10, 2020
@aryx aryx deleted the cpp branch November 10, 2020 10:05
@mjambon
Copy link
Member

mjambon commented Nov 10, 2020

ok, great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants