Skip to content

Commit 97daabe

Browse files
committed
Add scripts and update swift-syntax version
1 parent a71642c commit 97daabe

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/apple/swift-syntax.git",
1616
"state" : {
17-
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
18-
"version" : "509.0.2"
17+
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
18+
"version" : "509.1.1"
1919
}
2020
},
2121
{

Scripts/demangle.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/zsh
2+
3+
# A `realpath` alternative using the default C implementation.
4+
filepath() {
5+
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
6+
}
7+
8+
OG_ROOT="$(dirname $(dirname $(filepath $0)))"
9+
10+
# Get the language and input file path from the arguments
11+
language=${1:-"swift"}
12+
input_file=${2:-"$(dirname $(filepath $0))/demangle.txt"}
13+
14+
echo "Demangling $input_file using $language mode"
15+
16+
# Read each line of the input file
17+
while IFS= read -r line; do
18+
# Demangle the line using the appropriate tool based on the language
19+
if [[ $language == "swift" ]]; then
20+
xcrun swift-demangle "$line"
21+
elif [[ $language == "c++" ]]; then
22+
c++filt "$line"
23+
else
24+
echo "Invalid language: $language"
25+
echo "Usage: demangle.sh <language> <input file>"
26+
echo "language: swift or c++, [default]: swift"
27+
echo "input file: [default] demangle.txt"
28+
exit 1
29+
fi
30+
done < "$input_file"

Scripts/demangle.txt

Whitespace-only changes.

Scripts/openswiftui_swiftinterface.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/zsh
2+
3+
# A `realpath` alternative using the default C implementation.
4+
filepath() {
5+
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
6+
}
7+
8+
OG_ROOT="$(dirname $(dirname $(filepath $0)))"
9+
10+
cd $OG_ROOT
11+
12+
export OPENSWIFTUI_SWIFT_TESTING=0
13+
export OPENGRAPH_SWIFT_TESTING=0
14+
swift build -c release -Xswiftc -emit-module-interface -Xswiftc -enable-library-evolution

0 commit comments

Comments
 (0)