Module: Speculations::Parser::State::SpecifyBlock
- Extended by:
- SpecifyBlock
- Included in:
- SpecifyBlock
- Defined in:
- lib/speculations/parser/state/specify_block.rb
Instance Method Summary collapse
-
#parse(data) ⇒ Object
def parse line, lnb, node, _ctxt, debug: false.
Instance Method Details
#parse(data) ⇒ Object
def parse line, lnb, node, _ctxt, debug: false
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/speculations/parser/state/specify_block.rb', line 8 def parse(data) # data.info(:specify_block) line = data.line case when State.blank_line(line) #dbg_match("blank_line", data) data.up_to_context(:examples) when State.eoblock_match(line) #dbg_match("eblock", data) data.update(state: :out, node: data.node.parent.parent) else #dbg_match("add line to specify block", data) data.update(node: data.node.add_line(line)) end end |