Module: Sexpr::Node

Included in:
Sexpr
Defined in:
lib/sexpr/node.rb

Constant Summary collapse

EMPTY_TRACKING_MARKERS =
{}

Instance Method Summary collapse

Instance Method Details

#sexpr_bodyObject Also known as: sexp_body



19
20
21
# File 'lib/sexpr/node.rb', line 19

def sexpr_body
  self[1..-1]
end

#sexpr_copy(&block) ⇒ Object Also known as: dup



24
25
26
27
28
29
30
31
# File 'lib/sexpr/node.rb', line 24

def sexpr_copy(&block)
  if block
    copy = sexpr_copy_tagging([ sexpr_type ])
    sexpr_body.inject(copy, &block)
  else
    sexpr_copy_tagging(self[0..-1])
  end
end

#sexpr_typeObject Also known as: sexp_type



14
15
16
# File 'lib/sexpr/node.rb', line 14

def sexpr_type
  first
end

#tracking_markersObject



6
7
8
# File 'lib/sexpr/node.rb', line 6

def tracking_markers
  @tracking_markers ||= EMPTY_TRACKING_MARKERS
end

#tracking_markers=(markers) ⇒ Object



10
11
12
# File 'lib/sexpr/node.rb', line 10

def tracking_markers=(markers)
  @tracking_markers = markers
end