Sha256: 22cd25f1f37cab5b7a5d27b8eb2bf8078e4192ab8eaaeb72daeab94fed8c1da9

Contents?: true

Size: 893 Bytes

Versions: 2

Compression:

Stored size: 893 Bytes

Contents

class Nodes < Struct.new(:nodes)
  def <<(node) # Useful method for adding a node on the fly.
    nodes << node
    self
  end
end

class LiteralNode < Struct.new(:value); end

class NumberNode < LiteralNode; end

class StringNode < LiteralNode; end

class TrueNode < LiteralNode
  def initialize
    super(true)
  end
end

class FalseNode < LiteralNode
  def initialize
    super(false)
  end
end

class NilNode < LiteralNode
  def initialize
    super(nil)
  end
end

class CallNode < Struct.new(:receiver, :method, :arguments); end

class GetConstantNode < Struct.new(:name); end

class SetConstantNode < Struct.new(:name, :value); end

class GetLocalNode < Struct.new(:name); end

class SetLocalNode < Struct.new(:name, :value); end

class DefNode < Struct.new(:name, :params, :body); end

class ClassNode < Struct.new(:name, :body); end

class IfNode  < Struct.new(:condition, :body); end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
turmali-0.0.3 lib/turmali/nodes.rb
turmali-0.0.2 lib/turmali/nodes.rb