68 lines
1.7 KiB
Plaintext
68 lines
1.7 KiB
Plaintext
================================================================================
|
|
Simple Yield
|
|
================================================================================
|
|
|
|
1 -> output
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(expression
|
|
(yield
|
|
(expression
|
|
(value
|
|
(integer)))
|
|
(function_expression
|
|
(value
|
|
(built_in_value)))))))
|
|
|
|
================================================================================
|
|
Yield Chain
|
|
================================================================================
|
|
|
|
x -> foo -> bar -> abc
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(expression
|
|
(yield
|
|
(expression
|
|
(yield
|
|
(expression
|
|
(yield
|
|
(expression
|
|
(identifier))
|
|
(function_expression
|
|
(identifier))))
|
|
(function_expression
|
|
(identifier))))
|
|
(function_expression
|
|
(identifier))))))
|
|
|
|
================================================================================
|
|
Yielded Function Call
|
|
================================================================================
|
|
|
|
x -> foo(1)()
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(expression
|
|
(function_call
|
|
(function_expression
|
|
(function_call
|
|
(function_expression
|
|
(yield
|
|
(expression
|
|
(identifier))
|
|
(function_expression
|
|
(identifier))))
|
|
(expression
|
|
(value
|
|
(integer)))))))))
|