Add script for testing the parser against popular repositories
This commit is contained in:
parent
01d428d3a6
commit
e846449ef6
|
@ -89,6 +89,9 @@ npm run format
|
||||||
|
|
||||||
# Run parser against the given repository
|
# Run parser against the given repository
|
||||||
scripts/parse_repo.sh elixir-lang/elixir
|
scripts/parse_repo.sh elixir-lang/elixir
|
||||||
|
|
||||||
|
# Run parser against a predefined list of popular repositories
|
||||||
|
scripts/integration_test.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## Implementation notes
|
## Implementation notes
|
||||||
|
|
|
@ -58,8 +58,6 @@ const ATOM_OPERATOR_LITERALS = ALL_OPS.filter(
|
||||||
(operator) => !/[a-z]/.test(operator) && operator !== "=>"
|
(operator) => !/[a-z]/.test(operator) && operator !== "=>"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Note that for keywords we use external scanner (KEYWORD_SPECIAL_LITERAL),
|
|
||||||
// so it should be kept in sync
|
|
||||||
const ATOM_SPECIAL_LITERALS = ["...", "%{}", "{}", "%", "<<>>", "..//"];
|
const ATOM_SPECIAL_LITERALS = ["...", "%{}", "{}", "%", "<<>>", "..//"];
|
||||||
|
|
||||||
// See Ref 6. in the docs
|
// See Ref 6. in the docs
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
print_usage_and_exit() {
|
||||||
|
echo "Usage: $0"
|
||||||
|
echo ""
|
||||||
|
echo "Runs the parser against a predefined list of popular Elixir repositories"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 0 ]; then
|
||||||
|
print_usage_and_exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
repos="elixir-lang/elixir elixir-lang/ex_doc elixir-plug/plug elixir-ecto/ecto dashbitco/broadway elixir-nx/nx elixir-nx/axon livebook-dev/livebook"
|
||||||
|
|
||||||
|
for repo in $repos; do
|
||||||
|
./scripts/parse_repo.sh $repo
|
||||||
|
done
|
|
@ -26,7 +26,7 @@ dir="tmp/gh/${gh_repo//[\/-]/_}"
|
||||||
|
|
||||||
if [[ ! -d "$dir" ]]; then
|
if [[ ! -d "$dir" ]]; then
|
||||||
mkdir -p "$(dirname "$dir")"
|
mkdir -p "$(dirname "$dir")"
|
||||||
git clone "https://github.com/$gh_repo.git" "$dir"
|
git clone --depth 1 "https://github.com/$gh_repo.git" "$dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Running parser against $gh_repo"
|
echo "Running parser against $gh_repo"
|
||||||
|
|
Loading…
Reference in New Issue