2014-06-04 18:59:38 +02:00
|
|
|
module Ast
|
|
|
|
|
|
|
|
class ArrayExpression < Expression
|
|
|
|
attr_reader :values
|
2015-07-11 21:00:11 +02:00
|
|
|
def attributes
|
|
|
|
[:values]
|
|
|
|
end
|
2014-06-04 18:59:38 +02:00
|
|
|
def initialize vals
|
|
|
|
@values = vals
|
|
|
|
end
|
|
|
|
def inspect
|
|
|
|
self.class.name + ".new(" + values.to_s+ ")"
|
|
|
|
end
|
|
|
|
end
|
2015-07-11 21:00:11 +02:00
|
|
|
|
2014-06-04 18:59:38 +02:00
|
|
|
class AssociationExpression < Expression
|
|
|
|
attr_reader :key , :value
|
|
|
|
def initialize key , value
|
|
|
|
@key , @value = key , value
|
|
|
|
end
|
|
|
|
def attributes
|
|
|
|
[:key , :value]
|
|
|
|
end
|
2015-07-11 21:00:11 +02:00
|
|
|
def inspect
|
|
|
|
self.class.name + ".new(" + key.inspect + " , " + value.inspect + ")"
|
|
|
|
end
|
2014-06-04 18:59:38 +02:00
|
|
|
|
|
|
|
end
|
|
|
|
class HashExpression < ArrayExpression
|
|
|
|
end
|
2015-07-11 21:00:11 +02:00
|
|
|
end
|