Sha256: 8809e05b40f91a2ade51b068f11b1b373b73b438e3269fe985fec3141807a5b1
Contents?: true
Size: 868 Bytes
Versions: 3
Compression:
Stored size: 868 Bytes
Contents
module Sexpr class Processor class SexprCoercions < Helper module Methods def parse(*args) sexpr_grammar.parse(*args) end def sexpr(*args) sexpr_grammar.sexpr(*args) end end def call(processor, sexpr, &bl) # input coercion sexpr = grammar(processor).sexpr(sexpr) # recursive call sexpr = next_call(processor, sexpr, bl) # output coercion if sexpr.is_a?(Array) and sexpr.first.is_a?(Symbol) grammar(processor).sexpr(sexpr) else sexpr end end private def grammar(processor) if processor.respond_to?(:sexpr_grammar) processor.sexpr_grammar else Sexpr end end end # class SexprCoercions end # class Processor end # module Sexpr
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sexpr-0.5.1 | lib/sexpr/processor/sexpr_coercions.rb |
sexpr-0.5.0 | lib/sexpr/processor/sexpr_coercions.rb |
sexpr-0.4.0 | lib/sexpr/processor/sexpr_coercions.rb |