Class: L43Rmap::Runtime::LineTime

Inherits:
Object
  • Object
show all
Defined in:
lib/l43_rmap/runtime/line_time.rb

Constant Summary collapse

Ast =
L43Rmap::Ast
Chunk =
L43Rmap::Chunk
Function =
L43Rmap::Function

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



13
14
15
# File 'lib/l43_rmap/runtime/line_time.rb', line 13

def line
  @line
end

#lnbObject (readonly)

Returns the value of attribute lnb.



13
14
15
# File 'lib/l43_rmap/runtime/line_time.rb', line 13

def lnb
  @lnb
end

#randObject (readonly)

Returns the value of attribute rand.



13
14
15
# File 'lib/l43_rmap/runtime/line_time.rb', line 13

def rand
  @rand
end

#runtimeObject (readonly)

Returns the value of attribute runtime.



13
14
15
# File 'lib/l43_rmap/runtime/line_time.rb', line 13

def runtime
  @runtime
end

#terminatedObject (readonly)

Returns the value of attribute terminated.



13
14
15
# File 'lib/l43_rmap/runtime/line_time.rb', line 13

def terminated
  @terminated
end

#timeObject (readonly)

Returns the value of attribute time.



13
14
15
# File 'lib/l43_rmap/runtime/line_time.rb', line 13

def time
  @time
end

Instance Method Details

#fieldsObject



35
# File 'lib/l43_rmap/runtime/line_time.rb', line 35

def fields =  @__fields__ ||= line.split

#outstackObject



37
# File 'lib/l43_rmap/runtime/line_time.rb', line 37

def outstack =  @__outstack__ ||= []

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/l43_rmap/runtime/line_time.rb', line 15

def run
  chunks = runtime.chunks
  # p(chunks: chunks.map(&:show))
  loop do
    case chunks
    in []
      return outstack.compact
    in [chunk, *chunks]
      result = chunk.(self)
      # p(result:)
      case result
      when Symbol
        return result
      else
        outstack.push(result)
      end
    end
  end
end

#terminate!Object



39
# File 'lib/l43_rmap/runtime/line_time.rb', line 39

def terminate! = @terminated=true