summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-02-25 10:15:15 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-02-25 10:15:15 -0800
commit51c52bb5e1547c4abece7e9ee0ca0c5fa1e8f4e2 (patch)
treebe8a0957800b17f96f54700dfd31ec42f2de404d
parent0bc91f2983cfcf44cb94a94454e8b689b58dec43 (diff)
downloadbinaryen-51c52bb5e1547c4abece7e9ee0ca0c5fa1e8f4e2.tar.gz
binaryen-51c52bb5e1547c4abece7e9ee0ca0c5fa1e8f4e2.tar.bz2
binaryen-51c52bb5e1547c4abece7e9ee0ca0c5fa1e8f4e2.zip
support block comments in check.py
-rwxr-xr-xcheck.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/check.py b/check.py
index 16a235ec6..45fd08b15 100755
--- a/check.py
+++ b/check.py
@@ -174,6 +174,12 @@ def split_wast(wast):
i = 0
while i >= 0:
start = wast.find('(', i)
+ if start >= 0 and wast[start+1] == ';':
+ # block comment
+ i = wast.find(';)', start+2)
+ assert i > 0, wast[start:]
+ i += 2
+ continue
skip = wast.find(';', i)
if skip >= 0 and skip < start and skip + 1 < len(wast):
if wast[skip+1] == ';':
@@ -188,7 +194,6 @@ def split_wast(wast):
continue
elif chunk.startswith(('(assert', '(invoke')):
ret[-1][1].append(chunk)
- assert len(ret) > 0
return ret
def binary_format_check(wast, verify_final_result=True):