Class: Atomy::Code::Pattern

Inherits:
Object show all
Defined in:
lib/atomy/code/pattern.rb,
lib/atomy/code/pattern/and.rb,
lib/atomy/code/pattern/splat.rb,
lib/atomy/code/pattern/wildcard.rb,
lib/atomy/code/pattern/quasi_quote.rb

Direct Known Subclasses

And, QuasiQuote, Splat, Wildcard

Defined Under Namespace

Classes: And, QuasiQuote, Splat, Wildcard

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Pattern

Returns a new instance of Pattern.



6
7
8
# File 'lib/atomy/code/pattern.rb', line 6

def initialize(node)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



4
5
6
# File 'lib/atomy/code/pattern.rb', line 4

def node
  @node
end

Instance Method Details

#assign(gen) ⇒ Object

value, pattern

on stack



15
16
# File 'lib/atomy/code/pattern.rb', line 15

def assign(gen)
end

#bytecode(gen, mod) ⇒ Object



10
11
12
# File 'lib/atomy/code/pattern.rb', line 10

def bytecode(gen, mod)
  mod.compile(gen, @node)
end

#splat?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/atomy/code/pattern.rb', line 18

def splat?
  false
end