# File sexpressions.rb, line 7 def self.stringer(opener, closer=nil, translate={}) closer = opener if closer.nil? escape = (string('\\') >> any).map do |charnum| escaped = charnum.chr translate[escaped] || escaped end open = string(opener) close = string(closer) other = not_string(closer).map{|charnum| charnum.chr } string = (open >> (escape|other).many << close).map {|strings| strings.to_s } end