Lines Matching refs:statement
27 def __init__(self, statement, line_no, variables): argument
28 self.statement = statement
81 def handle(self, statement, variables): argument
86 variant = statement.variant
88 self._if(statement, variables)
90 self._elif(statement, variables)
92 self._else(statement)
95 self._fi(statement)
107 def _if(self, statement, variables): argument
111 elif evaluate_line(statement, variables):
116 def _elif(self, statement, variables): argument
119 statement.line_no)
121 raise BadStructureException("CHECK-ELIF cannot be after CHECK-ELSE", statement.line_no)
125 if evaluate_line(statement, variables):
132 def _else(self, statement): argument
135 statement.line_no)
137 raise BadStructureException("Consecutive CHECK-ELSE statements", statement.line_no)
147 def _fi(self, statement): argument
149 raise BadStructureException("CHECK-FI does not have a matching CHECK-IF", statement.line_no)
163 def find_matching_line(statement, c1_pass, scope, variables, exclude_lines=[]): argument
177 new_variables = match_lines(statement, c1_pass.body[i], variables)
180 raise MatchFailedException(statement, scope.start, variables)
220 for statement in self.dag_queue:
221 assert statement.variant == TestStatement.Variant.DAG
222 match = find_matching_line(statement, self.c1_pass, scope, variables, matched_lines)
238 for statement in self.not_queue:
239 assert statement.variant == TestStatement.Variant.NOT
241 if match_lines(statement, self.c1_pass.body[i], self.variables) is not None:
242 raise MatchFailedException(statement, i, self.variables)
250 def handle_in_order(self, statement): argument
257 match = find_matching_line(statement, self.c1_pass, scope, self.variables)
260 def handle_next_line(self, statement): argument
269 statement.line_no)
272 match = find_matching_line(statement, self.c1_pass, scope, self.variables)
275 def handle_eval(self, statement): argument
280 if not evaluate_line(statement, self.variables):
281 raise MatchFailedException(statement, self.cursor, self.variables)
283 def handle(self, statement): argument
284 variant = None if statement is None else statement.variant
290 self.if_stack.handle(statement, self.variables)
307 self.handle_in_order(statement)
309 self.handle_next_line(statement)
311 self.dag_queue.append(statement)
313 self.not_queue.append(statement)
316 self.handle_eval(statement)
331 for statement in test_statements:
332 state.handle(statement)
358 if e.statement.variant == TestStatement.Variant.NOT:
366 Logger.test_failed(msg, e.statement, e.variables)