Research portable Memory game | Исследовать портируемую игру Память
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

38 行
753B

  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. out = includes()
  11. # Parse.
  12. for ln in lines_in:
  13. ln = ln.rstrip()
  14. # Empty line.
  15. if ln == "":
  16. out += "\n"
  17. # Comment.
  18. elif (
  19. ln.startswith("#") and
  20. not f.isBody
  21. ):
  22. out += replaceComment(ln) + "\n"
  23. # Function.
  24. else:
  25. f.parseLine(ln)
  26. if f.isComplete:
  27. cpp = CPP(f)
  28. out += cpp.translate()
  29. # Create new function instance.
  30. f = Function()
  31. return out