Improve CIL parsing
treble_sepolicy_tests gets very confused by parentheses in comments.
Fix the search for the opening parenthesis of a statement to skip
comments.
And then update a comment that was intended to use parentheses to
actually do so. (Without the parser change, this fails horribly.)
Test: Build
Change-Id: I1e36136e97dd9b8190add29b7f2155a08ea87d80
diff --git a/tests/mini_parser.py b/tests/mini_parser.py
index 25018a7..88a1998 100644
--- a/tests/mini_parser.py
+++ b/tests/mini_parser.py
@@ -71,7 +71,13 @@
s = ""
c = infile.read(1)
# get to first statement
- while c and c != "(":
+ while c:
+ if c == ';':
+ # comment, get rid of rest of the line
+ while c != '\n':
+ c = infile.read(1)
+ elif c == '(':
+ break
c = infile.read(1)
parens += 1