-
Notifications
You must be signed in to change notification settings - Fork 7
[WIP] Update to pick up new grammars #16
base: master
Are you sure you want to change the base?
Conversation
Starting to add benchmarks and tests now. I noticed that the current benchmarks seem to always be running with the JSON parser, so I've fixed that. I think I'll split the benchs up by parser as well, since it will grow quite a lot. Just need to fix the Linux build as well. |
Also add all Licenses to the README.
@bryphe, am I missing something with the Linux build? I assume its just some obvious flag that I'm missing, just odd that the Mac build is happy. |
The value should be shown in the test output anyways.
Drop symlink since we don't use it, and Windows CI build isn't happy.
type t = | ||
| Json | ||
| C | ||
| Cpp | ||
| Python | ||
| Javascript | ||
| Typescript | ||
| Tsx; | ||
|
||
let getLanguageFromScope = scope => | ||
switch (scope) { | ||
| "source.json" => Some(Json) | ||
| "source.c" => Some(C) | ||
| "source.cpp" => Some(Cpp) | ||
| "source.python" => Some(Python) | ||
| "source.js" => Some(Javascript) | ||
| "source.ts" => Some(Typescript) | ||
| "source.tsx" => Some(Tsx) | ||
| _ => None | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best way to do this?
I.e. right now you give a scope and get back an option then action on that, and assuming there is a language, you can use that to request the parser/scope converter. Wasn't sure if there was a cleaner way, that also keeps one source of truth for the supported languages, so changing this list enforces a parser and scope converter are added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is reasonable - although we could also consider an API that gives a parser/scope converter
combo for a given scope. But for now I think this OK - as we use it, we could see if it could be streamlined
doBench("String: Small C++", parse(simpleC, cppParser)); | ||
doBench("String: Small JS", parse(simpleJs, jsParser)); | ||
doBench("String: Small TS", parse(simpleTs, tsParser)); | ||
doBench("String: Small Python", parse(simplePy, pyParser)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for adding these benchmarks, @CrossR
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
The partnered PR for the
esy-tree-sitter
bits.Just need to fix the building of the C++ bits.