Module: Rattler::Compiler::ParserGenerator::List1Generating

Includes:
PredicatePropogating
Defined in:
lib/rattler/compiler/parser_generator/list1_generating.rb

Instance Method Summary collapse

Methods included from PredicatePropogating

#gen_assert, #gen_disallow, #gen_intermediate_assert, #gen_intermediate_disallow

Instance Method Details

#gen_skip(list, scope = ParserScope.empty) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/rattler/compiler/parser_generator/list1_generating.rb', line 8

def gen_skip(list, scope = ParserScope.empty)
  expr :block do
    (@g << "#{result_name} = false").newline
    gen_skipping(list, scope) { (@g << "#{result_name} = true").newline }
    @g << "@scanner.pos = #{end_pos_name} unless #{end_pos_name}.nil?"
    @g.newline << result_name
  end
end