From a443be75e5fa2af612f0bba81c3b96f74152c161 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 9 Sep 2011 00:52:36 +0200 Subject: Ruby scanner accepts :state options and provides #interpreted_string_state method --- lib/coderay/scanners/ruby.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/coderay/scanners/ruby.rb') diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 9515bdc..4244ab7 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -16,6 +16,10 @@ module Scanners autoload :Patterns, 'coderay/scanners/ruby/patterns' autoload :StringState, 'coderay/scanners/ruby/string_state' + def interpreted_string_state + StringState.new :string, true, '"' + end + protected def setup @@ -23,7 +27,7 @@ module Scanners end def scan_tokens encoder, options - state, heredocs = @state + state, heredocs = options[:state] || @state heredocs = heredocs.dup if heredocs.is_a?(Array) if state && state.instance_of?(StringState) -- cgit v1.2.1