soml-parser/lib/ast/compound_expressions.rb
Torsten Ruger 95fbc3de1a move attributes under contractor
as it is essential that attributes are in the same order for the json
to work
2015-07-11 22:00:11 +03:00

32 lines
604 B
Ruby

module Ast
class ArrayExpression < Expression
attr_reader :values
def attributes
[:values]
end
def initialize vals
@values = vals
end
def inspect
self.class.name + ".new(" + values.to_s+ ")"
end
end
class AssociationExpression < Expression
attr_reader :key , :value
def initialize key , value
@key , @value = key , value
end
def attributes
[:key , :value]
end
def inspect
self.class.name + ".new(" + key.inspect + " , " + value.inspect + ")"
end
end
class HashExpression < ArrayExpression
end
end