(lines, i, filename)
| 32 | |
| 33 | |
| 34 | def GetCodeFile(lines, i, filename): |
| 35 | if '```' not in lines[i + 1]: |
| 36 | raise ValueError( |
| 37 | 'Syntax Error, code block should be tightly followed by "[//file]:#" ' |
| 38 | ) |
| 39 | i += 2 |
| 40 | code = '' |
| 41 | while True: |
| 42 | if '```' in lines[i]: |
| 43 | break |
| 44 | code += lines[i] |
| 45 | i += 1 |
| 46 | with open(filename, 'w+') as f: |
| 47 | f.write(code) |
| 48 | |
| 49 | |
| 50 | def GetTestFile(lines, i, filename): |