Some docs and to_s testing

somewhat code_climate inspired
This commit is contained in:
Torsten Ruger
2018-09-01 15:54:25 +03:00
parent 2bb6ad5f61
commit d73e1526cd
12 changed files with 111 additions and 18 deletions

View File

@ -1,7 +1,14 @@
module Ruby
# Send and yield are very very similar, so they have a base class CallStatement
#
# The YieldStatement really only provides to_s, and has slightly
# different constructor. See CallStatement
#
class YieldStatement < CallStatement
# We give the instance of the yield and auto generated name
# Also, a yield is always (for now) on self
def initialize(arguments)
super("yield_#{object_id}".to_sym , SelfExpression.new , arguments)
end