File tree 1 file changed +13
-7
lines changed 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+
3
+ # Usage: ./test_on_cpp2_files.sh /path/to/directory
4
+
2
5
set -e
3
6
4
7
# Directory to search
@@ -13,10 +16,15 @@ exclude_patterns=(
13
16
" msvc-msstl-e.cpp2"
14
17
" gcc-10-libstdc++-e.cpp2"
15
18
" clang-12-libstdc++-e.cpp2"
19
+ " pure2-bugfix-for-bad-decltype-error.cpp2"
20
+ " pure2-bugfix-for-bad-parameter-error.cpp2"
21
+ " pure2-bugfix-for-bad-using-error.cpp2"
22
+ " pure2-bugfix-for-naked-unsigned-char-error.cpp2"
23
+ " pure2-bugfix-for-namespace-error.cpp2"
16
24
)
17
25
26
+ # Build the find command
18
27
find_command=" find \" $search_dir \" -type f \( -name \" *.cpp2\" -o -name \" *.h2\" \)"
19
-
20
28
for pattern in " ${exclude_patterns[@]} " ; do
21
29
find_command+=" ! -name \" $pattern \" "
22
30
done
@@ -26,17 +34,15 @@ if [ -f cpp2_files.txt ]; then
26
34
exit 1
27
35
fi
28
36
29
- # find_command="$find_command -exec sh -c 'tree-sitter parse -q "\$1" || exit 255' _ {} \;"
30
- echo " Command: " $find_command
37
+ # Ensure that cpp2_files.txt is removed on exit (even if an error occurs)
38
+ trap ' rm cpp2_files.txt' EXIT
39
+
40
+ echo " Command: $find_command "
31
41
eval $find_command > cpp2_files.txt
32
42
33
43
while IFS= read -r file; do
34
44
echo " Parsing '$file '"
35
45
tree-sitter parse -q " $file "
36
46
done < cpp2_files.txt
37
47
38
- rm cpp2_files.txt
39
-
40
48
echo " Done"
41
-
42
- # Usage: ./test_on_cpp2_files.sh /path/to/directory
You can’t perform that action at this time.
0 commit comments