Auxiliary scope for function
| 37 | |
| 38 | |
| 39 | class FunctionScope: |
| 40 | """Auxiliary scope for function""" |
| 41 | |
| 42 | def __init__(self, block_builder, name, params, attrs, is_pure): |
| 43 | self._bb = block_builder |
| 44 | self._name = name |
| 45 | self._params = params |
| 46 | self._attrs = attrs |
| 47 | self._is_pure = is_pure |
| 48 | |
| 49 | # Blocks that have been collected within the function |
| 50 | self._blocks = [] |
| 51 | # a boolean flag that tracks if emit_func_output has been called |
| 52 | self._is_emit_func_output_called = False |
| 53 | |
| 54 | def __enter__(self): |
| 55 | self._bb._enter_function_scope(self) |
| 56 | |
| 57 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 58 | # __exit__ should properly handle the case where the with block exits with an exception |
| 59 | # when handling error case in exit, always check if there is already an exception |
| 60 | # been thrown in the with block |
| 61 | self._bb._exit_function_scope(exc_type, exc_val, exc_tb) |
| 62 | |
| 63 | |
| 64 | class DataflowScope: |
no outgoing calls
no test coverage detected
searching dependent graphs…