Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
537B

  1. from CPP import *
  2. from Function import *
  3. def process(FILE_IN):
  4. # Read file.
  5. lines_in = []
  6. with open(FILE_IN) as file:
  7. for line in file:
  8. lines_in.append(line.rstrip())
  9. f = Function()
  10. # Parse.
  11. for ln in lines_in:
  12. ln = ln.rstrip()
  13. # Ignore includes.
  14. if "#include" in ln:
  15. continue
  16. f.parseLine(ln)
  17. if f.isComplete:
  18. print("Function ready!")
  19. break
  20. print(f"Debug: {f}")
  21. cpp = CPP(f)
  22. return cpp.translate()