pulled assignment as special case from the operators

This commit is contained in:
Torsten Ruger
2014-06-24 19:33:21 +03:00
parent 58064637cb
commit 0ed11b507f
9 changed files with 61 additions and 39 deletions

View File

@ -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