t232.trans 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. Module(body=[Assign(targets=[Name(id='c',
  2. ctx=Store())],
  3. value=Str(s='squirrel')),
  4. Assign(targets=[Name(id='time',
  5. ctx=Store())],
  6. value=Num(n=0)),
  7. FunctionDef(name='x',
  8. args=arguments(args=[],
  9. vararg=None,
  10. kwarg=None,
  11. defaults=[]),
  12. body=[Global(names=['time']),
  13. AugAssign(target=Name(id='time',
  14. ctx=Store()),
  15. op=Add(),
  16. value=Num(n=1)),
  17. If(test=Compare(left=Name(id='time',
  18. ctx=Load()),
  19. ops=[Eq()],
  20. comparators=[Num(n=1)]),
  21. body=[Assign(targets=[Name(id='b',
  22. ctx=Store())],
  23. value=Str(s='dog'))],
  24. orelse=[Assign(targets=[Name(id='b',
  25. ctx=Store())],
  26. value=Str(s='banana'))]),
  27. Print(dest=None,
  28. values=[Name(id='b',
  29. ctx=Load()),
  30. Name(id='c',
  31. ctx=Load())],
  32. nl=True),
  33. FunctionDef(name='y',
  34. args=arguments(args=[Name(id='d',
  35. ctx=Param())],
  36. vararg=None,
  37. kwarg=None,
  38. defaults=[]),
  39. body=[Assign(targets=[Name(id='a',
  40. ctx=Store())],
  41. value=Str(s='cat')),
  42. Print(dest=None,
  43. values=[Name(id='a',
  44. ctx=Load()),
  45. Name(id='b',
  46. ctx=Load()),
  47. Name(id='d',
  48. ctx=Load())],
  49. nl=True),
  50. FunctionDef(name='z',
  51. args=arguments(args=[],
  52. vararg=None,
  53. kwarg=None,
  54. defaults=[]),
  55. body=[For(target=Name(id='i',
  56. ctx=Store()),
  57. iter=Call(func=Name(id='range',
  58. ctx=Load()),
  59. args=[BinOp(left=Num(n=10),
  60. op=Mult(),
  61. right=Name(id='time',
  62. ctx=Load()))],
  63. keywords=[],
  64. starargs=None,
  65. kwargs=None),
  66. body=[Expr(value=Yield(value=Tuple(elts=[Name(id='i',
  67. ctx=Load()),
  68. Name(id='a',
  69. ctx=Load()),
  70. Name(id='b',
  71. ctx=Load()),
  72. Name(id='c',
  73. ctx=Load()),
  74. Name(id='d',
  75. ctx=Load())],
  76. ctx=Load())))],
  77. orelse=[])],
  78. decorator_list=[]),
  79. Return(value=Name(id='z',
  80. ctx=Load()))],
  81. decorator_list=[]),
  82. Return(value=Call(func=Name(id='y',
  83. ctx=Load()),
  84. args=[Str(s='blorp')],
  85. keywords=[],
  86. starargs=None,
  87. kwargs=None))],
  88. decorator_list=[]),
  89. For(target=Name(id='v',
  90. ctx=Store()),
  91. iter=Call(func=Call(func=Name(id='x',
  92. ctx=Load()),
  93. args=[],
  94. keywords=[],
  95. starargs=None,
  96. kwargs=None),
  97. args=[],
  98. keywords=[],
  99. starargs=None,
  100. kwargs=None),
  101. body=[Print(dest=None,
  102. values=[Name(id='v',
  103. ctx=Load())],
  104. nl=True)],
  105. orelse=[]),
  106. For(target=Name(id='v',
  107. ctx=Store()),
  108. iter=Call(func=Call(func=Name(id='x',
  109. ctx=Load()),
  110. args=[],
  111. keywords=[],
  112. starargs=None,
  113. kwargs=None),
  114. args=[],
  115. keywords=[],
  116. starargs=None,
  117. kwargs=None),
  118. body=[Print(dest=None,
  119. values=[Name(id='v',
  120. ctx=Load())],
  121. nl=True)],
  122. orelse=[])])