Add compatibility with macOS #6
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5
find_map_test_cases.py
was producing the following error:I found out that the
(not a mach-o file)
part indicates an issue with macOS compatibility. I compiled the java language with tree-sitter usinggcc -shared -o libtree-sitter-java.dylib -Isrc src/parser.c
. I committed the resulting file, which should be passed into the--grammar
argument when running the script on macOS. As a result, grammar file is loaded correctly.find
command was not working, so I added if statement that checks if the platform is macOS and uses a different syntax.No tests_norm was being found in focals_norm. This is probably due to the different formats returned by grep in different platforms. I added an if statement that checks if the platform is macOS and removes the
./
from the beginning of the test file path.The default value for the
--grammar
argument was not working because it required an absolute path. I added an if statement that checks if the given path is not absolute, and in that case prefixes it with the absolute path of the current working directory.Fixed a few typos in README
I tested these changes on the hadoop repository. The tests are successfully identified and correctly mapped to classes and methods.