pulled assignment as special case from the operators
This commit is contained in:
@ -16,4 +16,22 @@ module Ast
|
||||
"#{left} #{operator} #{right}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class AssignmentExpression < Expression
|
||||
attr_reader :left, :right
|
||||
|
||||
def initialize left, right
|
||||
@left, @right = left, right
|
||||
end
|
||||
def attributes
|
||||
[:left, :right]
|
||||
end
|
||||
def inspect
|
||||
self.class.name + ".new(" + left.inspect + "," + right.inspect + ")"
|
||||
end
|
||||
def to_s
|
||||
"#{left} = #{right}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user