| 139 | |
| 140 | |
| 141 | def load_source(path: Union[Path, str], smt_use: SMTUse) -> str: |
| 142 | # NOTE: newline='' disables newline conversion. |
| 143 | # We want the file exactly as is because changing even a single byte in the source affects metadata. |
| 144 | with open(path, mode='r', encoding='utf8', newline='') as source_file: |
| 145 | file_content = source_file.read() |
| 146 | |
| 147 | if smt_use == SMTUse.STRIP_PRAGMAS: |
| 148 | return file_content.replace('pragma experimental SMTChecker;', '', 1) |
| 149 | |
| 150 | return file_content |
| 151 | |
| 152 | |
| 153 | def clean_string(value: Optional[str]) -> Optional[str]: |