Sha256: 9c656be2571ec333c1afb61e3ceadc9e6a6bc4d86360e3a2853f7530f9b7666b
Contents?: true
Size: 496 Bytes
Versions: 12
Compression:
Stored size: 496 Bytes
Contents
# Starts a new scope in the parsing process. Please also see the #captures # method. # class Parslet::Atoms::Scope < Parslet::Atoms::Base attr_reader :block def initialize(block) super() @block = block end def cached? false end def apply(source, context, consume_all) context.scope do parslet = block.call return parslet.apply(source, context, consume_all) end end def to_s_inner(prec) "scope { #{block.call.to_s(prec)} }" end end
Version data entries
12 entries across 12 versions & 2 rubygems