Module: Speculations::Parser::State::In

Extended by:
In
Includes:
Speculations::Parser::State
Included in:
In
Defined in:
lib/speculations/parser/state/in.rb

Constant Summary

Constants included from Triggers

Triggers::BLANK_RGX, Triggers::CONTEXT_RGX, Triggers::EOBLOCK_RGX, Triggers::EXAMPLE_RGX, Triggers::GIVEN_RGX, Triggers::RUBY_RGX, Triggers::THEN_RGX

Instance Method Summary collapse

Methods included from Triggers

#blank_line, #context_match, #eoblock_match, #maybe_example, #maybe_include, #ruby_code_block

Instance Method Details

#parse(line, lnb, node, ctxt, debug: true) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/speculations/parser/state/in.rb', line 8

def parse line, lnb, node, ctxt, debug: true
  case
  when State.eoblock_match(line)
    dbg_match("eblock", lnb, debug:)
    [ctxt, node.parent]
  else
    [:in, node.add_line(line), ctxt]
  end
end