summaryrefslogtreecommitdiff
path: root/scripts/clean_c_api_trace.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/clean_c_api_trace.py')
-rwxr-xr-xscripts/clean_c_api_trace.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/clean_c_api_trace.py b/scripts/clean_c_api_trace.py
index e2bfa30ab..006a0ce4f 100755
--- a/scripts/clean_c_api_trace.py
+++ b/scripts/clean_c_api_trace.py
@@ -14,9 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-'''
-Cleans up output from the C api, makes a runnable C file
-'''
+"""Cleans up output from the C api, makes a runnable C file
+"""
import sys
@@ -24,14 +23,14 @@ trace = open(sys.argv[1]).read()
start = trace.find('// beginning a Binaryen API trace')
if start >= 0:
- trace = trace[start:]
+ trace = trace[start:]
- while 1:
- start = trace.find('\n(')
- if start < 0:
- break
- end = trace.find('\n)', start + 1)
- assert end > 0
- trace = trace[:start] + trace[end + 2:]
+ while 1:
+ start = trace.find('\n(')
+ if start < 0:
+ break
+ end = trace.find('\n)', start + 1)
+ assert end > 0
+ trace = trace[:start] + trace[end + 2:]
- print(trace)
+ print(trace)